staging: vc04_services: codec: Fix component enable/disable 09/249309/1 accepted/tizen/unified/20201211.124322 submit/tizen/20201211.031336
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 13 Aug 2020 16:04:53 +0000 (17:04 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 10 Dec 2020 04:14:20 +0000 (13:14 +0900)
start_streaming enabled the VPU component if ctx->component_enabled
was not set.
stop_streaming disabled the VPU component if both ports were
disabled. It didn't clear ctx->component_enabled.

If seeking, this meant that the component never got re-enabled,
and buffers never got processed afterwards.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
[sw0312.kim: cherry-pick rpi-5.4.y commit to fix video decoding seek issue]
Ref: https://github.com/raspberrypi/linux/pull/3790
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ibf27e3ed2dc3d98d64a78b10878d6339d77f8a33

drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c

index 427048c..14c47e2 100644 (file)
@@ -2377,13 +2377,15 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q)
 
 
        /* If both ports disabled, then disable the component */
-       if (!ctx->component->input[0].enabled &&
+       if (ctx->component_enabled &&
+           !ctx->component->input[0].enabled &&
            !ctx->component->output[0].enabled) {
                ret = vchiq_mmal_component_disable(dev->instance,
                                                   ctx->component);
                if (ret)
                        v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling component, ret %d\n",
                                 __func__, ret);
+               ctx->component_enabled = false;
        }
 
        if (V4L2_TYPE_IS_OUTPUT(q->type))