linux (RPi): update patches from popcornmix

sourced from https://github.com/popcornmix/linux/tree/kodi/rpi4-kms

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2020-07-09 23:45:30 +02:00
parent 458bf14b94
commit a994dd5ae7

View File

@ -1,4 +1,4 @@
From c7852992ed9c4973e83d961fcf92b6be316e6b60 Mon Sep 17 00:00:00 2001
From 1ae562e48904ef7584d7c12ea0e29e089928b79e Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 16 Mar 2020 20:38:37 +0000
Subject: [PATCH 1/3] vc4_hdmi: Reduce max pixel rate to hide 4k modes
@ -9,10 +9,10 @@ vc4_hdmi: Increase pixel clock to 162MHz for 1920x1200@60
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 2d608cf9dff9..152c9d8c2898 100644
index bce82f011d9fb..15946f8538898 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1791,7 +1791,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
@@ -1907,7 +1907,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
.id = 0,
.audio_available = true,
@ -21,7 +21,7 @@ index 2d608cf9dff9..152c9d8c2898 100644
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
@@ -1819,7 +1819,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
@@ -1935,7 +1935,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
.id = 1,
.audio_available = true,
@ -34,20 +34,21 @@ index 2d608cf9dff9..152c9d8c2898 100644
2.20.1
From cc54619b00f89058791d3211843d043caad0cf0c Mon Sep 17 00:00:00 2001
From 589ce075d9117e4d5e6bbf09f90f29cce2b6d233 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 10 Mar 2020 22:19:51 +0000
Subject: [PATCH 2/3] vc4_hdmi: Set channel mapping as expected by kodi
vc4_hdmi: Don't mangle channels for passthrough
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++
1 file changed, 8 insertions(+)
drivers/gpu/drm/vc4/vc4_hdmi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 152c9d8c2898..057595ec853d 100644
index 15946f8538898..87836349d0982 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -775,6 +775,10 @@ static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
@@ -785,6 +785,10 @@ static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
int i;
u32 channel_map = 0;
@ -58,12 +59,14 @@ index 152c9d8c2898..057595ec853d 100644
for (i = 0; i < 8; i++) {
if (channel_mask & BIT(i))
channel_map |= i << (3 * i);
@@ -787,6 +791,10 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
@@ -797,6 +801,12 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
int i;
u32 channel_map = 0;
+ /* hack: return the mapping expected by kodi until we have a way of configuring this */
+ if (channel_mask == 0xff)
+
+ if (!(vc4_hdmi->audio.iec_status[0] & IEC958_AES0_NONAUDIO) &&
+ vc4_hdmi->audio.channels == 8)
+ return 0x54237610;
+
for (i = 0; i < 8; i++) {
@ -73,7 +76,7 @@ index 152c9d8c2898..057595ec853d 100644
2.20.1
From c8d2ab620ecb95cd12708876000a76fc003990bb Mon Sep 17 00:00:00 2001
From f9c550eb6f339edd2b62bf285d617f752cd7f251 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 10 Mar 2020 23:07:11 +0000
Subject: [PATCH 3/3] vc4_hdmi: Set channel_allocation to something plausible
@ -83,10 +86,10 @@ Subject: [PATCH 3/3] vc4_hdmi: Set channel_allocation to something plausible
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 057595ec853d..2a733ab5343c 100644
index 87836349d0982..bd2ec74d6dc62 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -329,6 +329,17 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
@@ -339,6 +339,17 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
{
@ -104,7 +107,7 @@ index 057595ec853d..2a733ab5343c 100644
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
union hdmi_infoframe frame;
int ret;
@@ -339,6 +350,10 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
@@ -349,6 +360,10 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
frame.audio.channels = vc4_hdmi->audio.channels;