1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-16 20:23:53 +02:00
openwrt/target/linux/bcm27xx/patches-5.10/950-0400-staging-bcm2835-codec-Ensure-OUTPUT-timestamps-are-a.patch
Álvaro Fernández Rojas 8299d1f057 bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted
patches, wireless patches and defconfig patches.

bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 4B v1.1 4G
bcm2711: boot tested on RPi 4B v1.1 4G

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2021-08-21 19:07:07 +02:00

54 lines
1.8 KiB
Diff

From 35e371f270fb14320de11b93cbc0f1e1024ff58c Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Wed, 4 Nov 2020 18:31:02 +0000
Subject: [PATCH] staging/bcm2835-codec: Ensure OUTPUT timestamps are
always forwarded
The firmware by default tries to ensure that decoded frame
timestamps always increment. This is counter to the V4L2 API
which wants exactly the OUTPUT queue timestamps passed to the
CAPTURE queue buffers.
Disable the firmware option.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../bcm2835-codec/bcm2835-v4l2-codec.c | 13 +++++++++++++
.../vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++
2 files changed, 16 insertions(+)
--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
@@ -2001,6 +2001,19 @@ static int bcm2835_codec_create_componen
MMAL_PARAMETER_ZERO_COPY, &enable,
sizeof(enable));
+ if (dev->role == DECODE) {
+ /*
+ * Disable firmware option that ensures decoded timestamps
+ * always increase.
+ */
+ enable = 0;
+ vchiq_mmal_port_parameter_set(dev->instance,
+ &ctx->component->output[0],
+ MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
+ &enable,
+ sizeof(enable));
+ }
+
setup_mmal_port_format(ctx, &ctx->q_data[V4L2_M2M_SRC],
&ctx->component->input[0]);
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
@@ -674,6 +674,9 @@ enum mmal_parameter_video_type {
/**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME,
+
+ /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
+ MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
};
/** Valid mirror modes */