]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2024 14:43:00 +0000 (16:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2024 14:43:00 +0000 (16:43 +0200)
added patches:
drm-sun4i-hdmi-convert-encoder-to-atomic.patch
drm-sun4i-hdmi-move-mode_set-into-enable.patch

queue-6.6/drm-sun4i-hdmi-convert-encoder-to-atomic.patch [new file with mode: 0644]
queue-6.6/drm-sun4i-hdmi-move-mode_set-into-enable.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/drm-sun4i-hdmi-convert-encoder-to-atomic.patch b/queue-6.6/drm-sun4i-hdmi-convert-encoder-to-atomic.patch
new file mode 100644 (file)
index 0000000..b0d9814
--- /dev/null
@@ -0,0 +1,69 @@
+From cedb7dd193f659fcc63f3a3f31454c25a5baef07 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <mripard@kernel.org>
+Date: Thu, 22 Feb 2024 19:14:18 +0100
+Subject: drm/sun4i: hdmi: Convert encoder to atomic
+
+From: Maxime Ripard <mripard@kernel.org>
+
+commit cedb7dd193f659fcc63f3a3f31454c25a5baef07 upstream.
+
+The sun4i_hdmi driver still uses the non-atomic variants of the encoder
+hooks, so let's convert to their atomic equivalents.
+
+Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev>
+Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
+Signed-off-by: Maxime Ripard <mripard@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-32-8f4af575fce2@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c |   17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
++++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+@@ -82,7 +82,8 @@ static int sun4i_hdmi_atomic_check(struc
+       return 0;
+ }
+-static void sun4i_hdmi_disable(struct drm_encoder *encoder)
++static void sun4i_hdmi_disable(struct drm_encoder *encoder,
++                             struct drm_atomic_state *state)
+ {
+       struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+       u32 val;
+@@ -96,7 +97,8 @@ static void sun4i_hdmi_disable(struct dr
+       clk_disable_unprepare(hdmi->tmds_clk);
+ }
+-static void sun4i_hdmi_enable(struct drm_encoder *encoder)
++static void sun4i_hdmi_enable(struct drm_encoder *encoder,
++                            struct drm_atomic_state *state)
+ {
+       struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
+       struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+@@ -120,9 +122,10 @@ static void sun4i_hdmi_enable(struct drm
+ }
+ static void sun4i_hdmi_mode_set(struct drm_encoder *encoder,
+-                              struct drm_display_mode *mode,
+-                              struct drm_display_mode *adjusted_mode)
++                              struct drm_crtc_state *crtc_state,
++                              struct drm_connector_state *conn_state)
+ {
++      const struct drm_display_mode *mode = &crtc_state->mode;
+       struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+       unsigned int x, y;
+       u32 val;
+@@ -201,9 +204,9 @@ static enum drm_mode_status sun4i_hdmi_m
+ static const struct drm_encoder_helper_funcs sun4i_hdmi_helper_funcs = {
+       .atomic_check   = sun4i_hdmi_atomic_check,
+-      .disable        = sun4i_hdmi_disable,
+-      .enable         = sun4i_hdmi_enable,
+-      .mode_set       = sun4i_hdmi_mode_set,
++      .atomic_disable = sun4i_hdmi_disable,
++      .atomic_enable  = sun4i_hdmi_enable,
++      .atomic_mode_set        = sun4i_hdmi_mode_set,
+       .mode_valid     = sun4i_hdmi_mode_valid,
+ };
diff --git a/queue-6.6/drm-sun4i-hdmi-move-mode_set-into-enable.patch b/queue-6.6/drm-sun4i-hdmi-move-mode_set-into-enable.patch
new file mode 100644 (file)
index 0000000..d1e3880
--- /dev/null
@@ -0,0 +1,86 @@
+From 9ca6bc2460359ed49b0ee87467fea784b1a42bf5 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <mripard@kernel.org>
+Date: Thu, 22 Feb 2024 19:14:19 +0100
+Subject: drm/sun4i: hdmi: Move mode_set into enable
+
+From: Maxime Ripard <mripard@kernel.org>
+
+commit 9ca6bc2460359ed49b0ee87467fea784b1a42bf5 upstream.
+
+We're not doing anything special in atomic_mode_set so we can simply
+merge it into atomic_enable.
+
+Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev>
+Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
+Signed-off-by: Maxime Ripard <mripard@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-33-8f4af575fce2@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c |   38 ++++++++++++---------------------
+ 1 file changed, 14 insertions(+), 24 deletions(-)
+
+--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
++++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+@@ -103,33 +103,11 @@ static void sun4i_hdmi_enable(struct drm
+       struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
+       struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+       struct drm_display_info *display = &hdmi->connector.display_info;
++      unsigned int x, y;
+       u32 val = 0;
+       DRM_DEBUG_DRIVER("Enabling the HDMI Output\n");
+-      clk_prepare_enable(hdmi->tmds_clk);
+-
+-      sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
+-      val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
+-      val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);
+-      writel(val, hdmi->base + SUN4I_HDMI_PKT_CTRL_REG(0));
+-
+-      val = SUN4I_HDMI_VID_CTRL_ENABLE;
+-      if (display->is_hdmi)
+-              val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE;
+-
+-      writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
+-}
+-
+-static void sun4i_hdmi_mode_set(struct drm_encoder *encoder,
+-                              struct drm_crtc_state *crtc_state,
+-                              struct drm_connector_state *conn_state)
+-{
+-      const struct drm_display_mode *mode = &crtc_state->mode;
+-      struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder);
+-      unsigned int x, y;
+-      u32 val;
+-
+       clk_set_rate(hdmi->mod_clk, mode->crtc_clock * 1000);
+       clk_set_rate(hdmi->tmds_clk, mode->crtc_clock * 1000);
+@@ -181,6 +159,19 @@ static void sun4i_hdmi_mode_set(struct d
+               val |= SUN4I_HDMI_VID_TIMING_POL_VSYNC;
+       writel(val, hdmi->base + SUN4I_HDMI_VID_TIMING_POL_REG);
++
++      clk_prepare_enable(hdmi->tmds_clk);
++
++      sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
++      val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
++      val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);
++      writel(val, hdmi->base + SUN4I_HDMI_PKT_CTRL_REG(0));
++
++      val = SUN4I_HDMI_VID_CTRL_ENABLE;
++      if (display->is_hdmi)
++              val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE;
++
++      writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
+ }
+ static enum drm_mode_status sun4i_hdmi_mode_valid(struct drm_encoder *encoder,
+@@ -206,7 +197,6 @@ static const struct drm_encoder_helper_f
+       .atomic_check   = sun4i_hdmi_atomic_check,
+       .atomic_disable = sun4i_hdmi_disable,
+       .atomic_enable  = sun4i_hdmi_enable,
+-      .atomic_mode_set        = sun4i_hdmi_mode_set,
+       .mode_valid     = sun4i_hdmi_mode_valid,
+ };
index f73ed43e9413191dee5ec947e7ba6546f609cc7d..203383ce0f8b0a46016a3770bace4a3a2dd2fa94 100644 (file)
@@ -12,3 +12,5 @@ vxlan-fix-regression-when-dropping-packets-due-to-invalid-src-addresses.patch
 selftests-net-synchronize-udpgro-tests-tx-and-rx-connection.patch
 selftests-net-included-needed-helper-in-the-install-targets.patch
 selftests-net-list-helper-scripts-in-test_files-makefile-variable.patch
+drm-sun4i-hdmi-convert-encoder-to-atomic.patch
+drm-sun4i-hdmi-move-mode_set-into-enable.patch