1 From b35ad716845db394d9850d123d3617653f26a921 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Sun, 13 Dec 2020 16:54:43 +0000
4 Subject: [PATCH] staging/vc04_services/codec: Clear last buf dequeued
7 It appears that the V4L2 M2M framework requires the driver to manually
8 call vb2_clear_last_buffer_dequeued on the CAPTURE queue during a
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -1780,6 +1780,7 @@ static int vidioc_decoder_cmd(struct fil
21 struct bcm2835_codec_ctx *ctx = file2ctx(file);
22 struct bcm2835_codec_q_data *q_data = &ctx->q_data[V4L2_M2M_SRC];
23 + struct vb2_queue *dst_vq;
26 v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s, cmd %u", __func__,
27 @@ -1815,7 +1816,9 @@ static int vidioc_decoder_cmd(struct fil
30 case V4L2_DEC_CMD_START:
31 - /* Do we need to do anything here? */
32 + dst_vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
33 + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
34 + vb2_clear_last_buffer_dequeued(dst_vq);