linux (RPi): drop obsolete patches from popcornmix

Synced with https://github.com/popcornmix/linux/tree/kodi/rpi4-kms
Only the workaround to hide 4k modes is now left.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2020-08-17 12:41:03 +02:00
parent 018247264e
commit f358298383
2 changed files with 35 additions and 123 deletions

View File

@ -0,0 +1,35 @@
From 11c0cfc8ed33cda1435fc9a9efd8476514054842 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 16 Mar 2020 20:38:37 +0000
Subject: [PATCH] vc4_hdmi: Reduce max pixel rate to hide 4k modes
vc4_hdmi: Increase pixel clock to 162MHz for 1920x1200@60
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++--
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 219964ff2f0e7..31d7565d2d904 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2322,7 +2322,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
.id = 0,
.audio_available = true,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
@@ -2350,7 +2350,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
.id = 1,
.audio_available = true,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
--
2.20.1

View File

@ -1,123 +0,0 @@
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
vc4_hdmi: Increase pixel clock to 162MHz for 1920x1200@60
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++--
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 bce82f011d9fb..15946f8538898 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -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,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
@@ -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,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
--
2.20.1
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 | 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 15946f8538898..87836349d0982 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -785,6 +785,10 @@ static u32 vc4_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)
+ return 0xb13f88;
+
for (i = 0; i < 8; i++) {
if (channel_mask & BIT(i))
channel_map |= i << (3 * i);
@@ -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 (!(vc4_hdmi->audio.iec_status[0] & IEC958_AES0_NONAUDIO) &&
+ vc4_hdmi->audio.channels == 8)
+ return 0x54237610;
+
for (i = 0; i < 8; i++) {
if (channel_mask & BIT(i))
channel_map |= i << (4 * i);
--
2.20.1
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
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 87836349d0982..bd2ec74d6dc62 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -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)
{
+ static const u8 cea_map[] = {
+ 0xff, // 0
+ 0xff, // 1
+ 0x00, // 2.0
+ 0x01, // 2.1
+ 0x03, // 3.1
+ 0x09, // 4.1
+ 0x0b, // 5.1
+ 0x12, // 7.0
+ 0x13, // 7.1
+ };
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
union hdmi_infoframe frame;
int ret;
@@ -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;
+ if (frame.audio.channels < 2 || frame.audio.channels > 8)
+ DRM_ERROR("Unable to map channels: %d\n", frame.audio.channels);
+ else
+ frame.audio.channel_allocation = cea_map[frame.audio.channels];
vc4_hdmi_write_infoframe(encoder, &frame);
}
--
2.20.1