Skip to content

Commit aeb79d9

Browse files
AMD-aricgregkh
authored andcommitted
drm/amd/display: Improve DisplayPort monitor interop
[ Upstream commit eec3303 ] [Why] DC is very fast at link training and stream enablement which causes issues such as blackscreens for non-compliant monitors. [How] After debugging with scaler vendors we implement the minimum delays at the necessary locations to ensure the monitor does not hang. Delays are generic due to lack of IEEE OUI information on the failing displays. Signed-off-by: Aric Cyr <aric.cyr@amd.com> Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Acked-by: Tony Cheng <Tony.Cheng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6152346 commit aeb79d9

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

‎drivers/gpu/drm/amd/display/dc/core/dc_link.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3146,9 +3146,11 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)
31463146
write_i2c_redriver_setting(pipe_ctx, false);
31473147
}
31483148
}
3149-
dc->hwss.disable_stream(pipe_ctx);
31503149

31513150
disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal);
3151+
3152+
dc->hwss.disable_stream(pipe_ctx);
3153+
31523154
if (pipe_ctx->stream->timing.flags.DSC) {
31533155
if (dc_is_dp_signal(pipe_ctx->stream->signal))
31543156
dp_set_dsc_enable(pipe_ctx, false);

‎drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,10 @@ static inline enum link_training_result perform_link_training_int(
11031103
dpcd_pattern.v1_4.TRAINING_PATTERN_SET = DPCD_TRAINING_PATTERN_VIDEOIDLE;
11041104
dpcd_set_training_pattern(link, dpcd_pattern);
11051105

1106+
/* delay 5ms after notifying sink of idle pattern before switching output */
1107+
if (link->connector_signal != SIGNAL_TYPE_EDP)
1108+
msleep(5);
1109+
11061110
/* 4. mainlink output idle pattern*/
11071111
dp_set_hw_test_pattern(link, DP_TEST_PATTERN_VIDEO_MODE, NULL, 0);
11081112

@@ -1552,6 +1556,12 @@ bool perform_link_training_with_retries(
15521556
struct dc_link *link = stream->link;
15531557
enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
15541558

1559+
/* We need to do this before the link training to ensure the idle pattern in SST
1560+
* mode will be sent right after the link training
1561+
*/
1562+
link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
1563+
pipe_ctx->stream_res.stream_enc->id, true);
1564+
15551565
for (j = 0; j < attempts; ++j) {
15561566

15571567
dp_enable_link_phy(
@@ -1568,12 +1578,6 @@ bool perform_link_training_with_retries(
15681578

15691579
dp_set_panel_mode(link, panel_mode);
15701580

1571-
/* We need to do this before the link training to ensure the idle pattern in SST
1572-
* mode will be sent right after the link training
1573-
*/
1574-
link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
1575-
pipe_ctx->stream_res.stream_enc->id, true);
1576-
15771581
if (link->aux_access_disabled) {
15781582
dc_link_dp_perform_link_training_skip_aux(link, link_setting);
15791583
return true;

‎drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,17 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)
10901090
dc_link_set_abm_disable(link);
10911091
}
10921092

1093-
if (dc_is_dp_signal(pipe_ctx->stream->signal))
1093+
if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
10941094
pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
1095+
1096+
/*
1097+
* After output is idle pattern some sinks need time to recognize the stream
1098+
* has changed or they enter protection state and hang.
1099+
*/
1100+
if (!dc_is_embedded_signal(pipe_ctx->stream->signal))
1101+
msleep(60);
1102+
}
1103+
10951104
}
10961105

10971106

0 commit comments

Comments
 (0)