Skip to content

Commit eec3303

Browse files
AMD-aricalexdeucher
authored andcommitted
drm/amd/display: Improve DisplayPort monitor interop
[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>
1 parent a96562b commit eec3303

4 files changed

Lines changed: 26 additions & 13 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
@@ -3309,9 +3309,11 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx)
33093309
write_i2c_redriver_setting(pipe_ctx, false);
33103310
}
33113311
}
3312-
dc->hwss.disable_stream(pipe_ctx);
33133312

33143313
disable_link(pipe_ctx->stream->link, pipe_ctx->stream->signal);
3314+
3315+
dc->hwss.disable_stream(pipe_ctx);
3316+
33153317
if (pipe_ctx->stream->timing.flags.DSC) {
33163318
if (dc_is_dp_signal(pipe_ctx->stream->signal))
33173319
dp_set_dsc_enable(pipe_ctx, false);

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

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

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

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

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

15561566
dp_enable_link_phy(
@@ -1559,21 +1569,14 @@ bool perform_link_training_with_retries(
15591569
pipe_ctx->clock_source->id,
15601570
link_setting);
15611571

1562-
if ((link && link->dc->debug.dppowerup_delay > 0) || stream->sink_patches.dppowerup_delay > 0) {
1563-
int delay_dp_power_up_in_ms =
1564-
(link->dc->debug.dppowerup_delay >= stream->sink_patches.dppowerup_delay) ?
1565-
link->dc->debug.dppowerup_delay : stream->sink_patches.dppowerup_delay;
1572+
if (stream->sink_patches.dppowerup_delay > 0) {
1573+
int delay_dp_power_up_in_ms = stream->sink_patches.dppowerup_delay;
1574+
15661575
msleep(delay_dp_power_up_in_ms);
15671576
}
15681577

15691578
dp_set_panel_mode(link, panel_mode);
15701579

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-
15771580
if (link->aux_access_disabled) {
15781581
dc_link_dp_perform_link_training_skip_aux(link, link_setting);
15791582
return true;

‎drivers/gpu/drm/amd/display/dc/dc.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ struct dc_debug_options {
498498
bool usbc_combo_phy_reset_wa;
499499
bool disable_dsc;
500500
bool enable_dram_clock_change_one_display_vactive;
501-
unsigned int dppowerup_delay;
502501
};
503502

504503
struct dc_debug_data {

‎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
@@ -1069,8 +1069,17 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)
10691069
link->dc->hwss.set_abm_immediate_disable(pipe_ctx);
10701070
}
10711071

1072-
if (dc_is_dp_signal(pipe_ctx->stream->signal))
1072+
if (dc_is_dp_signal(pipe_ctx->stream->signal)) {
10731073
pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
1074+
1075+
/*
1076+
* After output is idle pattern some sinks need time to recognize the stream
1077+
* has changed or they enter protection state and hang.
1078+
*/
1079+
if (!dc_is_embedded_signal(pipe_ctx->stream->signal))
1080+
msleep(60);
1081+
}
1082+
10741083
}
10751084

10761085

0 commit comments

Comments
 (0)