Message ID | 20231109163512.179524-35-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 q9csp568086vqs; Thu, 9 Nov 2023 08:56:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEwo7dt1effKv7sFOkF2AQzTNCcBLNy9JNEaqaSDJ5ubKEG/QbbA9tLnCFtkQNO7CywwPl X-Received: by 2002:a17:902:da90:b0:1ca:a07b:36d with SMTP id j16-20020a170902da9000b001caa07b036dmr6384804plx.48.1699548974654; Thu, 09 Nov 2023 08:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699548974; cv=none; d=google.com; s=arc-20160816; b=V77UB8ML5xkcxyPtTMt0iqEdtlU8A72risf7PRCd9aCFNNatxQpMWbOPq9ifHErA2V iZ4kHbpRnifVsoPNs8uiKEzd8m8413ohBMn/wBKxmJzThZa/tNuKut5mdl9Nco12Fgio MilqBfDWDVTP5JX9tgwknm9JPJ+kz+OIVfhIZzbxeoP+NzHZHezuk8kSevSUVsZ5BPwD io1UdEI9MiC6CkB0foUx0MY7V2j/ga5RW426R8Mu8hRxfrPbrkutlC4B4fj59jMHEweO rbHlP1AYO7CcAaQP+NNLMZizcTwxcK5VYF1ZhUQ8KpQfds7xzCXHccektv/cGXimvIVk RTrQ== 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=zE7fFYDhk2KuJYo8YaOtNLGkkcBx3sSUAaNwWCk2z+A=; fh=t4h1l+tS8anPNnwyX0PglXAWKg/D9M9NAbc0AP3vdGI=; b=P3SU1t952h9c9bvQACh2whue9vE7ZenP9pYLWJ0Hp1/z//gDrnfXRyBqhQW1U+YHaj PyM4hW8KTl3V1FrD8BleKTZXE5czS7juahPfaK+ALOAwbdfLoB7Sy3NMEWzEI2AE0C3R I9WPMHPmfPOB/7pR49te5txtaZL8m7zYSFZ0ABMVwSIMhCE5BOuDHQ6P6Zp2iT/FbFJp Nm4mIAe9Cl+WuMzc6NE2M/5q3ejsLSgi5B03gsbwUeCilJ+2TsrcOVTcd5tpWI8OEw8B KrxVuduyQtbByICW0RCElTPkL6yXHsBO5pHDIJmwCMnnyBmnOZfvUF6haBL6hBbNffH2 QwDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Dll9Owb3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z10-20020a170903018a00b001c60636e426si5687192plg.432.2023.11.09.08.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Dll9Owb3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 73DD082328A1; Thu, 9 Nov 2023 08:56:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbjKIQzx (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 11:55:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234731AbjKIQin (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 11:38:43 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD50F3C3A; Thu, 9 Nov 2023 08:38:15 -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 C3D5966076BA; Thu, 9 Nov 2023 16:38:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547894; bh=VwZU4+ckcXzSAwnWbSC53r966DVTmWsb2+Sz1f2VGIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dll9Owb3ybwYnDK8Q7X0yrqAA1cXb582B4OcCJoiE+pSC1HOjwsi9CO2kTjWfnHom uT0rJ4Z/kXSD43XhiJ4hHQHjJ+gykyx7tC17X/qiCT8/M3Knfaqt1T7sPijJaonJzN x9r7QJMgYi5I8wf40bQJEwEvp+Q+Ei5wkOETxRa2JEi99zC3uIN7D9XiDHkvT3sUbZ NcxyM3l1WAvmwodoCbgjZ7YslUwgJZgyI19uy+fyP2Cfx87GKoqJ+ZJLlWMs18F2Y4 dO7nSMKy+hEc2aJxgswqPq+rPQdKI2ge+RHZ9dsHvmVsrDxYdj4OgsbQf3iLwNdUPN lMxe+DWioTspg== 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> Subject: [PATCH v15 34/56] sample: v4l: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:50 +0100 Message-Id: <20231109163512.179524-35-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 (agentk.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:56:09 -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 agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782106265809602989 X-GMAIL-MSGID: 1782106265809602989 |
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> --- samples/v4l/v4l2-pci-skeleton.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c index a61f94db18d9..a65aa9d1e9da 100644 --- a/samples/v4l/v4l2-pci-skeleton.c +++ b/samples/v4l/v4l2-pci-skeleton.c @@ -155,6 +155,7 @@ static int queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { struct skeleton *skel = vb2_get_drv_priv(vq); + unsigned int q_num_bufs = vb2_get_num_buffers(vq); skel->field = skel->format.field; if (skel->field == V4L2_FIELD_ALTERNATE) { @@ -167,8 +168,8 @@ static int queue_setup(struct vb2_queue *vq, skel->field = V4L2_FIELD_TOP; } - if (vq->num_buffers + *nbuffers < 3) - *nbuffers = 3 - vq->num_buffers; + if (q_num_bufs + *nbuffers < 3) + *nbuffers = 3 - q_num_bufs; if (*nplanes) return sizes[0] < skel->format.sizeimage ? -EINVAL : 0;