Message ID | 20231019125222.21370-34-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp360254vqb; Thu, 19 Oct 2023 05:56:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTbIy0D5eY42Sb2aqAKFK04OiYMBQrwaFiqPnBhW8ExZye0fJXG0VWnwMiJBohybSh4R+5 X-Received: by 2002:a17:902:e54e:b0:1c9:fdbf:296a with SMTP id n14-20020a170902e54e00b001c9fdbf296amr2691500plf.8.1697720159822; Thu, 19 Oct 2023 05:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720159; cv=none; d=google.com; s=arc-20160816; b=lwEpgXkQdRELrPgft82gEIsjnaqpzPAuKEdLE5W2VODVBsiAwcc7i/ShCeKpNRl4Oc +QbPOeNTQ0C+dIkgz/ikH0Wfc0ZZ93PEEdHBdJULIOiNwrpHSx7bIlddQNkceLQGShkL xcu2C2pSnqU6hFHKkeQ+wrG/Fw0gu0Sf1TBFEW36dbPRQXRkdcpGwc2gbOpI4fJ05goG /edun2mH7w6uQuP3floSvIUMGLt+6pnMUCWyAjNuK8prGL90FKG333k4bPpl5pLLz+UQ JemJzawiLdxmBt9zw5kNUQS97uvfKHYBw2j0lDJDe/5SKqrUqbR7NNtnwcfEOCbb/df5 xV9w== 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=A8ph2qj3xtdztdYD/RMDg4TbsW9JnsQI8cJywFJ5HKQ=; fh=QEr6LkXZ0b5ECaCCGx2MOhsbOAaVsr2qEDjA2CECWis=; b=kEPsfrFKyiUA9A8Qn8fp8tRzjyAck1rtlMKUq6By4DW+hBSfBPrvvTCEyd3m1Pfxql dhMP7oiI3I4UWXjGLfoxERmpB5VVA9470PVyktbHxEnYmzr4PJkBgdELfN72ZQHr8vHj 5ABNB+7PqqXlDUTfXCPEVtuQndina2glZIZM94Ea2qX8X+TT7Ov1MKIA2ZbbX6vdMM0z fZVk+S6kz7vdxebdO/wXkVa3OA1OUvg8ILE/3vfRv5Qv2+kHUQLhVPn+gXZyD4qW32Xz /GJ3eHK0ldWSo91DBYeZVRd/Y9bAecQvSfmFVbXWXsVR7U/uCHPEPRt8JuQYzu/9/ckC dKuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VONUCUoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n1-20020a170902d2c100b001c5f37aeebdsi2188639plc.579.2023.10.19.05.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VONUCUoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 265E0828E840; Thu, 19 Oct 2023 05:55:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346204AbjJSMzU (ORCPT <rfc822;lkml4gm@gmail.com> + 25 others); Thu, 19 Oct 2023 08:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345837AbjJSMxP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 19 Oct 2023 08:53:15 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F441BE; Thu, 19 Oct 2023 05:52:49 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:ccea:1fb5:34eb:239b]) (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 CE7096607375; Thu, 19 Oct 2023 13:52:47 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719968; bh=k33G17zQJxCQXpWsnxb/MtZzvTjkhGFNRYE0Jo4tkpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VONUCUoqT/ATgu3IKaEjzelgQyb6F/NtglliTKAUxRA5tnN8IolF9z5ApEeRtdkq6 PTruK/vZXpFv9SYQcG4cNzScYL3+hjV4dXcidMUasl6Z93Wy5JQ5Q70Wl4H74HzFVj 2cBjRq8u99KiTniZSVjiv1BK7Md1L7FdJyeChzRx3bXPGKTi+gpWRJYk1W0RzUTPEd yYfECioEMGMoUjdqiIBnvlnYVd0YwT1pUoRUaOuvUa6BJ5CtwLjVXGPlqmKN32QMqb n8RJNTjsgUsSh4hrzbPdvsfkcm1Xi5kHfanJ4O0ixmulPqLhGkII6+Y5kucXUarwkr 5zKztEZyzFb7A== 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>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Henrik Rydberg <rydberg@bitmath.org> Subject: [PATCH v13 33/56] touchscreen: sur40: Stop direct calls to queue num_buffers field Date: Thu, 19 Oct 2023 14:51:59 +0200 Message-Id: <20231019125222.21370-34-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231019125222.21370-1-benjamin.gaignard@collabora.com> References: <20231019125222.21370-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:55:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188614348025862 X-GMAIL-MSGID: 1780188614348025862 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 19, 2023, 12:51 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>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Henrik Rydberg <rydberg@bitmath.org>
---
drivers/input/touchscreen/sur40.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On Thu, Oct 19, 2023 at 02:51:59PM +0200, Benjamin Gaignard wrote: > 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> > CC: Dmitry Torokhov <dmitry.torokhov@gmail.com> > CC: Henrik Rydberg <rydberg@bitmath.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Feel free to merge with the rest of the series. Thanks.
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;