Skip to content

Commit 16fef33

Browse files
ideakrodrigovivi
authored andcommitted
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: 35d2e4b ("drm/i915/ddi: start distinguishing 128b/132b SST and MST at state readout") Fixes: 40d489f ("drm/i915/ddi: handle 128b/132b SST in intel_ddi_read_func_ctl()") Cc: Jani Nikula <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 0159e31) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent d082ecb commit 16fef33

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/i915/display/intel_ddi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
866866
encoder->base.base.id, encoder->base.name);
867867

868868
if (!mst_pipe_mask && dp128b132b_pipe_mask) {
869-
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
869+
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
870870

871871
/*
872872
* 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,
878878
* we don't expect MST to have been enabled at that point, and
879879
* can assume it's SST.
880880
*/
881-
if (hweight8(dp128b132b_pipe_mask) > 1 || intel_dp->is_mst)
881+
if (hweight8(dp128b132b_pipe_mask) > 1 ||
882+
intel_dp_mst_encoder_active_links(dig_port))
882883
mst_pipe_mask = dp128b132b_pipe_mask;
883884
}
884885

@@ -4151,13 +4152,13 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
41514152
} else if (ddi_mode == TRANS_DDI_MODE_SELECT_DP_MST) {
41524153
intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
41534154
} else if (ddi_mode == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B && HAS_DP20(display)) {
4154-
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
4155+
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
41554156

41564157
/*
41574158
* If this is true, we know we're being called from mst stream
41584159
* encoder's ->get_config().
41594160
*/
4160-
if (intel_dp->is_mst)
4161+
if (intel_dp_mst_encoder_active_links(dig_port))
41614162
intel_ddi_read_func_ctl_dp_mst(encoder, pipe_config, ddi_func_ctl);
41624163
else
41634164
intel_ddi_read_func_ctl_dp_sst(encoder, pipe_config, ddi_func_ctl);

0 commit comments

Comments
 (0)