openwrt/target/linux/bcm27xx/patches-5.15/950-0507-staging-bcm2835-co...

49 lines
1.8 KiB
Diff

From 672e3f61cf8bfd8eb578e19a87bc1ce4187cd546 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 16 Sep 2021 16:39:07 +0100
Subject: [PATCH] staging: bcm2835-codec: Signal the firmware to stop
on all changes
The firmware defaults to not stopping video decode if only the
pixel aspect ratio or colourspace change. V4L2 requires us
to stop decoding on any change, therefore tell the firmware
of the desire for this alternate behaviour.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 10 ++++++++++
.../staging/vc04_services/vchiq-mmal/mmal-parameters.h | 3 +++
2 files changed, 13 insertions(+)
--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
@@ -2483,6 +2483,16 @@ static int bcm2835_codec_create_componen
MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
&enable,
sizeof(enable));
+ /*
+ * Enable firmware option to stop on colourspace and pixel
+ * aspect ratio changed
+ */
+ enable = 1;
+ vchiq_mmal_port_parameter_set(dev->instance,
+ &ctx->component->control,
+ MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
+ &enable,
+ sizeof(enable));
} else if (dev->role == DEINTERLACE) {
/* Select the default deinterlace algorithm. */
int half_framerate = 0;
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
@@ -682,6 +682,9 @@ enum mmal_parameter_video_type {
/**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
+
+ /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
+ MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
};
/** Valid mirror modes */