[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230927153558.159278-35-benjamin.gaignard@collabora.com>
Date: Wed, 27 Sep 2023 17:35:39 +0200
From: Benjamin Gaignard <benjamin.gaignard@...labora.com>
To: mchehab@...nel.org, tfiga@...omium.org, m.szyprowski@...sung.com,
ming.qian@....com, ezequiel@...guardiasur.com.ar,
p.zabel@...gutronix.de, gregkh@...uxfoundation.org,
hverkuil-cisco@...all.nl, nicolas.dufresne@...labora.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-staging@...ts.linux.dev,
kernel@...labora.com,
Benjamin Gaignard <benjamin.gaignard@...labora.com>
Subject: [PATCH v8 34/53] media: renesas: Set min_buffers_needed to 16
vb2 queue_setup checks for a minimum number of buffers so set
min_buffers_needed to 16 and remove the useless check in
rcar_drif_queue_setup().
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
---
drivers/media/platform/renesas/rcar_drif.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c
index 163a4ba61c17..8a9a70565d3f 100644
--- a/drivers/media/platform/renesas/rcar_drif.c
+++ b/drivers/media/platform/renesas/rcar_drif.c
@@ -425,13 +425,9 @@ static int rcar_drif_queue_setup(struct vb2_queue *vq,
{
struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq);
- /* Need at least 16 buffers */
- if (vq->num_buffers + *num_buffers < 16)
- *num_buffers = 16 - vq->num_buffers;
-
*num_planes = 1;
sizes[0] = PAGE_ALIGN(sdr->fmt->buffersize);
- rdrif_dbg(sdr, "num_bufs %d sizes[0] %d\n", *num_buffers, sizes[0]);
+ rdrif_dbg(sdr, "num_bufs %u sizes[0] %d\n", vb2_get_num_buffers(vq), sizes[0]);
return 0;
}
@@ -1311,6 +1307,8 @@ static int rcar_drif_sdr_probe(struct rcar_drif_sdr *sdr)
/* Init videobuf2 queue structure */
sdr->vb_queue.type = V4L2_BUF_TYPE_SDR_CAPTURE;
sdr->vb_queue.io_modes = VB2_READ | VB2_MMAP | VB2_DMABUF;
+ /* Need at least 16 buffers */
+ sdr->vb_queue.min_buffers_needed = 16;
sdr->vb_queue.drv_priv = sdr;
sdr->vb_queue.buf_struct_size = sizeof(struct rcar_drif_frame_buf);
sdr->vb_queue.ops = &rcar_drif_vb2_ops;
--
2.39.2
Powered by blists - more mailing lists