[PATCH] media: amphion: Drop min_queued_buffers assignment

ming.qian@oss.nxp.com posted 1 patch 1 month, 2 weeks ago
drivers/media/platform/amphion/vpu_v4l2.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] media: amphion: Drop min_queued_buffers assignment
Posted by ming.qian@oss.nxp.com 1 month, 2 weeks ago
From: Ming Qian <ming.qian@oss.nxp.com>

The min_queued_buffers field controls when start_streaming() is called
by the vb2 core (it delays the callback until at least N buffers are
queued). Setting it to 1 affects the timing of start_streaming(), which
breaks the seek flow in decoder scenarios and causes test failures.

The current driver implementation does not rely on this minimum buffer
requirement and handles streaming start correctly with the default
value of 0, so remove these assignments.

Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
---
 drivers/media/platform/amphion/vpu_v4l2.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index 47dff9a35bb4..1fb887b9098c 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -670,7 +670,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
 		src_vq->mem_ops = &vb2_vmalloc_memops;
 	src_vq->drv_priv = inst;
 	src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
-	src_vq->min_queued_buffers = 1;
 	src_vq->dev = inst->vpu->dev;
 	src_vq->lock = &inst->lock;
 	ret = vb2_queue_init(src_vq);
@@ -687,7 +686,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
 		dst_vq->mem_ops = &vb2_vmalloc_memops;
 	dst_vq->drv_priv = inst;
 	dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
-	dst_vq->min_queued_buffers = 1;
 	dst_vq->dev = inst->vpu->dev;
 	dst_vq->lock = &inst->lock;
 	ret = vb2_queue_init(dst_vq);
-- 
2.52.0
Re: [PATCH] media: amphion: Drop min_queued_buffers assignment
Posted by Frank Li 1 month ago
On Tue, Dec 23, 2025 at 02:27:52PM +0800, ming.qian@oss.nxp.com wrote:
> From: Ming Qian <ming.qian@oss.nxp.com>
>
> The min_queued_buffers field controls when start_streaming() is called
> by the vb2 core (it delays the callback until at least N buffers are
> queued). Setting it to 1 affects the timing of start_streaming(), which
> breaks the seek flow in decoder scenarios and causes test failures.
>
> The current driver implementation does not rely on this minimum buffer
> requirement and handles streaming start correctly with the default
> value of 0, so remove these assignments.
>
> Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
> Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/media/platform/amphion/vpu_v4l2.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
> index 47dff9a35bb4..1fb887b9098c 100644
> --- a/drivers/media/platform/amphion/vpu_v4l2.c
> +++ b/drivers/media/platform/amphion/vpu_v4l2.c
> @@ -670,7 +670,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
>  		src_vq->mem_ops = &vb2_vmalloc_memops;
>  	src_vq->drv_priv = inst;
>  	src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
> -	src_vq->min_queued_buffers = 1;
>  	src_vq->dev = inst->vpu->dev;
>  	src_vq->lock = &inst->lock;
>  	ret = vb2_queue_init(src_vq);
> @@ -687,7 +686,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
>  		dst_vq->mem_ops = &vb2_vmalloc_memops;
>  	dst_vq->drv_priv = inst;
>  	dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
> -	dst_vq->min_queued_buffers = 1;
>  	dst_vq->dev = inst->vpu->dev;
>  	dst_vq->lock = &inst->lock;
>  	ret = vb2_queue_init(dst_vq);
> --
> 2.52.0
>
Re: [PATCH] media: amphion: Drop min_queued_buffers assignment
Posted by Nicolas Dufresne 1 month ago
Le mardi 23 décembre 2025 à 14:27 +0800, ming.qian@oss.nxp.com a écrit :
> From: Ming Qian <ming.qian@oss.nxp.com>
> 
> The min_queued_buffers field controls when start_streaming() is called
> by the vb2 core (it delays the callback until at least N buffers are
> queued). Setting it to 1 affects the timing of start_streaming(), which
> breaks the seek flow in decoder scenarios and causes test failures.
> 
> The current driver implementation does not rely on this minimum buffer
> requirement and handles streaming start correctly with the default
> value of 0, so remove these assignments.
> 
> Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
> Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: stable@vger.kernel.org

> ---
>  drivers/media/platform/amphion/vpu_v4l2.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/platform/amphion/vpu_v4l2.c
> b/drivers/media/platform/amphion/vpu_v4l2.c
> index 47dff9a35bb4..1fb887b9098c 100644
> --- a/drivers/media/platform/amphion/vpu_v4l2.c
> +++ b/drivers/media/platform/amphion/vpu_v4l2.c
> @@ -670,7 +670,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue
> *src_vq, struct vb2_q
>  		src_vq->mem_ops = &vb2_vmalloc_memops;
>  	src_vq->drv_priv = inst;
>  	src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
> -	src_vq->min_queued_buffers = 1;
>  	src_vq->dev = inst->vpu->dev;
>  	src_vq->lock = &inst->lock;
>  	ret = vb2_queue_init(src_vq);
> @@ -687,7 +686,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue
> *src_vq, struct vb2_q
>  		dst_vq->mem_ops = &vb2_vmalloc_memops;
>  	dst_vq->drv_priv = inst;
>  	dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
> -	dst_vq->min_queued_buffers = 1;
>  	dst_vq->dev = inst->vpu->dev;
>  	dst_vq->lock = &inst->lock;
>  	ret = vb2_queue_init(dst_vq);