diff mbox series

media: v4l2-mem2mem: Fix hold buf flag check

Message ID 20191028185700.3634267-1-jernej.skrabec@siol.net (mailing list archive)
State New, archived
Headers show
Series media: v4l2-mem2mem: Fix hold buf flag check | expand

Commit Message

Jernej Škrabec Oct. 28, 2019, 6:57 p.m. UTC
Hold buf flag is set on output queue, not capture. Fix that.

Fixes: f07602ac3887 ("media: v4l2-mem2mem: add new_frame detection")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/media/v4l2-core/v4l2-mem2mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans Verkuil Nov. 5, 2019, 9:57 a.m. UTC | #1
On 10/28/19 7:57 PM, Jernej Skrabec wrote:
> Hold buf flag is set on output queue, not capture. Fix that.
> 
> Fixes: f07602ac3887 ("media: v4l2-mem2mem: add new_frame detection")
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
>  drivers/media/v4l2-core/v4l2-mem2mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
> index db07ef3bf3d0..0d2d547a84a5 100644
> --- a/drivers/media/v4l2-core/v4l2-mem2mem.c
> +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
> @@ -335,7 +335,7 @@ static void __v4l2_m2m_try_queue(struct v4l2_m2m_dev *m2m_dev,
>  		}
>  	}
>  
> -	if (src && dst && (m2m_ctx->cap_q_ctx.q.subsystem_flags &
> +	if (src && dst && (m2m_ctx->out_q_ctx.q.subsystem_flags &
>  			   VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF))
>  		m2m_ctx->new_frame = !dst->vb2_buf.copied_timestamp ||
>  			dst->vb2_buf.timestamp != src->vb2_buf.timestamp;
> 

You are right, this should be the output queue. But there is a second
use of VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF in this source in a
WARN_ON. Can you fix that as well?

Thanks!

	Hans
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index db07ef3bf3d0..0d2d547a84a5 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -335,7 +335,7 @@  static void __v4l2_m2m_try_queue(struct v4l2_m2m_dev *m2m_dev,
 		}
 	}
 
-	if (src && dst && (m2m_ctx->cap_q_ctx.q.subsystem_flags &
+	if (src && dst && (m2m_ctx->out_q_ctx.q.subsystem_flags &
 			   VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF))
 		m2m_ctx->new_frame = !dst->vb2_buf.copied_timestamp ||
 			dst->vb2_buf.timestamp != src->vb2_buf.timestamp;