[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7224be00-99cb-4134-b45f-98b92c1fb4da@collabora.com>
Date: Fri, 10 Nov 2023 10:26:40 +0100
From: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
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,
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,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>
Subject: Re: [PATCH v15 25/56] media: pci: tw68: Stop direct calls to queue
num_buffers field
W dniu 9.11.2023 o 17:34, Benjamin Gaignard pisze:
> 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@...labora.com>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
> CC: Fabrizio Castro <fabrizio.castro.jz@...esas.com>
> ---
> drivers/media/pci/tw68/tw68-video.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c
> index 773a18702d36..79b627ebc92a 100644
> --- a/drivers/media/pci/tw68/tw68-video.c
> +++ b/drivers/media/pci/tw68/tw68-video.c
> @@ -360,13 +360,14 @@ static int tw68_queue_setup(struct vb2_queue *q,
> unsigned int sizes[], struct device *alloc_devs[])
> {
> struct tw68_dev *dev = vb2_get_drv_priv(q);
> - unsigned tot_bufs = q->num_buffers + *num_buffers;
> + unsigned int q_num_bufs = vb2_get_num_buffers(q);
> + unsigned int tot_bufs = q_num_bufs + *num_buffers;
> unsigned size = (dev->fmt->depth * dev->width * dev->height) >> 3;
>
> if (tot_bufs < 2)
> tot_bufs = 2;
> tot_bufs = tw68_buffer_count(size, tot_bufs);
> - *num_buffers = tot_bufs - q->num_buffers;
> + *num_buffers = tot_bufs - q_num_bufs;
> /*
> * We allow create_bufs, but only if the sizeimage is >= as the
> * current sizeimage. The tw68_buffer_count calculation becomes quite
Powered by blists - more mailing lists