drm/amd/display: Fixed Clock Recovery Sequence
authorDavid Galiffi <David.Galiffi@amd.com>
Thu, 11 Mar 2021 23:13:12 +0000 (18:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:41:15 +0000 (16:41 -0400)
[Why]
When performing clock recovery, if a pre-emphasis adjustment is
requested, but voltage swing remains constant, the the retry counter
will not be reset. This can lead to prematurely failing link training.

[How]
Reset the clock recovery retry counter if an adjustment is requested
for either voltage swing or pre-emphasis.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Calvin Hou <Calvin.Hou@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

index 47e6c33f73cbad613b85014f864d703b32c62aa0..484d96f78ade59c33c0e7e84c5b8adf80236a5d3 100644 (file)
@@ -1098,11 +1098,13 @@ static enum link_training_result perform_clock_recovery_sequence(
                if (is_max_vs_reached(lt_settings))
                        break;
 
-               /* 7. same voltage*/
-               /* Note: VS same for all lanes,
-               * so comparing first lane is sufficient*/
-               if (lt_settings->lane_settings[0].VOLTAGE_SWING ==
+               /* 7. same lane settings*/
+               /* Note: settings are the same for all lanes,
+                * so comparing first lane is sufficient*/
+               if ((lt_settings->lane_settings[0].VOLTAGE_SWING ==
                        req_settings.lane_settings[0].VOLTAGE_SWING)
+                       && (lt_settings->lane_settings[0].PRE_EMPHASIS ==
+                               req_settings.lane_settings[0].PRE_EMPHASIS))
                        retries_cr++;
                else
                        retries_cr = 0;