diff options
Diffstat (limited to 'common/recipes-kernel/linux/files/0975-drm-amd-dal-Add-retry-mechanism-for-link-training.patch')
-rw-r--r-- | common/recipes-kernel/linux/files/0975-drm-amd-dal-Add-retry-mechanism-for-link-training.patch | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0975-drm-amd-dal-Add-retry-mechanism-for-link-training.patch b/common/recipes-kernel/linux/files/0975-drm-amd-dal-Add-retry-mechanism-for-link-training.patch new file mode 100644 index 00000000..aa1fea72 --- /dev/null +++ b/common/recipes-kernel/linux/files/0975-drm-amd-dal-Add-retry-mechanism-for-link-training.patch @@ -0,0 +1,131 @@ +From fa0758869eb00cfbe31058880581bbcdfd0b6195 Mon Sep 17 00:00:00 2001 +From: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> +Date: Wed, 16 Mar 2016 15:29:35 -0400 +Subject: [PATCH 0975/1110] drm/amd/dal: Add retry mechanism for link training. + +On some displays the training sequence succeedes only +after several consecutive tries. + +Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> +Acked-by: Harry Wentland <harry.wentland@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/dal/dc/core/dc_link.c | 6 +++- + drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c | 51 +++++++++++++++++----------- + drivers/gpu/drm/amd/dal/dc/inc/dc_link_dp.h | 5 +-- + 3 files changed, 40 insertions(+), 22 deletions(-) + +diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c +index fd406f9..97d6f93 100644 +--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c ++++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c +@@ -1178,7 +1178,11 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx) + if (link_settings.link_rate == LINK_RATE_LOW) + skip_video_pattern = false; + +- if (perform_link_training(link, &link_settings, skip_video_pattern)) { ++ if (perform_link_training_with_retries( ++ link, ++ &link_settings, ++ skip_video_pattern, ++ 3)) { + link->public.cur_link_settings = link_settings; + status = DC_OK; + } +diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c +index 282a56b..8fe0314 100644 +--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c ++++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link_dp.c +@@ -1040,6 +1040,31 @@ bool perform_link_training( + return status; + } + ++ ++bool perform_link_training_with_retries( ++ struct core_link *link, ++ const struct dc_link_settings *link_setting, ++ bool skip_video_pattern, ++ unsigned int retires) ++{ ++ uint8_t j; ++ uint8_t delay_between_retries = 10; ++ ++ for (j = 0; j < retires; ++j) { ++ ++ if (perform_link_training( ++ link, ++ link_setting, ++ skip_video_pattern)) ++ return true; ++ ++ msleep(delay_between_retries); ++ delay_between_retries += 10; ++ } ++ ++ return false; ++} ++ + /*TODO add more check to see if link support request link configuration */ + static bool is_link_setting_supported( + const struct dc_link_settings *link_setting, +@@ -1150,23 +1175,11 @@ bool dp_hbr_verify_link_cap( + if (skip_link_training) + success = true; + else { +- uint8_t num_retries = 3; +- uint8_t j; +- uint8_t delay_between_retries = 10; +- +- for (j = 0; j < num_retries; ++j) { +- success = perform_link_training( +- link, +- cur, +- skip_video_pattern); +- +- if (success) +- break; +- +- msleep(delay_between_retries); +- +- delay_between_retries += 10; +- } ++ success = perform_link_training_with_retries( ++ link, ++ cur, ++ skip_video_pattern, ++ 3); + } + + if (success) +@@ -1527,8 +1540,8 @@ bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link) + if (hpd_rx_irq_check_link_loss_status( + link, + &hpd_irq_dpcd_data)) { +- perform_link_training(link, +- &link->public.cur_link_settings, true); ++ perform_link_training_with_retries(link, ++ &link->public.cur_link_settings, true, 3); + status = false; + } + +diff --git a/drivers/gpu/drm/amd/dal/dc/inc/dc_link_dp.h b/drivers/gpu/drm/amd/dal/dc/inc/dc_link_dp.h +index a0ab6b3..b9fb8b9 100644 +--- a/drivers/gpu/drm/amd/dal/dc/inc/dc_link_dp.h ++++ b/drivers/gpu/drm/amd/dal/dc/inc/dc_link_dp.h +@@ -42,10 +42,11 @@ void decide_link_settings( + struct core_stream *stream, + struct dc_link_settings *link_setting); + +-bool perform_link_training( ++bool perform_link_training_with_retries( + struct core_link *link, + const struct dc_link_settings *link_setting, +- bool skip_video_pattern); ++ bool skip_video_pattern, ++ unsigned int retires); + + bool is_mst_supported(struct core_link *link); + +-- +2.7.4 + |