bcm27xx: switch to 5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0400-staging-bcm2835-codec-Ensure-OUTPUT-timestamps-are-a.patch
1 From 35e371f270fb14320de11b93cbc0f1e1024ff58c Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 4 Nov 2020 18:31:02 +0000
4 Subject: [PATCH] staging/bcm2835-codec: Ensure OUTPUT timestamps are
5 always forwarded
6
7 The firmware by default tries to ensure that decoded frame
8 timestamps always increment. This is counter to the V4L2 API
9 which wants exactly the OUTPUT queue timestamps passed to the
10 CAPTURE queue buffers.
11
12 Disable the firmware option.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 .../bcm2835-codec/bcm2835-v4l2-codec.c | 13 +++++++++++++
17 .../vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++
18 2 files changed, 16 insertions(+)
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 @@ -2001,6 +2001,19 @@ static int bcm2835_codec_create_componen
23 MMAL_PARAMETER_ZERO_COPY, &enable,
24 sizeof(enable));
25
26 + if (dev->role == DECODE) {
27 + /*
28 + * Disable firmware option that ensures decoded timestamps
29 + * always increase.
30 + */
31 + enable = 0;
32 + vchiq_mmal_port_parameter_set(dev->instance,
33 + &ctx->component->output[0],
34 + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
35 + &enable,
36 + sizeof(enable));
37 + }
38 +
39 setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC],
40 &ctx->component->input[0]);
41
42 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
43 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
44 @@ -674,6 +674,9 @@ enum mmal_parameter_video_type {
45
46 /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
47 MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME,
48 +
49 + /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
50 + MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
51 };
52
53 /** Valid mirror modes */