From: Greg Kroah-Hartman Date: Wed, 12 Jun 2024 14:43:00 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v4.19.316~112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bddf90126864ccc67f5fc4a724eba1d2532c00b1;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: drm-sun4i-hdmi-convert-encoder-to-atomic.patch drm-sun4i-hdmi-move-mode_set-into-enable.patch --- 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 index 00000000000..b0d98144344 --- /dev/null +++ b/queue-6.6/drm-sun4i-hdmi-convert-encoder-to-atomic.patch @@ -0,0 +1,69 @@ +From cedb7dd193f659fcc63f3a3f31454c25a5baef07 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 22 Feb 2024 19:14:18 +0100 +Subject: drm/sun4i: hdmi: Convert encoder to atomic + +From: Maxime Ripard + +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 +Reviewed-by: Jernej Skrabec +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-32-8f4af575fce2@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..d1e388058cf --- /dev/null +++ b/queue-6.6/drm-sun4i-hdmi-move-mode_set-into-enable.patch @@ -0,0 +1,86 @@ +From 9ca6bc2460359ed49b0ee87467fea784b1a42bf5 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 22 Feb 2024 19:14:19 +0100 +Subject: drm/sun4i: hdmi: Move mode_set into enable + +From: Maxime Ripard + +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 +Reviewed-by: Jernej Skrabec +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-33-8f4af575fce2@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + 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, + }; + diff --git a/queue-6.6/series b/queue-6.6/series index f73ed43e941..203383ce0f8 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -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