]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: DP training to set properly SCRAMBLING_DISABLE
authorVladimir Stempen <vladimir.stempen@amd.com>
Tue, 28 Apr 2020 17:04:35 +0000 (13:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 May 2020 21:23:51 +0000 (17:23 -0400)
[Why]
DP training sequence to set SCRAMBLING_DISABLE bit properly based on
training pattern - per DP Spec.

[How]
Update dpcd_pattern.v1_4.SCRAMBLING_DISABLE with 1 for TPS1, TPS2, TPS3,
but not for TPS4.

Signed-off-by: Vladimir Stempen <vladimir.stempen@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

index 27a7d2a58079bad8b20d11dd95bdb7e10e606f89..caa090d0b6acc6549186f96a850edbf60ad46343 100644 (file)
@@ -220,6 +220,30 @@ static enum dpcd_training_patterns
        return dpcd_tr_pattern;
 }
 
+static uint8_t dc_dp_initialize_scrambling_data_symbols(
+       struct dc_link *link,
+       enum dc_dp_training_pattern pattern)
+{
+       uint8_t disable_scrabled_data_symbols = 0;
+
+       switch (pattern) {
+       case DP_TRAINING_PATTERN_SEQUENCE_1:
+       case DP_TRAINING_PATTERN_SEQUENCE_2:
+       case DP_TRAINING_PATTERN_SEQUENCE_3:
+               disable_scrabled_data_symbols = 1;
+               break;
+       case DP_TRAINING_PATTERN_SEQUENCE_4:
+               disable_scrabled_data_symbols = 0;
+               break;
+       default:
+               ASSERT(0);
+               DC_LOG_HW_LINK_TRAINING("%s: Invalid HW Training pattern: %d\n",
+                       __func__, pattern);
+               break;
+       }
+       return disable_scrabled_data_symbols;
+}
+
 static inline bool is_repeater(struct dc_link *link, uint32_t offset)
 {
        return (!link->is_lttpr_mode_transparent && offset != 0);
@@ -252,6 +276,9 @@ static void dpcd_set_lt_pattern_and_lane_settings(
        dpcd_pattern.v1_4.TRAINING_PATTERN_SET =
                dc_dp_training_pattern_to_dpcd_training_pattern(link, pattern);
 
+       dpcd_pattern.v1_4.SCRAMBLING_DISABLE =
+               dc_dp_initialize_scrambling_data_symbols(link, pattern);
+
        dpcd_lt_buffer[DP_TRAINING_PATTERN_SET - DP_TRAINING_PATTERN_SET]
                = dpcd_pattern.raw;