staging/bcm2835-codec: Return buffers to QUEUED not ERROR state
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 5 Aug 2021 15:46:42 +0000 (16:46 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Tue, 14 Sep 2021 16:03:59 +0000 (17:03 +0100)
Should start_streaming fail, or buffers be queued during
stop_streaming, they should be returned to the core as QUEUED
and not (as currently) as ERROR.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c

index 96de610e835486b8dfecbf161f4504f6c3ba1f21..d2b64a369ae8f04688182fe5b14e265582edc44a 100644 (file)
@@ -1111,7 +1111,7 @@ static void op_buffer_cb(struct vchiq_mmal_instance *instance,
                v4l2_dbg(2, debug, &ctx->dev->v4l2_dev, "%s: Empty buffer - flags %04x",
                         __func__, mmal_buf->mmal_flags);
                if (!(mmal_buf->mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS)) {
-                       vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_ERROR);
+                       vb2_buffer_done(&vb2->vb2_buf, VB2_BUF_STATE_QUEUED);
                        if (!port->enabled)
                                complete(&ctx->frame_cmplt);
                        return;
@@ -2683,7 +2683,7 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q)
                v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: return buffer %p\n",
                         __func__, vbuf);
 
-               v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
+               v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_QUEUED);
        }
 
        /* Disable MMAL port - this will flush buffers back */