Backport patch to fix ODROID-N2 HDMI (#2128)

This commit is contained in:
Stefan Agner 2022-09-12 22:16:29 +02:00 committed by GitHub
parent 0404657e74
commit c1a767695d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 180 additions and 41 deletions

View File

@ -1,8 +1,8 @@
From 9f8390a715bc58e7423b65a18c4499761c84b819 Mon Sep 17 00:00:00 2001
Message-Id: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From ff269d57d23c2edee262e14c6cf4116bc16d8019 Mon Sep 17 00:00:00 2001
Message-Id: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 11:20:48 +0100
Subject: [PATCH 1/7] arm64: dts: meson: g12b: add power button support
Subject: [PATCH] arm64: dts: meson: g12b: add power button support
Add power button support on J2 pin 11 (GPIOX_3 on the SoC side). The
GPIO is low active, e.g. when connecting with pin 9 (GND) a power
@ -36,5 +36,5 @@ index d33e54b5e196..5f0f036b1265 100644
compatible = "gpio-leds";
--
2.35.1
2.37.3

View File

@ -1,10 +1,10 @@
From 26917e25696e7156a85d4dfcc578cb4cf4f42dde Mon Sep 17 00:00:00 2001
Message-Id: <26917e25696e7156a85d4dfcc578cb4cf4f42dde.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From b4024d399bb13d46cd1a5d3be3793669b3d80e97 Mon Sep 17 00:00:00 2001
Message-Id: <b4024d399bb13d46cd1a5d3be3793669b3d80e97.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 11:38:54 +0100
Subject: [PATCH 2/7] arm64: dts: meson: g12b: add GPIO fan support
Subject: [PATCH] arm64: dts: meson: g12b: add GPIO fan support
Add simple GPIO fan node to support a fan on GPIO J8. Unfortunately the
pad used to control the fan does not support real PWM, hence the RPM
@ -38,5 +38,5 @@ index 5f0f036b1265..36dbd2666015 100644
compatible = "gpio-keys-polled";
poll-interval = <100>;
--
2.35.1
2.37.3

View File

@ -1,11 +1,10 @@
From 5b2b8c960269eba18f0557bf49990b9c28e5e6af Mon Sep 17 00:00:00 2001
Message-Id: <5b2b8c960269eba18f0557bf49990b9c28e5e6af.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From 9f82b2c1cdbdd172e7e7bfdccc88be3257fd4c91 Mon Sep 17 00:00:00 2001
Message-Id: <9f82b2c1cdbdd172e7e7bfdccc88be3257fd4c91.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 15:53:55 +0100
Subject: [PATCH 3/7] arm64: dts: meson: g12b: odroid-n2: add fan as cooling
device
Subject: [PATCH] arm64: dts: meson: g12b: odroid-n2: add fan as cooling device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -70,5 +69,5 @@ index 36dbd2666015..5ca75696bd5c 100644
cpu-supply = <&vddcpu_b>;
operating-points-v2 = <&cpu_opp_table_0>;
--
2.35.1
2.37.3

View File

@ -1,10 +1,10 @@
From fee88e0053de7878977913311bdb153494aa6c61 Mon Sep 17 00:00:00 2001
Message-Id: <fee88e0053de7878977913311bdb153494aa6c61.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From 025e89230336ccea12ff89195231dd0c03cd3eec Mon Sep 17 00:00:00 2001
Message-Id: <025e89230336ccea12ff89195231dd0c03cd3eec.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Fri, 27 Mar 2020 17:05:22 +0900
Subject: [PATCH 4/7] arm64: dts: meson: add uart_A node
Subject: [PATCH] arm64: dts: meson: add uart_A node
The UART_A is available through J3 pin 8/10 and documented to be
available as UART by default.
@ -40,5 +40,5 @@ index 5ca75696bd5c..738eb0339333 100644
status = "okay";
pinctrl-0 = <&uart_ao_a_pins>;
--
2.35.1
2.37.3

View File

@ -1,10 +1,10 @@
From 51ded393003a60d3932081114bff142c4c69b293 Mon Sep 17 00:00:00 2001
Message-Id: <51ded393003a60d3932081114bff142c4c69b293.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From 96909bf9c466f99cdb5fdd45e82379198063c06d Mon Sep 17 00:00:00 2001
Message-Id: <96909bf9c466f99cdb5fdd45e82379198063c06d.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Thu, 29 Apr 2021 21:32:43 +0200
Subject: [PATCH 5/7] arm64: dts: meson: add i2c2 node to ODROID N2/N2+
Subject: [PATCH] arm64: dts: meson: add i2c2 node to ODROID N2/N2+
The J2 connectors pinout documents "I2C.SDA0/SCL0" on pin 3 and 5, which
are connected to GPIOX_17/18. This GPIO allow to mux I2C to the second
@ -33,5 +33,5 @@ index 738eb0339333..2e9fefc20b19 100644
status = "okay";
pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
--
2.35.1
2.37.3

View File

@ -1,10 +1,10 @@
From 0ad900b2d6e895b1f1788d51e471863743727d71 Mon Sep 17 00:00:00 2001
Message-Id: <0ad900b2d6e895b1f1788d51e471863743727d71.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From 23fae187ce1f409811c4f3b293d78e53cc750def Mon Sep 17 00:00:00 2001
Message-Id: <23fae187ce1f409811c4f3b293d78e53cc750def.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Tue, 1 Mar 2022 21:51:50 +0100
Subject: [PATCH 6/7] ODROID-C4: arm64/dts: add uart_A node
Subject: [PATCH] ODROID-C4: arm64/dts: add uart_A node
---
arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 9 ++++++++-
@ -39,5 +39,5 @@ index 76ad052fbf0c..690e4823a9d0 100644
status = "okay";
pinctrl-0 = <&uart_ao_a_pins>;
--
2.35.1
2.37.3

View File

@ -1,10 +1,10 @@
From 105003d49a505e0f0e033a6f3d945f745912c7b1 Mon Sep 17 00:00:00 2001
Message-Id: <105003d49a505e0f0e033a6f3d945f745912c7b1.1646168061.git.stefan@agner.ch>
In-Reply-To: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
References: <9f8390a715bc58e7423b65a18c4499761c84b819.1646168061.git.stefan@agner.ch>
From ba8dc083b2bdd7fb24efccada671ef5650143a91 Mon Sep 17 00:00:00 2001
Message-Id: <ba8dc083b2bdd7fb24efccada671ef5650143a91.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Tue, 1 Mar 2022 21:53:32 +0100
Subject: [PATCH 7/7] ODROID-C4: arm64/dts: add i2c2, i2c3 node
Subject: [PATCH] ODROID-C4: arm64/dts: add i2c2, i2c3 node
---
.../boot/dts/amlogic/meson-sm1-odroid.dtsi | 53 +++++++++++++++++++
@ -82,5 +82,5 @@ index 690e4823a9d0..85637c1c846b 100644
pinctrl-0 = <&pwm_ao_d_e_pins>;
pinctrl-names = "default";
--
2.35.1
2.37.3

View File

@ -0,0 +1,140 @@
From 77ec76aa649244b94381334ccf5ce641ef2f8717 Mon Sep 17 00:00:00 2001
Message-Id: <77ec76aa649244b94381334ccf5ce641ef2f8717.1663008544.git.stefan@agner.ch>
In-Reply-To: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
References: <ff269d57d23c2edee262e14c6cf4116bc16d8019.1663008544.git.stefan@agner.ch>
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Wed, 20 Oct 2021 14:39:42 +0200
Subject: [PATCH] drm/bridge: display-connector: implement bus fmts callbacks
Since this bridge is tied to the connector, it acts like a passthrough,
so concerning the output & input bus formats, either pass the bus formats from the
previous bridge or return fallback data like done in the bridge function:
drm_atomic_bridge_chain_select_bus_fmts() & select_bus_fmt_recursive.
This permits avoiding skipping the negociation if the remaining bridge chain has
all the bits in place.
Without this bus fmt negociation breaks on drm/meson HDMI pipeline when attaching
dw-hdmi with DRM_BRIDGE_ATTACH_NO_CONNECTOR, because the last bridge of the
display-connector doesn't implement buf fmt callbacks and MEDIA_BUS_FMT_FIXED
is used leading to select an unsupported default bus format from dw-hdmi.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-2-narmstrong@baylibre.com
(cherry picked from commit 7cd70656d1285b79c001f041a017fcfee4292ff9)
---
drivers/gpu/drm/bridge/display-connector.c | 86 ++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
index 847a0dce7f1d..d24f5b90feab 100644
--- a/drivers/gpu/drm/bridge/display-connector.c
+++ b/drivers/gpu/drm/bridge/display-connector.c
@@ -13,6 +13,7 @@
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
+#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_edid.h>
@@ -87,10 +88,95 @@ static struct edid *display_connector_get_edid(struct drm_bridge *bridge,
return drm_get_edid(connector, conn->bridge.ddc);
}
+/*
+ * Since this bridge is tied to the connector, it acts like a passthrough,
+ * so concerning the output bus formats, either pass the bus formats from the
+ * previous bridge or return fallback data like done in the bridge function:
+ * drm_atomic_bridge_chain_select_bus_fmts().
+ * This supports negotiation if the bridge chain has all bits in place.
+ */
+static u32 *display_connector_get_output_bus_fmts(struct drm_bridge *bridge,
+ struct drm_bridge_state *bridge_state,
+ struct drm_crtc_state *crtc_state,
+ struct drm_connector_state *conn_state,
+ unsigned int *num_output_fmts)
+{
+ struct drm_bridge *prev_bridge = drm_bridge_get_prev_bridge(bridge);
+ struct drm_bridge_state *prev_bridge_state;
+
+ if (!prev_bridge || !prev_bridge->funcs->atomic_get_output_bus_fmts) {
+ struct drm_connector *conn = conn_state->connector;
+ u32 *out_bus_fmts;
+
+ *num_output_fmts = 1;
+ out_bus_fmts = kmalloc(sizeof(*out_bus_fmts), GFP_KERNEL);
+ if (!out_bus_fmts)
+ return NULL;
+
+ if (conn->display_info.num_bus_formats &&
+ conn->display_info.bus_formats)
+ out_bus_fmts[0] = conn->display_info.bus_formats[0];
+ else
+ out_bus_fmts[0] = MEDIA_BUS_FMT_FIXED;
+
+ return out_bus_fmts;
+ }
+
+ prev_bridge_state = drm_atomic_get_new_bridge_state(crtc_state->state,
+ prev_bridge);
+
+ return prev_bridge->funcs->atomic_get_output_bus_fmts(prev_bridge, prev_bridge_state,
+ crtc_state, conn_state,
+ num_output_fmts);
+}
+
+/*
+ * Since this bridge is tied to the connector, it acts like a passthrough,
+ * so concerning the input bus formats, either pass the bus formats from the
+ * previous bridge or MEDIA_BUS_FMT_FIXED (like select_bus_fmt_recursive())
+ * when atomic_get_input_bus_fmts is not supported.
+ * This supports negotiation if the bridge chain has all bits in place.
+ */
+static u32 *display_connector_get_input_bus_fmts(struct drm_bridge *bridge,
+ struct drm_bridge_state *bridge_state,
+ struct drm_crtc_state *crtc_state,
+ struct drm_connector_state *conn_state,
+ u32 output_fmt,
+ unsigned int *num_input_fmts)
+{
+ struct drm_bridge *prev_bridge = drm_bridge_get_prev_bridge(bridge);
+ struct drm_bridge_state *prev_bridge_state;
+
+ if (!prev_bridge || !prev_bridge->funcs->atomic_get_input_bus_fmts) {
+ u32 *in_bus_fmts;
+
+ *num_input_fmts = 1;
+ in_bus_fmts = kmalloc(sizeof(*in_bus_fmts), GFP_KERNEL);
+ if (!in_bus_fmts)
+ return NULL;
+
+ in_bus_fmts[0] = MEDIA_BUS_FMT_FIXED;
+
+ return in_bus_fmts;
+ }
+
+ prev_bridge_state = drm_atomic_get_new_bridge_state(crtc_state->state,
+ prev_bridge);
+
+ return prev_bridge->funcs->atomic_get_input_bus_fmts(prev_bridge, prev_bridge_state,
+ crtc_state, conn_state, output_fmt,
+ num_input_fmts);
+}
+
static const struct drm_bridge_funcs display_connector_bridge_funcs = {
.attach = display_connector_attach,
.detect = display_connector_detect,
.get_edid = display_connector_get_edid,
+ .atomic_get_output_bus_fmts = display_connector_get_output_bus_fmts,
+ .atomic_get_input_bus_fmts = display_connector_get_input_bus_fmts,
+ .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+ .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+ .atomic_reset = drm_atomic_helper_bridge_reset,
};
static irqreturn_t display_connector_hpd_irq(int irq, void *arg)
--
2.37.3