[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ca82921-b71a-4d87-a1f1-6a6158f07c8c@xs4all.nl>
Date: Mon, 16 Oct 2023 12:32:03 +0200
From: Hans Verkuil <hverkuil-cisco@...all.nl>
To: Benjamin Gaignard <benjamin.gaignard@...labora.com>,
mchehab@...nel.org, tfiga@...omium.org, m.szyprowski@...sung.com,
ming.qian@....com, ezequiel@...guardiasur.com.ar,
p.zabel@...gutronix.de, gregkh@...uxfoundation.org,
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
Subject: Re: [PATCH v11 45/56] media: test-drivers: vivid: Increase max
supported buffers for capture queues
On 12/10/2023 13:46, Benjamin Gaignard wrote:
> Change the maximum number of buffers of some capture queues in order
> to test max_num_buffers field.
>
> Allow to allocate up to:
> - 64 buffers for video capture queue.
> - 1024 buffers for sdr capture queue.
> - 32768 buffers for vbi capture queue.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
> ---
> drivers/media/test-drivers/vivid/vivid-core.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c
> index 394c9f81ea72..b5656330578d 100644
> --- a/drivers/media/test-drivers/vivid/vivid-core.c
> +++ b/drivers/media/test-drivers/vivid/vivid-core.c
> @@ -876,6 +876,13 @@ static int vivid_create_queue(struct vivid_dev *dev,
> q->type = buf_type;
> q->io_modes = VB2_MMAP | VB2_DMABUF;
> q->io_modes |= V4L2_TYPE_IS_OUTPUT(buf_type) ? VB2_WRITE : VB2_READ;
> + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> + q->max_num_buffers = 64;
> + if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE)
> + q->max_num_buffers = 1024;
> + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE)
> + q->max_num_buffers = 32768;
This should use the same calculation as MAX_BUFFER_INDEX.
I wonder if those defines should move to videobuf2-core.h instead.
Regards,
Hans
> +
> if (allocators[dev->inst] != 1)
> q->io_modes |= VB2_USERPTR;
> q->drv_priv = dev;
Powered by blists - more mailing lists