]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp_mst: Fix encoder HW state readout for UHBR MST
authorImre Deak <imre.deak@intel.com>
Mon, 24 Feb 2025 09:32:42 +0000 (11:32 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 25 Feb 2025 13:56:06 +0000 (15:56 +0200)
The encoder HW/SW state verification should use a SW state which stays
unchanged while the encoder/output is active. The intel_dp::is_mst flag
used during state computation to choose between the DP SST/MST modes can
change while the output is active, if the sink gets disconnected or the
MST topology is removed for another reason. A subsequent state
verification using intel_dp::is_mst leads then to a mismatch if the
output is disabled/re-enabled without recomputing its state.

Use the encoder's active MST link count instead, which will be always
non-zero for an active MST output and will be zero for SST.

Fixes: 35d2e4b75649 ("drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout")
Fixes: 40d489fac0e8 ("drm/i915/ddi: handle 128b/132b SST in intel_ddi_read_func_ctl()")
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250224093242.1859583-1-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_ddi.c

index 5fe68943074421bb5f484cd21038b18c2051f76e..f7d0c0463bcece5fc85b3c81580e47e48e960eb1 100644 (file)
@@ -890,7 +890,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
                            encoder->base.base.id, encoder->base.name);
 
        if (!mst_pipe_mask && dp128b132b_pipe_mask) {
-               struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+               struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 
                /*
                 * If we don't have 8b/10b MST, but have more than one
@@ -902,7 +902,8 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
                 * we don't expect MST to have been enabled at that point, and
                 * can assume it's SST.
                 */
-               if (hweight8(dp128b132b_pipe_mask) > 1 || intel_dp->is_mst)
+               if (hweight8(dp128b132b_pipe_mask) > 1 ||
+                   intel_dp_mst_encoder_active_links(dig_port))
                        mst_pipe_mask = dp128b132b_pipe_mask;
        }
 
@@ -4127,13 +4128,13 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
        } else if (ddi_mode == TRANS_DDI_MODE_SELECT_DP_MST) {
                intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
        } else if (ddi_mode == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B && HAS_DP20(display)) {
-               struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+               struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
 
                /*
                 * If this is true, we know we're being called from mst stream
                 * encoder's ->get_config().
                 */
-               if (intel_dp->is_mst)
+               if (intel_dp_mst_encoder_active_links(dig_port))
                        intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
                else
                        intel_ddi_read_func_ctl_dp_sst(encoder, pipe_config, ddi_func_ctl);