@@ -247,7 +247,7 @@ static uint8_t dc_dp_initialize_scrambling_data_symbols(
247
247
248
248
static inline bool is_repeater (struct dc_link * link , uint32_t offset )
249
249
{
250
- return (! link -> is_lttpr_mode_transparent && offset != 0 );
250
+ return (link -> lttpr_non_transparent_mode && offset != 0 );
251
251
}
252
252
253
253
static void dpcd_set_lt_pattern_and_lane_settings (
@@ -1040,7 +1040,7 @@ static enum link_training_result perform_clock_recovery_sequence(
1040
1040
/* 3. wait receiver to lock-on*/
1041
1041
wait_time_microsec = lt_settings -> cr_pattern_time ;
1042
1042
1043
- if (! link -> is_lttpr_mode_transparent )
1043
+ if (link -> lttpr_non_transparent_mode )
1044
1044
wait_time_microsec = TRAINING_AUX_RD_INTERVAL ;
1045
1045
1046
1046
wait_for_training_aux_rd_interval (
@@ -1274,7 +1274,7 @@ static void configure_lttpr_mode(struct dc_link *link)
1274
1274
link -> dpcd_caps .lttpr_caps .mode = repeater_mode ;
1275
1275
}
1276
1276
1277
- if (! link -> is_lttpr_mode_transparent ) {
1277
+ if (link -> lttpr_non_transparent_mode ) {
1278
1278
1279
1279
DC_LOG_HW_LINK_TRAINING ("%s\n Set LTTPR to Non Transparent Mode\n" , __func__ );
1280
1280
@@ -1479,7 +1479,7 @@ enum link_training_result dc_link_dp_perform_link_training(
1479
1479
& lt_settings );
1480
1480
1481
1481
/* Configure lttpr mode */
1482
- if (! link -> is_lttpr_mode_transparent )
1482
+ if (link -> lttpr_non_transparent_mode )
1483
1483
configure_lttpr_mode (link );
1484
1484
1485
1485
if (link -> ctx -> dc -> work_arounds .lt_early_cr_pattern )
@@ -1495,7 +1495,7 @@ enum link_training_result dc_link_dp_perform_link_training(
1495
1495
1496
1496
dp_set_fec_ready (link , fec_enable );
1497
1497
1498
- if (! link -> is_lttpr_mode_transparent ) {
1498
+ if (link -> lttpr_non_transparent_mode ) {
1499
1499
1500
1500
/* 2. perform link training (set link training done
1501
1501
* to false is done as well)
@@ -1762,7 +1762,7 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link)
1762
1762
* account for lttpr repeaters cap
1763
1763
* notes: repeaters do not snoop in the DPRX Capabilities addresses (3.6.3).
1764
1764
*/
1765
- if (! link -> is_lttpr_mode_transparent ) {
1765
+ if (link -> lttpr_non_transparent_mode ) {
1766
1766
if (link -> dpcd_caps .lttpr_caps .max_lane_count < max_link_cap .lane_count )
1767
1767
max_link_cap .lane_count = link -> dpcd_caps .lttpr_caps .max_lane_count ;
1768
1768
@@ -1920,7 +1920,7 @@ bool dp_verify_link_cap(
1920
1920
max_link_cap = get_max_link_cap (link );
1921
1921
1922
1922
/* Grant extended timeout request */
1923
- if (! link -> is_lttpr_mode_transparent && link -> dpcd_caps .lttpr_caps .max_ext_timeout > 0 ) {
1923
+ if (link -> lttpr_non_transparent_mode && link -> dpcd_caps .lttpr_caps .max_ext_timeout > 0 ) {
1924
1924
uint8_t grant = link -> dpcd_caps .lttpr_caps .max_ext_timeout & 0x80 ;
1925
1925
1926
1926
core_link_write_dpcd (link , DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT , & grant , sizeof (grant ));
@@ -3253,17 +3253,8 @@ static bool retrieve_link_cap(struct dc_link *link)
3253
3253
uint32_t read_dpcd_retry_cnt = 3 ;
3254
3254
int i ;
3255
3255
struct dp_sink_hw_fw_revision dp_hw_fw_revision ;
3256
-
3257
- /* Set default timeout to 3.2ms and read LTTPR capabilities */
3258
- bool ext_timeout_support = link -> dc -> caps .extended_aux_timeout_support &&
3259
- !link -> dc -> config .disable_extended_timeout_support ;
3260
-
3261
- link -> is_lttpr_mode_transparent = true;
3262
-
3263
- if (ext_timeout_support ) {
3264
- dc_link_aux_configure_timeout (link -> ddc ,
3265
- LINK_AUX_DEFAULT_EXTENDED_TIMEOUT_PERIOD );
3266
- }
3256
+ bool is_lttpr_present = false;
3257
+ const uint32_t post_oui_delay = 30 ; // 30ms
3267
3258
3268
3259
memset (dpcd_data , '\0' , sizeof (dpcd_data ));
3269
3260
memset (lttpr_dpcd_data , '\0' , sizeof (lttpr_dpcd_data ));
@@ -3272,6 +3263,13 @@ static bool retrieve_link_cap(struct dc_link *link)
3272
3263
memset (& edp_config_cap , '\0' ,
3273
3264
sizeof (union edp_configuration_cap ));
3274
3265
3266
+ /* if extended timeout is supported in hardware,
3267
+ * default to LTTPR timeout (3.2ms) first as a W/A for DP link layer
3268
+ * CTS 4.2.1.1 regression introduced by CTS specs requirement update.
3269
+ */
3270
+ dc_link_aux_try_to_configure_timeout (link -> ddc ,
3271
+ LINK_AUX_DEFAULT_LTTPR_TIMEOUT_PERIOD );
3272
+
3275
3273
status = core_link_read_dpcd (link , DP_SET_POWER ,
3276
3274
& dpcd_power_state , sizeof (dpcd_power_state ));
3277
3275
@@ -3283,6 +3281,12 @@ static bool retrieve_link_cap(struct dc_link *link)
3283
3281
if (status != DC_OK || dpcd_power_state == DP_SET_POWER_D3 )
3284
3282
udelay (1000 );
3285
3283
3284
+ dpcd_set_source_specific_data (link );
3285
+ /* Sink may need to configure internals based on vendor, so allow some
3286
+ * time before proceeding with possibly vendor specific transactions
3287
+ */
3288
+ msleep (post_oui_delay );
3289
+
3286
3290
for (i = 0 ; i < read_dpcd_retry_cnt ; i ++ ) {
3287
3291
status = core_link_read_dpcd (
3288
3292
link ,
@@ -3298,8 +3302,14 @@ static bool retrieve_link_cap(struct dc_link *link)
3298
3302
return false;
3299
3303
}
3300
3304
3301
- if (ext_timeout_support ) {
3302
-
3305
+ if (link -> dc -> caps .extended_aux_timeout_support &&
3306
+ link -> dc -> config .allow_lttpr_non_transparent_mode ) {
3307
+ /* By reading LTTPR capability, RX assumes that we will enable
3308
+ * LTTPR non transparent if LTTPR is present.
3309
+ * Therefore, only query LTTPR capability when both LTTPR
3310
+ * extended aux timeout and
3311
+ * non transparent mode is supported by hardware
3312
+ */
3303
3313
status = core_link_read_dpcd (
3304
3314
link ,
3305
3315
DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV ,
@@ -3330,20 +3340,21 @@ static bool retrieve_link_cap(struct dc_link *link)
3330
3340
lttpr_dpcd_data [DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT -
3331
3341
DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV ];
3332
3342
3333
- if (link -> dpcd_caps .lttpr_caps .phy_repeater_cnt > 0 &&
3343
+ is_lttpr_present = (link -> dpcd_caps .lttpr_caps .phy_repeater_cnt > 0 &&
3334
3344
link -> dpcd_caps .lttpr_caps .max_lane_count > 0 &&
3335
3345
link -> dpcd_caps .lttpr_caps .max_lane_count <= 4 &&
3336
- link -> dpcd_caps .lttpr_caps .revision .raw >= 0x14 ) {
3337
- link -> is_lttpr_mode_transparent = false;
3338
- } else {
3339
- /*No lttpr reset timeout to its default value*/
3340
- link -> is_lttpr_mode_transparent = true;
3341
- dc_link_aux_configure_timeout (link -> ddc , LINK_AUX_DEFAULT_TIMEOUT_PERIOD );
3342
- }
3343
-
3344
- CONN_DATA_DETECT (link , lttpr_dpcd_data , sizeof (lttpr_dpcd_data ), "LTTPR Caps: " );
3346
+ link -> dpcd_caps .lttpr_caps .revision .raw >= 0x14 );
3347
+ if (is_lttpr_present )
3348
+ CONN_DATA_DETECT (link , lttpr_dpcd_data , sizeof (lttpr_dpcd_data ), "LTTPR Caps: " );
3345
3349
}
3346
3350
3351
+ /* decide lttpr non transparent mode */
3352
+ link -> lttpr_non_transparent_mode = is_lttpr_present ;
3353
+
3354
+ if (!is_lttpr_present )
3355
+ dc_link_aux_try_to_configure_timeout (link -> ddc , LINK_AUX_DEFAULT_TIMEOUT_PERIOD );
3356
+
3357
+
3347
3358
{
3348
3359
union training_aux_rd_interval aux_rd_interval ;
3349
3360
@@ -4282,7 +4293,6 @@ void dp_set_fec_enable(struct dc_link *link, bool enable)
4282
4293
4283
4294
void dpcd_set_source_specific_data (struct dc_link * link )
4284
4295
{
4285
- const uint32_t post_oui_delay = 30 ; // 30ms
4286
4296
uint8_t dspc = 0 ;
4287
4297
enum dc_status ret ;
4288
4298
@@ -4323,10 +4333,6 @@ void dpcd_set_source_specific_data(struct dc_link *link)
4323
4333
link -> dc -> vendor_signature .data .raw ,
4324
4334
sizeof (link -> dc -> vendor_signature .data .raw ));
4325
4335
}
4326
-
4327
- // Sink may need to configure internals based on vendor, so allow some
4328
- // time before proceeding with possibly vendor specific transactions
4329
- msleep (post_oui_delay );
4330
4336
}
4331
4337
4332
4338
bool dc_link_set_backlight_level_nits (struct dc_link * link ,
0 commit comments