f33f60335687e0157f3eab50b2de1114032f5eae
[openwrt/staging/linusw.git] /
1 From a07df18f2992baca3fa9d6a16ae93b585786c5d4 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 5 Aug 2021 16:46:42 +0100
4 Subject: [PATCH] staging/bcm2835-codec: Return buffers to QUEUED not
5 ERROR state
6
7 Should start_streaming fail, or buffers be queued during
8 stop_streaming, they should be returned to the core as QUEUED
9 and not (as currently) as ERROR.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
17 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 @@ -1111,7 +1111,7 @@ static void op_buffer_cb(struct vchiq_mm
19 v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: Empty buffer - flags %04x",
20 __func__, mmal_buf->mmal_flags);
21 if (!(mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS)) {
22 - vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_ERROR);
23 + vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_QUEUED);
24 if (!port->enabled)
25 complete(&ctx->frame_cmplt);
26 return;
27 @@ -2683,7 +2683,7 @@ static void bcm2835_codec_stop_streaming
28 v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: return buffer %p\n",
29 __func__, vbuf);
30
31 - v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
32 + v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_QUEUED);
33 }
34
35 /* Disable MMAL port - this will flush buffers back */