[PATCH v2 07/36] media: dvb-core: Remove useless setting of min_buffers_needed

Benjamin Gaignard posted 36 patches 2 years, 2 months ago
Only 34 patches received!
There is a newer version of this series
[PATCH v2 07/36] media: dvb-core: Remove useless setting of min_buffers_needed
Posted by Benjamin Gaignard 2 years, 2 months ago
This driver uses min_buffers_needed which vb2 uses to ensure
start_streaming is called when at least 'min_buffers_needed'
buffers are queued. However, this driver doesn't need this,
it can stream fine without any buffers queued.
Just drop this unnecessary restriction.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
 drivers/media/dvb-core/dvb_vb2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c
index 167ff82a6fed..54a3649d8424 100644
--- a/drivers/media/dvb-core/dvb_vb2.c
+++ b/drivers/media/dvb-core/dvb_vb2.c
@@ -171,7 +171,6 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)
 	q->io_modes = VB2_MMAP;
 	q->drv_priv = ctx;
 	q->buf_struct_size = sizeof(struct dvb_buffer);
-	q->min_buffers_needed = 1;
 	q->ops = &dvb_vb2_qops;
 	q->mem_ops = &vb2_vmalloc_memops;
 	q->buf_ops = &dvb_vb2_buf_ops;
-- 
2.39.2
Re: [PATCH v2 07/36] media: dvb-core: Remove useless setting of min_buffers_needed
Posted by Hans Verkuil 2 years, 2 months ago
On 04/12/2023 14:22, Benjamin Gaignard wrote:
> This driver uses min_buffers_needed which vb2 uses to ensure
> start_streaming is called when at least 'min_buffers_needed'
> buffers are queued. However, this driver doesn't need this,
> it can stream fine without any buffers queued.
> Just drop this unnecessary restriction.

This text needs to be updated: this isn't a driver, this is the
dvb_vb2 core framework.

In any case, the patch itself is correct.

Regards,

	Hans

> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
>  drivers/media/dvb-core/dvb_vb2.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c
> index 167ff82a6fed..54a3649d8424 100644
> --- a/drivers/media/dvb-core/dvb_vb2.c
> +++ b/drivers/media/dvb-core/dvb_vb2.c
> @@ -171,7 +171,6 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)
>  	q->io_modes = VB2_MMAP;
>  	q->drv_priv = ctx;
>  	q->buf_struct_size = sizeof(struct dvb_buffer);
> -	q->min_buffers_needed = 1;
>  	q->ops = &dvb_vb2_qops;
>  	q->mem_ops = &vb2_vmalloc_memops;
>  	q->buf_ops = &dvb_vb2_buf_ops;