16c1cd79c05999cc6d9734809b5bb6d0c3db36e9
[openwrt/staging/ldir.git] /
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
5 enable/disable
6
7 start_streaming enabled the VPU component if ctx->component_enabled
8 was not set.
9 stop_streaming disabled the VPU component if both ports were
10 disabled. It didn't clear ctx->component_enabled.
11
12 If seeking, this meant that the component never got re-enabled,
13 and buffers never got processed afterwards.
14
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 ---
17 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 4 +++-
18 1 file changed, 3 insertions(+), 1 deletion(-)
19
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
23
24
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,
31 ctx->component);
32 if (ret)
33 v4l2_err(&ctx->dev->v4l2_dev, "%s: Failed enabling component, ret %d\n",
34 __func__, ret);
35 + ctx->component_enabled = false;
36 }
37
38 if (V4L2_TYPE_IS_OUTPUT(q->type))