Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++----
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
-diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
-index e3cd3432867a..3085eed2afe2 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -592,13 +592,13 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
+@@ -565,13 +565,13 @@ static void vc5_hdmi_set_timings(struct
VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay,
VC5_HDMI_VERTA_VFP) |
VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL));
VC4_HDMI_VERTB_VBP));
HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021);
---
-2.35.1
-
+++ /dev/null
-From 0570b898a56093a94f406728092be37c33bbee6e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 15 Dec 2020 16:42:39 +0100
-Subject: drm/vc4: hdmi: Create a custom connector state
-
-From: Maxime Ripard <maxime@cerno.tech>
-
-[ Upstream commit fbe7271e47bebd7600fec171bce9d5bf066275f8 ]
-
-When run with a higher bpc than 8, the clock of the HDMI controller needs
-to be adjusted. Let's create a connector state that will be used at
-atomic_check and atomic_enable to compute and store the clock rate
-associated to the state.
-
-Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
-Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-6-maxime@cerno.tech
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpu/drm/vc4/vc4_hdmi.c | 33 ++++++++++++++++++++++++++++++---
- drivers/gpu/drm/vc4/vc4_hdmi.h | 10 ++++++++++
- 2 files changed, 40 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
-index 978afe706ee2..2d76f094c2d2 100644
---- a/drivers/gpu/drm/vc4/vc4_hdmi.c
-+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -208,10 +208,37 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
-
- static void vc4_hdmi_connector_reset(struct drm_connector *connector)
- {
-- drm_atomic_helper_connector_reset(connector);
-+ struct vc4_hdmi_connector_state *old_state =
-+ conn_state_to_vc4_hdmi_conn_state(connector->state);
-+ struct vc4_hdmi_connector_state *new_state =
-+ kzalloc(sizeof(*new_state), GFP_KERNEL);
-
- if (connector->state)
-- drm_atomic_helper_connector_tv_reset(connector);
-+ __drm_atomic_helper_connector_destroy_state(connector->state);
-+
-+ kfree(old_state);
-+ __drm_atomic_helper_connector_reset(connector, &new_state->base);
-+
-+ if (!new_state)
-+ return;
-+
-+ drm_atomic_helper_connector_tv_reset(connector);
-+}
-+
-+static struct drm_connector_state *
-+vc4_hdmi_connector_duplicate_state(struct drm_connector *connector)
-+{
-+ struct drm_connector_state *conn_state = connector->state;
-+ struct vc4_hdmi_connector_state *vc4_state = conn_state_to_vc4_hdmi_conn_state(conn_state);
-+ struct vc4_hdmi_connector_state *new_state;
-+
-+ new_state = kzalloc(sizeof(*new_state), GFP_KERNEL);
-+ if (!new_state)
-+ return NULL;
-+
-+ __drm_atomic_helper_connector_duplicate_state(connector, &new_state->base);
-+
-+ return &new_state->base;
- }
-
- static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
-@@ -219,7 +246,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
- .fill_modes = drm_helper_probe_single_connector_modes,
- .destroy = vc4_hdmi_connector_destroy,
- .reset = vc4_hdmi_connector_reset,
-- .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
-+ .atomic_duplicate_state = vc4_hdmi_connector_duplicate_state,
- .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
- };
-
-diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
-index 0526a9cf608a..2cf5362052e2 100644
---- a/drivers/gpu/drm/vc4/vc4_hdmi.h
-+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
-@@ -180,6 +180,16 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder)
- return container_of(_encoder, struct vc4_hdmi, encoder);
- }
-
-+struct vc4_hdmi_connector_state {
-+ struct drm_connector_state base;
-+};
-+
-+static inline struct vc4_hdmi_connector_state *
-+conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state)
-+{
-+ return container_of(conn_state, struct vc4_hdmi_connector_state, base);
-+}
-+
- void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi,
- struct drm_display_mode *mode);
- void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi);
---
-2.35.1
-
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/gpu/drm/vc4/vc4_crtc.c | 7 ++++---
- drivers/gpu/drm/vc4/vc4_hdmi.c | 12 ++++++------
+ drivers/gpu/drm/vc4/vc4_crtc.c | 7 ++++---
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 12 ++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
-diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
-index f4e64db07d4e..79724fddfb4b 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
-@@ -346,7 +346,8 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc)
+@@ -346,7 +346,8 @@ static void vc4_crtc_config_pv(struct dr
PV_HORZB_HACTIVE));
CRTC_WRITE(PV_VERTA,
PV_VERTA_VBP) |
VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start,
PV_VERTA_VSYNC));
-@@ -358,7 +359,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc)
+@@ -358,7 +359,7 @@ static void vc4_crtc_config_pv(struct dr
if (interlace) {
CRTC_WRITE(PV_VERTA_EVEN,
VC4_SET_FIELD(mode->crtc_vtotal -
PV_VERTA_VBP) |
VC4_SET_FIELD(mode->crtc_vsync_end -
mode->crtc_vsync_start,
-@@ -378,7 +379,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc)
+@@ -378,7 +379,7 @@ static void vc4_crtc_config_pv(struct dr
PV_VCONTROL_CONTINUOUS |
(is_dsi ? PV_VCONTROL_DSI : 0) |
PV_VCONTROL_INTERLACE |
PV_VCONTROL_ODD_DELAY));
CRTC_WRITE(PV_VSYNCD_EVEN, 0);
} else {
-diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
-index 153bf0907bbd..e3cd3432867a 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -549,12 +549,12 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
+@@ -522,12 +522,12 @@ static void vc4_hdmi_set_timings(struct
VC4_HDMI_VERTA_VFP) |
VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL));
u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) |
VC4_HDMI_VERTB_VBP));
HDMI_WRITE(HDMI_HORZA,
-@@ -593,12 +593,12 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
+@@ -566,12 +566,12 @@ static void vc5_hdmi_set_timings(struct
VC5_HDMI_VERTA_VFP) |
VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL));
u32 vertb = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) |
VC4_HDMI_VERTB_VBP));
HDMI_WRITE(HDMI_VEC_INTERFACE_XBAR, 0x354021);
---
-2.35.1
-
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-9-maxime@cerno.tech
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++--
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
-index 2d76f094c2d2..153bf0907bbd 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -83,6 +83,8 @@
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
-@@ -1966,7 +1968,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
+@@ -1939,7 +1941,7 @@ static const struct vc4_hdmi_variant bcm
.encoder_type = VC4_ENCODER_TYPE_HDMI0,
.debugfs_name = "hdmi0_regs",
.card_name = "vc4-hdmi-0",
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
.phy_lane_mapping = {
-@@ -1992,7 +1994,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
+@@ -1965,7 +1967,7 @@ static const struct vc4_hdmi_variant bcm
.encoder_type = VC4_ENCODER_TYPE_HDMI1,
.debugfs_name = "hdmi1_regs",
.card_name = "vc4-hdmi-1",
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
.phy_lane_mapping = {
---
-2.35.1
-
drm-vc4-hdmi-remove-firmware-logic-for-mai-threshold.patch
drm-vc4-hdmi-avoid-full-hdmi-audio-fifo-writes.patch
drm-vc4-hdmi-don-t-access-the-connector-state-in-res.patch
-drm-vc4-hdmi-create-a-custom-connector-state.patch
drm-vc4-hdmi-limit-the-bcm2711-to-the-max-without-sc.patch
drm-vc4-hdmi-fix-timings-for-interlaced-modes.patch
drm-vc4-hdmi-correct-hdmi-timing-registers-for-inter.patch