Message ID | 20231109163512.179524-34-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp560300vqs; Thu, 9 Nov 2023 08:41:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IE60ca5BQYqqyoySRYzjTaAijCv5x+UgrLUcafFbDpt0fE6xQ89PDJ71tuVrcqyBqIfbqVP X-Received: by 2002:a17:902:e743:b0:1cc:7ebe:4db6 with SMTP id p3-20020a170902e74300b001cc7ebe4db6mr6831095plf.39.1699548079162; Thu, 09 Nov 2023 08:41:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699548079; cv=none; d=google.com; s=arc-20160816; b=w0JZASCMnoxP5FcY2+5wP/YeFVrYNsqeSwkm5dHgxArY1f8uEYspxpboiKPxQnUP8Z byEBSeljQ7qDYjZG4uy9eVvogDOavNyjDJSdUpLs2kWEEOqRNGeFnYInUgY/ByxGQRwg 5GMiYiSwbA4p5sP3nSY0xB/5shPeoAojE0aepr6L6FCAntULQdvjuXSXIkvboEYImqz1 WaE7eSABLfnLD/2R5NCggeqpNpaV2wiWdbqChNrIjqj51Wl4+WMsmLe85XUAgk1eLO7r cKcL8/JF4Vh3AESTbRPBH+XYszamW4Rxmr6bDc2vYB4kYdbCDiG66t64sKtSHGzGAf/e gZIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FxWNRocA/oM9dzOHz3LP2ogoDpOA6ygaxmLdvYJ1SpY=; fh=ugTJ0V04Gw2esaaTpPIQMJ4HlDfR2dqEpKamFkS2bJw=; b=eX1p+OxqXAlCUQwKV0cpZq6Its0pJKgbemNhgUQ0++MT+e2JbJFKxSNJ856JrGRDM6 j5wZG3VPctE2nuZVzVcR01QfqDH2NQQgfOQG8vGoQFSScabEvXH5jqqfbHD55ssgaZU+ RG9t0fZkJ8/coNznAcOkTmRnFfmHTPh2SYTfiQbsG9kYP6Z+uWl6KRWMKu2vOHVAwBTR 9D4QwEHEbq1wy9p1NenTxjeW9lYLGXhMYI5UoSvJ4QDYrjPDbFSDruqMJFNGvc5110B5 ux10pkWHMa+kby9P5valL6yfe6Jc1OnXDQZvgFIGvRUxDVjMkY0KvnKVjdP2Q/N07anp UpKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jhPFyxwN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ik14-20020a170902ab0e00b001c8920e3021si5029394plb.539.2023.11.09.08.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:41:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jhPFyxwN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 89D7780984B6; Thu, 9 Nov 2023 08:40:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344669AbjKIQjW (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 11:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234678AbjKIQii (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 11:38:38 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297293A87; Thu, 9 Nov 2023 08:38:14 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0CB6666076B7; Thu, 9 Nov 2023 16:38:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547893; bh=BbzxyrDVfMPZZmyN110w8Pfww9FXyNV/OBFjuHEvLQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jhPFyxwN8fMgIiJNlbpby/PoAyWLPS2Ol44wtSXwpt9m6RLgve2oPqSBRqMbdIFWp SRjklkUYdVeFLUq89ug3kmpUGFiBBvkcSwy2OJS6DAkg5blIqVAcCiOW/053bhJRkf BnNiJhyqza9FxnLK5ltKV/vKENmA/RRjBo0yA7gaUBpDgQE5H4yHh34Vt354QTSYIy QFY50HzH66loqVM1nEPRdT4X4WED8CeNBSg7b5yYhHZVuLO+yBBkzqWuH2hUoZ4Xx4 Mrd5eHB5kQlnsG5kVj/ouJEhRNC1TIcIs6ZU8YVrbBNJnY5y/WOlddwdKGTuSW9A3H uc/F36qbXFYPA== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Andrzej Pietrasiewicz <andrzej.p@collabora.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Subject: [PATCH v15 33/56] touchscreen: sur40: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:49 +0100 Message-Id: <20231109163512.179524-34-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109163512.179524-14-benjamin.gaignard@collabora.com> References: <20231109163512.179524-14-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:40:22 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105326869721307 X-GMAIL-MSGID: 1782105326869721307 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Nov. 9, 2023, 4:34 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/input/touchscreen/sur40.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index 8ddb3f7d307a..e7d2a52169a0 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -847,9 +847,10 @@ static int sur40_queue_setup(struct vb2_queue *q, unsigned int sizes[], struct device *alloc_devs[]) { struct sur40_state *sur40 = vb2_get_drv_priv(q); + unsigned int q_num_bufs = vb2_get_num_buffers(q); - if (q->num_buffers + *nbuffers < 3) - *nbuffers = 3 - q->num_buffers; + if (q_num_bufs + *nbuffers < 3) + *nbuffers = 3 - q_num_bufs; if (*nplanes) return sizes[0] < sur40->pix_fmt.sizeimage ? -EINVAL : 0;