linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Joseph Liu <kwliu@nuvoton.com>, Marvin Lin <kflin@nuvoton.com>
Subject: [PATCH v15 36/56] media: nuvoton: Stop direct calls to queue num_buffers field
Date: Thu,  9 Nov 2023 17:34:52 +0100	[thread overview]
Message-ID: <20231109163512.179524-37-benjamin.gaignard@collabora.com> (raw)
In-Reply-To: <20231109163512.179524-14-benjamin.gaignard@collabora.com>

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>
CC: Joseph Liu <kwliu@nuvoton.com>
CC: Marvin Lin <kflin@nuvoton.com>
---
 drivers/media/platform/nuvoton/npcm-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c
index b9e6782f59b4..f9b4e36a5175 100644
--- a/drivers/media/platform/nuvoton/npcm-video.c
+++ b/drivers/media/platform/nuvoton/npcm-video.c
@@ -393,7 +393,7 @@ static void npcm_video_free_diff_table(struct npcm_video *video)
 	struct rect_list *tmp;
 	unsigned int i;
 
-	for (i = 0; i < video->queue.num_buffers; i++) {
+	for (i = 0; i < vb2_get_num_buffers(&video->queue); i++) {
 		head = &video->list[i];
 		list_for_each_safe(pos, nx, head) {
 			tmp = list_entry(pos, struct rect_list, list);
-- 
2.39.2


  parent reply	other threads:[~2023-11-09 16:39 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 16:34 [PATCH v15 13/56] media: mediatek: vcodec: Stop direct calls to queue num_buffers field Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 14/56] media: sti: hva: Remove useless check Benjamin Gaignard
2023-11-10  9:24   ` Andrzej Pietrasiewicz
2023-11-09 16:34 ` [PATCH v15 15/56] media: visl: Use vb2_get_buffer() instead of directly access to buffers array Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 16/56] media: atomisp: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 17/56] media: atomisp: Stop direct calls to queue num_buffers field Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 18/56] media: dvb-core: Use vb2_get_buffer() instead of directly access to buffers array Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 19/56] media: dvb-core: Do not initialize twice queue num_buffer field Benjamin Gaignard
2023-11-10  9:25   ` Andrzej Pietrasiewicz
2023-11-09 16:34 ` [PATCH v15 20/56] media: dvb-frontends: rtl2832: Stop direct calls to queue num_buffers field Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 21/56] media: pci: dt3155: Remove useless check Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 22/56] media: pci: tw686x: Stop direct calls to queue num_buffers field Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 23/56] media: pci: cx18: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 24/56] media: pci: netup_unidvb: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 25/56] media: pci: tw68: " Benjamin Gaignard
2023-11-10  9:26   ` Andrzej Pietrasiewicz
2023-11-09 16:34 ` [PATCH v15 26/56] media: i2c: video-i2c: " Benjamin Gaignard
2023-11-10  9:27   ` Andrzej Pietrasiewicz
2023-11-09 16:34 ` [PATCH v15 27/56] media: coda: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 28/56] media: nxp: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 29/56] media: verisilicon: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 30/56] media: test-drivers: " Benjamin Gaignard
2023-11-10  9:35   ` Andrzej Pietrasiewicz
2023-11-10  9:55     ` Benjamin Gaignard
2023-11-10 11:03       ` Andrzej Pietrasiewicz
2023-11-09 16:34 ` [PATCH v15 31/56] media: imx: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 32/56] media: meson: vdec: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 33/56] touchscreen: sur40: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 34/56] sample: v4l: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 35/56] media: cedrus: " Benjamin Gaignard
2023-11-09 16:34 ` Benjamin Gaignard [this message]
2023-11-09 16:34 ` [PATCH v15 37/56] media: renesas: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 38/56] media: ti: " Benjamin Gaignard
2023-11-09 20:21   ` Lad, Prabhakar
2023-11-09 16:34 ` [PATCH v15 39/56] media: usb: airspy: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 40/56] media: usb: cx231xx: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 41/56] media: usb: hackrf: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 42/56] media: usb: usbtv: " Benjamin Gaignard
2023-11-09 16:34 ` [PATCH v15 43/56] media videobuf2: Be more flexible on the number of queue stored buffers Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 44/56] media: core: Report the maximum possible number of buffers for the queue Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 45/56] media: test-drivers: vivid: Increase max supported buffers for capture queues Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 46/56] media: test-drivers: vicodec: Increase max supported capture queue buffers Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 47/56] media: verisilicon: Refactor postprocessor to store more buffers Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 48/56] media: verisilicon: Store chroma and motion vectors offset Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 49/56] media: verisilicon: g2: Use common helpers to compute chroma and mv offsets Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 50/56] media: verisilicon: vp9: Allow to change resolution while streaming Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 51/56] media: core: Rework how create_buf index returned value is computed Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 52/56] media: core: Add bitmap manage bufs array entries Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 53/56] media: core: Free range of buffers Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 54/56] media: v4l2: Add DELETE_BUFS ioctl Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 55/56] media: v4l2: Add mem2mem helpers for " Benjamin Gaignard
2023-11-09 16:35 ` [PATCH v15 56/56] media: test-drivers: Use helper " Benjamin Gaignard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231109163512.179524-37-benjamin.gaignard@collabora.com \
    --to=benjamin.gaignard@collabora.com \
    --cc=andrzej.p@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=kflin@nuvoton.com \
    --cc=kwliu@nuvoton.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=ming.qian@nxp.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).