aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-18 18:04:33 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-19 07:17:21 +0100
commit62b7f5931c54e96fca56dd8761b0e466d355c881 (patch)
tree1258b392752379833a075df006c2f6d7ac4be51d /target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch
parent76d1168d0d4b9d76e2ad78c0fc6b255561deb284 (diff)
downloadupstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.gz
upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.bz2
upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.zip
bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G bcm2710: boot tested on RPi 3B v1.2 bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> (cherry-picked from commit f07e572f64)
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch b/target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch
new file mode 100644
index 0000000000..611e5db743
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.4/950-0734-drm-vc4-Fix-VIC-usage-with-Broadcast-RGB.patch
@@ -0,0 +1,58 @@
+From a90dcdf7cf7ad632f5a260758a76e406403a7e3c Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Thu, 14 May 2020 14:44:15 +0100
+Subject: [PATCH] drm/vc4: Fix VIC usage with Broadcast RGB
+
+Adding the Broadcast RGB range selection broke the VIC
+field of the AVI infoframes on HDMI, zeroing them for all
+modes on an HDMI monitor.
+
+Correct this so that it is only zeroed if the range is
+contrary to the standard range of the mode.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ drivers/gpu/drm/vc4/vc4_firmware_kms.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
+@@ -936,19 +936,14 @@ static void vc4_crtc_mode_set_nofb(struc
+ break;
+ }
+
++ mb.timings.video_id_code = frame.avi.video_code;
++
+ if (!vc4_encoder->hdmi_monitor) {
+ mb.timings.flags |= TIMINGS_FLAGS_DVI;
+- mb.timings.video_id_code = frame.avi.video_code;
+ } else {
+ struct vc4_fkms_connector_state *conn_state =
+ to_vc4_fkms_connector_state(vc4_crtc->connector->state);
+
+- /* Do not provide a VIC as the HDMI spec requires that we do not
+- * signal the opposite of the defined range in the AVI
+- * infoframe.
+- */
+- mb.timings.video_id_code = 0;
+-
+ if (conn_state->broadcast_rgb == VC4_BROADCAST_RGB_AUTO) {
+ /* See CEA-861-E - 5.1 Default Encoding Parameters */
+ if (drm_default_rgb_quant_range(mode) ==
+@@ -958,6 +953,16 @@ static void vc4_crtc_mode_set_nofb(struc
+ if (conn_state->broadcast_rgb ==
+ VC4_BROADCAST_RGB_LIMITED)
+ mb.timings.flags |= TIMINGS_FLAGS_RGB_LIMITED;
++
++ /* If not using the default range, then do not provide
++ * a VIC as the HDMI spec requires that we do not
++ * signal the opposite of the defined range in the AVI
++ * infoframe.
++ */
++ if (!!(mb.timings.flags & TIMINGS_FLAGS_RGB_LIMITED) !=
++ (drm_default_rgb_quant_range(mode) ==
++ HDMI_QUANTIZATION_RANGE_LIMITED))
++ mb.timings.video_id_code = 0;
+ }
+ }
+