From 154c39aec8980e5c4bf28f34f972e234a45449bf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 8 Nov 2022 13:34:36 +0100 Subject: [PATCH] 5.10-stable patches added patches: drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch drm-i915-sdvo-setup-ddc-fully-before-output-init.patch drm-rockchip-dsi-force-synchronous-probe.patch --- ...er-out-invalid-outputs-more-sensibly.patch | 88 ++++++++++++ ...o-setup-ddc-fully-before-output-init.patch | 126 ++++++++++++++++++ ...rockchip-dsi-force-synchronous-probe.patch | 40 ++++++ queue-5.10/series | 3 + 4 files changed, 257 insertions(+) create mode 100644 queue-5.10/drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch create mode 100644 queue-5.10/drm-i915-sdvo-setup-ddc-fully-before-output-init.patch create mode 100644 queue-5.10/drm-rockchip-dsi-force-synchronous-probe.patch diff --git a/queue-5.10/drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch b/queue-5.10/drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch new file mode 100644 index 00000000000..673364f9ac5 --- /dev/null +++ b/queue-5.10/drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch @@ -0,0 +1,88 @@ +From 3e206b6aa6df7eed4297577e0cf8403169b800a2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Wed, 26 Oct 2022 13:11:27 +0300 +Subject: drm/i915/sdvo: Filter out invalid outputs more sensibly +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit 3e206b6aa6df7eed4297577e0cf8403169b800a2 upstream. + +We try to filter out the corresponding xxx1 output +if the xxx0 output is not present. But the way that is +being done is pretty awkward. Make it less so. + +Cc: stable@vger.kernel.org +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-2-ville.syrjala@linux.intel.com +Reviewed-by: Jani Nikula +(cherry picked from commit cc1e66394daaa7e9f005e2487a84e34a39f9308b) +Signed-off-by: Tvrtko Ursulin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/display/intel_sdvo.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +--- a/drivers/gpu/drm/i915/display/intel_sdvo.c ++++ b/drivers/gpu/drm/i915/display/intel_sdvo.c +@@ -2937,16 +2937,33 @@ err: + return false; + } + ++static u16 intel_sdvo_filter_output_flags(u16 flags) ++{ ++ flags &= SDVO_OUTPUT_MASK; ++ ++ /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ ++ if (!(flags & SDVO_OUTPUT_TMDS0)) ++ flags &= ~SDVO_OUTPUT_TMDS1; ++ ++ if (!(flags & SDVO_OUTPUT_RGB0)) ++ flags &= ~SDVO_OUTPUT_RGB1; ++ ++ if (!(flags & SDVO_OUTPUT_LVDS0)) ++ flags &= ~SDVO_OUTPUT_LVDS1; ++ ++ return flags; ++} ++ + static bool + intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) + { +- /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ ++ flags = intel_sdvo_filter_output_flags(flags); + + if (flags & SDVO_OUTPUT_TMDS0) + if (!intel_sdvo_dvi_init(intel_sdvo, 0)) + return false; + +- if ((flags & SDVO_TMDS_MASK) == SDVO_TMDS_MASK) ++ if (flags & SDVO_OUTPUT_TMDS1) + if (!intel_sdvo_dvi_init(intel_sdvo, 1)) + return false; + +@@ -2967,7 +2984,7 @@ intel_sdvo_output_setup(struct intel_sdv + if (!intel_sdvo_analog_init(intel_sdvo, 0)) + return false; + +- if ((flags & SDVO_RGB_MASK) == SDVO_RGB_MASK) ++ if (flags & SDVO_OUTPUT_RGB1) + if (!intel_sdvo_analog_init(intel_sdvo, 1)) + return false; + +@@ -2975,11 +2992,11 @@ intel_sdvo_output_setup(struct intel_sdv + if (!intel_sdvo_lvds_init(intel_sdvo, 0)) + return false; + +- if ((flags & SDVO_LVDS_MASK) == SDVO_LVDS_MASK) ++ if (flags & SDVO_OUTPUT_LVDS1) + if (!intel_sdvo_lvds_init(intel_sdvo, 1)) + return false; + +- if ((flags & SDVO_OUTPUT_MASK) == 0) { ++ if (flags == 0) { + unsigned char bytes[2]; + + intel_sdvo->controlled_output = 0; diff --git a/queue-5.10/drm-i915-sdvo-setup-ddc-fully-before-output-init.patch b/queue-5.10/drm-i915-sdvo-setup-ddc-fully-before-output-init.patch new file mode 100644 index 00000000000..d7e2696d562 --- /dev/null +++ b/queue-5.10/drm-i915-sdvo-setup-ddc-fully-before-output-init.patch @@ -0,0 +1,126 @@ +From e79762512120f11c51317570519a1553c70805d8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +Date: Wed, 26 Oct 2022 13:11:28 +0300 +Subject: drm/i915/sdvo: Setup DDC fully before output init +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ville Syrjälä + +commit e79762512120f11c51317570519a1553c70805d8 upstream. + +Call intel_sdvo_select_ddc_bus() before initializing any +of the outputs. And before that is functional (assuming no VBT) +we have to set up the controlled_outputs thing. Otherwise DDC +won't be functional during the output init but LVDS really +needs it for the fixed mode setup. + +Note that the whole multi output support still looks very +bogus, and more work will be needed to make it correct. +But for now this should at least fix the LVDS EDID fixed mode +setup. + +Cc: stable@vger.kernel.org +Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7301 +Fixes: aa2b88074a56 ("drm/i915/sdvo: Fix multi function encoder stuff") +Signed-off-by: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20221026101134.20865-3-ville.syrjala@linux.intel.com +Reviewed-by: Jani Nikula +(cherry picked from commit 64b7b557dc8a96d9cfed6aedbf81de2df80c025d) +Signed-off-by: Tvrtko Ursulin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/display/intel_sdvo.c | 31 +++++++++++------------------- + 1 file changed, 12 insertions(+), 19 deletions(-) + +--- a/drivers/gpu/drm/i915/display/intel_sdvo.c ++++ b/drivers/gpu/drm/i915/display/intel_sdvo.c +@@ -2760,13 +2760,10 @@ intel_sdvo_dvi_init(struct intel_sdvo *i + if (!intel_sdvo_connector) + return false; + +- if (device == 0) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; ++ if (device == 0) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0; +- } else if (device == 1) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; ++ else if (device == 1) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1; +- } + + intel_connector = &intel_sdvo_connector->base; + connector = &intel_connector->base; +@@ -2821,7 +2818,6 @@ intel_sdvo_tv_init(struct intel_sdvo *in + encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; + connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; + +- intel_sdvo->controlled_output |= type; + intel_sdvo_connector->output_flag = type; + + if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { +@@ -2862,13 +2858,10 @@ intel_sdvo_analog_init(struct intel_sdvo + encoder->encoder_type = DRM_MODE_ENCODER_DAC; + connector->connector_type = DRM_MODE_CONNECTOR_VGA; + +- if (device == 0) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; ++ if (device == 0) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0; +- } else if (device == 1) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; ++ else if (device == 1) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1; +- } + + if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + kfree(intel_sdvo_connector); +@@ -2898,13 +2891,10 @@ intel_sdvo_lvds_init(struct intel_sdvo * + encoder->encoder_type = DRM_MODE_ENCODER_LVDS; + connector->connector_type = DRM_MODE_CONNECTOR_LVDS; + +- if (device == 0) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; ++ if (device == 0) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0; +- } else if (device == 1) { +- intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; ++ else if (device == 1) + intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1; +- } + + if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + kfree(intel_sdvo_connector); +@@ -2957,8 +2947,14 @@ static u16 intel_sdvo_filter_output_flag + static bool + intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) + { ++ struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); ++ + flags = intel_sdvo_filter_output_flags(flags); + ++ intel_sdvo->controlled_output = flags; ++ ++ intel_sdvo_select_ddc_bus(i915, intel_sdvo); ++ + if (flags & SDVO_OUTPUT_TMDS0) + if (!intel_sdvo_dvi_init(intel_sdvo, 0)) + return false; +@@ -2999,7 +2995,6 @@ intel_sdvo_output_setup(struct intel_sdv + if (flags == 0) { + unsigned char bytes[2]; + +- intel_sdvo->controlled_output = 0; + memcpy(bytes, &intel_sdvo->caps.output_flags, 2); + DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n", + SDVO_NAME(intel_sdvo), +@@ -3411,8 +3406,6 @@ bool intel_sdvo_init(struct drm_i915_pri + */ + intel_sdvo->base.cloneable = 0; + +- intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo); +- + /* Set the input timing to the screen. Assume always input 0. */ + if (!intel_sdvo_set_target_input(intel_sdvo)) + goto err_output; diff --git a/queue-5.10/drm-rockchip-dsi-force-synchronous-probe.patch b/queue-5.10/drm-rockchip-dsi-force-synchronous-probe.patch new file mode 100644 index 00000000000..ee311c7daa7 --- /dev/null +++ b/queue-5.10/drm-rockchip-dsi-force-synchronous-probe.patch @@ -0,0 +1,40 @@ +From 81e592f86f7afdb76d655e7fbd7803d7b8f985d8 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Wed, 19 Oct 2022 17:03:49 -0700 +Subject: drm/rockchip: dsi: Force synchronous probe + +From: Brian Norris + +commit 81e592f86f7afdb76d655e7fbd7803d7b8f985d8 upstream. + +We can't safely probe a dual-DSI display asynchronously +(driver_async_probe='*' or driver_async_probe='dw-mipi-dsi-rockchip' +cmdline), because dw_mipi_dsi_rockchip_find_second() pokes one DSI +device's drvdata from the other device without any locking. + +Request synchronous probe, at least until this driver learns some +appropriate locking for dual-DSI initialization. + +Cc: +Signed-off-by: Brian Norris +Signed-off-by: Heiko Stuebner +Link: https://patchwork.freedesktop.org/patch/msgid/20221019170255.2.I6b985b0ca372b7e35c6d9ea970b24bcb262d4fc1@changeid +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c ++++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +@@ -1286,5 +1286,11 @@ struct platform_driver dw_mipi_dsi_rockc + .of_match_table = dw_mipi_dsi_rockchip_dt_ids, + .pm = &dw_mipi_dsi_rockchip_pm_ops, + .name = "dw-mipi-dsi-rockchip", ++ /* ++ * For dual-DSI display, one DSI pokes at the other DSI's ++ * drvdata in dw_mipi_dsi_rockchip_find_second(). This is not ++ * safe for asynchronous probe. ++ */ ++ .probe_type = PROBE_FORCE_SYNCHRONOUS, + }, + }; diff --git a/queue-5.10/series b/queue-5.10/series index 3b78c70db9f..94f25e2357d 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -111,3 +111,6 @@ kvm-x86-emulator-em_sysexit-should-update-ctxt-mode.patch kvm-x86-emulator-introduce-emulator_recalc_and_set_mode.patch kvm-x86-emulator-update-the-emulation-mode-after-cr0-write.patch ext4-f2fs-fix-readahead-of-verity-data.patch +drm-rockchip-dsi-force-synchronous-probe.patch +drm-i915-sdvo-filter-out-invalid-outputs-more-sensibly.patch +drm-i915-sdvo-setup-ddc-fully-before-output-init.patch -- 2.47.3