diff options
author | Hersen Wu <hersenxs.wu@amd.com> | 2016-12-29 14:58:54 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 17:08:10 -0400 |
commit | 73c7260292db3f506b2562cbb25c06adfe90ca99 (patch) | |
tree | 5a6a6227ac5bd4ae469101b7b1e2b0e9d92d630e | |
parent | 886391680cce3b7c4543b88bbd4eb49c80c26532 (diff) | |
download | linux-stable-73c7260292db3f506b2562cbb25c06adfe90ca99.tar.gz linux-stable-73c7260292db3f506b2562cbb25c06adfe90ca99.tar.bz2 linux-stable-73c7260292db3f506b2562cbb25c06adfe90ca99.zip |
drm/amd/display: Fix link retraining hw sequence for auto test
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/link_hwss.h | 4 |
4 files changed, 9 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index ad1ce600a165..a7c6c980927e 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -366,9 +366,7 @@ static void set_preferred_link_settings(struct dc *dc, link_setting->lane_count; core_link->public.verified_link_cap.link_rate = link_setting->link_rate; - dp_retrain_link_physi(core_link, - link_setting, - false); + dp_retrain_link_dp_test(core_link, link_setting, false); } static void enable_hpd(const struct dc_link *link) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index d32bf61b66e9..a661fc6a69dd 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -1532,7 +1532,7 @@ static bool handle_hpd_irq_psr_sink(const struct core_link *link) static void dp_test_send_link_training(struct core_link *link) { - struct dc_link_settings link_settings; + struct dc_link_settings link_settings = {0}; core_link_read_dpcd( link, @@ -1549,7 +1549,7 @@ static void dp_test_send_link_training(struct core_link *link) link->public.verified_link_cap.lane_count = link_settings.lane_count; link->public.verified_link_cap.link_rate = link_settings.link_rate; - dp_retrain_link(link); + dp_retrain_link_dp_test(link, &link_settings, false); } static void dp_test_send_phy_test_pattern(struct core_link *link) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c index f870a0e72074..e287584ade29 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c @@ -200,28 +200,7 @@ void dp_set_hw_test_pattern( encoder->funcs->dp_set_phy_pattern(encoder, &pattern_param); } -void dp_retrain_link(struct core_link *link) -{ - struct pipe_ctx *pipes = link->dc->current_context->res_ctx.pipe_ctx; - unsigned int i; - - for (i = 0; i < MAX_PIPES; i++) { - if (pipes[i].stream_enc != NULL) { - dm_delay_in_microseconds(link->ctx, 100); - pipes->stream_enc->funcs->dp_blank(pipes[i].stream_enc); - link->dc->hwss.disable_stream(&pipes[i]); - dc_link_dp_perform_link_training( - &link->public, - &link->public.verified_link_cap, - true); - link->dc->hwss.enable_stream(&pipes[i]); - link->dc->hwss.unblank_stream(&pipes[i], - &link->public.verified_link_cap); - } - } -} - -void dp_retrain_link_physi(struct core_link *link, +void dp_retrain_link_dp_test(struct core_link *link, struct dc_link_settings *link_setting, bool skip_video_pattern) { @@ -240,6 +219,10 @@ void dp_retrain_link_physi(struct core_link *link, pipes[i].stream_enc->funcs->dp_blank( pipes[i].stream_enc); + /* disable any test pattern that might be active */ + dp_set_hw_test_pattern(link, + DP_TEST_PATTERN_VIDEO_MODE, NULL, 0); + dp_receiver_power_ctrl(link, false); link->link_enc->funcs->disable_output( diff --git a/drivers/gpu/drm/amd/display/dc/inc/link_hwss.h b/drivers/gpu/drm/amd/display/dc/inc/link_hwss.h index 30831c54878b..75d10e93b002 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/link_hwss.h +++ b/drivers/gpu/drm/amd/display/dc/inc/link_hwss.h @@ -68,9 +68,7 @@ void dp_set_hw_test_pattern( enum dp_panel_mode dp_get_panel_mode(struct core_link *link); -void dp_retrain_link(struct core_link *link); - -void dp_retrain_link_physi(struct core_link *link, +void dp_retrain_link_dp_test(struct core_link *link, struct dc_link_settings *link_setting, bool skip_video_pattern); |