Unverified Commit 16fef33f authored by Imre Deak's avatar Imre Deak Committed by Rodrigo Vivi
Browse files

drm/i915/dp_mst: Fix encoder HW state readout for UHBR MST



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: 35d2e4b7 ("drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout")
Fixes: 40d489fa ("drm/i915/ddi: handle 128b/132b SST in intel_ddi_read_func_ctl()")
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250224093242.1859583-1-imre.deak@intel.com


(cherry picked from commit 0159e311)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent d082ecbc
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -866,7 +866,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
@@ -878,7 +878,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;
	}

@@ -4151,13 +4152,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);