Message ID | 20230927153558.159278-44-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3098028vqu; Wed, 27 Sep 2023 23:01:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/k78KgEHULr0c06D9HmBdX/Wlqeh5m6F6Ucg6Iq55RMVWmD+/89sj33PIz6a1IL9C/1nP X-Received: by 2002:a05:6a00:b84:b0:68f:ece2:ac2a with SMTP id g4-20020a056a000b8400b0068fece2ac2amr246131pfj.27.1695880883891; Wed, 27 Sep 2023 23:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695880883; cv=none; d=google.com; s=arc-20160816; b=ADgRAOa+9adDaxdroNF06yHc3F2P07n4+itvwfxsnrA0r8OlrlhjL847fIodKMPC3x 0MEQutDgrGoLftINn0EGxCdnWScUVvmj2noceSNC3RCO7NKPXen0xn2MFku9SHQEPmrv cS5e001INNkwlhD65P6/BsOKmnMNAr5K+6CDcavaD9F5dAMwmthBunU+UzY3Xh2pWhEx aq+lESGqDKlKFXdzzP6j7GJCHvEghhVtZF+iBJTGl7vGEiBVgcB7p30zJPADqtmPxeYU BVAUSFyHsBnO6nnp2fLANC8ZZNXTnwG/ns3bRQCfZaUzdh69XjkTXF6UHu/ZqTQ85wji vwRQ== 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=R5I14gZ8ZV2beKG5h7D5LMBNMyFJY4vcK66dciAEppY=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=FZSh1Xwe8Ly5LWEZjpimhDJH06myjUrUsgJf1Bmw9Hsk57J1Qlhz0VN0ateyhsJptp y149XDPUSgOloXmxHfwXAkmlchCNdMBNHf/BokGefqCQQCzVRf0y1WqtFm8FwI7S9NAk svwyLr3vMs1jXc6ntpaYQ1Ea/q4IuVlRTpyHRW9W/ZSpWrqTXAuYwVwB+DVHzr7OL0gk vJgzmr87D/pfnuMm45S902Qf3aG2cGsa5d8QUuU6ZC89FTH8KzZq1f5snHHVWBa58EG8 fbJlDSENuQi4YGEyZfGKUPQdbFzKswmpfig/lNrXVLog5BHuLPlFVFll9iQVGrVzSIGB 1WnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AxoRyHg7; 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 cq10-20020a056a00330a00b0069023afd0d1si17496856pfb.329.2023.09.27.23.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 23:01:23 -0700 (PDT) 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=AxoRyHg7; 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 4ABBD81DDE4C; Wed, 27 Sep 2023 08:39:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233055AbjI0Pi3 (ORCPT <rfc822;ruipengqi7@gmail.com> + 19 others); Wed, 27 Sep 2023 11:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232730AbjI0Pge (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 27 Sep 2023 11:36:34 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F001B5; Wed, 27 Sep 2023 08:36:30 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:672:46bd:3ec7:6cdf]) (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 9B7836607365; Wed, 27 Sep 2023 16:36:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695828989; bh=1yOSfZ9zOJdZRwLwPAMdW6zHS4PIxiSGQkrNrnzD9t8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AxoRyHg7zl6pwsQG8EoqN2S4tMkhsiBo+mVnSupd5QJzFVdHfpTZ0UkxWgm3c47GN kovAuAsJro6pO7stcq3YduQq5QAFfpqSNHN+1K7z3ryMVdCGN2e488vIQ9E/ldK/zs i/0B4xwgH9OStcfFwP6y6JJNTzUIgCaD0Che3i0LC3jpZN51e0bNuhzfHYyEdgr7hl HZ6cZNdYhwSdtUV0nhBXtULaWZoeaZkCVxrFQliCrNWMVKsQiO/b+QRybtNtw3UPV3 aawXGPWe9dW7LYE1b/yp8D0RNquY5rNhe3iiGUVnrx06KSDu94cQFOdYyksrjcD65k 87gnv+QfXqZRA== 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> Subject: [PATCH v8 43/53] media: imx: Stop direct calls to queue num_buffers field Date: Wed, 27 Sep 2023 17:35:48 +0200 Message-Id: <20230927153558.159278-44-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230927153558.159278-1-benjamin.gaignard@collabora.com> References: <20230927153558.159278-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:39:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778259993955049650 X-GMAIL-MSGID: 1778259993955049650 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Sept. 27, 2023, 3:35 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/staging/media/imx/imx-media-capture.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 4846078315ff..ce02199e7b1b 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -605,6 +605,7 @@ static int capture_queue_setup(struct vb2_queue *vq, { struct capture_priv *priv = vb2_get_drv_priv(vq); struct v4l2_pix_format *pix = &priv->vdev.fmt; + unsigned int q_num_bufs = vb2_get_num_buffers(vq); unsigned int count = *nbuffers; if (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) @@ -613,14 +614,14 @@ static int capture_queue_setup(struct vb2_queue *vq, if (*nplanes) { if (*nplanes != 1 || sizes[0] < pix->sizeimage) return -EINVAL; - count += vq->num_buffers; + count += q_num_bufs; } count = min_t(__u32, VID_MEM_LIMIT / pix->sizeimage, count); if (*nplanes) - *nbuffers = (count < vq->num_buffers) ? 0 : - count - vq->num_buffers; + *nbuffers = (count < q_num_bufs) ? 0 : + count - q_num_bufs; else *nbuffers = count;