1 From 764c8052ce21a56a55dc25dbc6ee0c075952cdeb Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 13 Aug 2020 17:04:53 +0100
4 Subject: [PATCH] staging: vc04_services: codec: Fix component
7 start_streaming enabled the VPU component if ctx->component_enabled
9 stop_streaming disabled the VPU component if both ports were
10 disabled. It didn't clear ctx->component_enabled.
12 If seeking, this meant that the component never got re-enabled,
13 and buffers never got processed afterwards.
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
17 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 +++-
18 1 file changed, 3 insertions(+), 1 deletion(-)
20 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
21 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
22 @@ -2377,13 +2377,15 @@ static void bcm2835_codec_stop_streaming
25 /* If both ports disabled, then disable the component */
26 - if (!ctx->component->input[0].enabled &&
27 + if (ctx->component_enabled &&
28 + !ctx->component->input[0].enabled &&
29 !ctx->component->output[0].enabled) {
30 ret = vchiq_mmal_component_disable(dev->instance,
33 v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling component, ret %d\n",
35 + ctx->component_enabled = false;
38 if (V4L2_TYPE_IS_OUTPUT(q->type))