[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23f6b3fb-4c9d-485f-bb84-3f97a70c8a71@xs4all.nl>
Date: Tue, 19 Sep 2023 15:52:14 +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 v7 25/49] media: pci: netup_unidvb: Stop direct calls to
queue num_buffers field
On 14/09/2023 15:32, Benjamin Gaignard wrote:
> Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
> ---
> drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> index d85bfbb77a25..557985ba25db 100644
> --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> @@ -293,12 +293,13 @@ static int netup_unidvb_queue_setup(struct vb2_queue *vq,
> struct device *alloc_devs[])
> {
> struct netup_dma *dma = vb2_get_drv_priv(vq);
> + unsigned int q_num_bufs = vb2_get_num_buffers(vq);
>
> dev_dbg(&dma->ndev->pci_dev->dev, "%s()\n", __func__);
>
> *nplanes = 1;
> - if (vq->num_buffers + *nbuffers < VIDEO_MAX_FRAME)
> - *nbuffers = VIDEO_MAX_FRAME - vq->num_buffers;
> + if (q_num_bufs + *nbuffers < VIDEO_MAX_FRAME)
> + *nbuffers = VIDEO_MAX_FRAME - q_num_bufs;
Just drop this, the vb2 core tests this already.
Regards,
Hans
> sizes[0] = PAGE_ALIGN(NETUP_DMA_PACKETS_COUNT * 188);
> dev_dbg(&dma->ndev->pci_dev->dev, "%s() nbuffers=%d sizes[0]=%d\n",
> __func__, *nbuffers, sizes[0]);
Powered by blists - more mailing lists