Skip to content

Commit 230dced

Browse files
Peichen Huangalexdeucher
authored andcommitted
drm/amd/display: improve dpia pre-train
[WHY] We see unstable DP LL 4.2.1.3 test result with dpia pre-train. It is because the outbox interrupt mechanism can not handle HPD immediately and require some improvement. [HOW] 1. not enable link if hpd_pending is true. 2. abort pre-train if training failed and hpd_pending is true. 3. check if 2 lane supported when it is alt mode Reviewed-by: Wenjing Liu <[email protected]> Reviewed-by: Meenakshikumar Somasundaram <[email protected]> Signed-off-by: Peichen Huang <[email protected]> Signed-off-by: Tom Chung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ec6d8d4 commit 230dced

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,9 @@ void dcn31_link_encoder_get_max_link_cap(struct link_encoder *enc, struct dc_lin
653653
if (!query_dp_alt_from_dmub(enc, &cmd))
654654
return;
655655

656-
if (cmd.query_dp_alt.data.is_usb &&
657-
cmd.query_dp_alt.data.is_dp4 == 0)
656+
if (cmd.query_dp_alt.data.is_dp_alt_disable == 0 &&
657+
cmd.query_dp_alt.data.is_usb &&
658+
cmd.query_dp_alt.data.is_dp4 == 0)
658659
link_settings->lane_count = MIN(LANE_COUNT_TWO, link_settings->lane_count);
659660

660661
return;

drivers/gpu/drm/amd/display/dc/link/link_dpms.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,6 +2548,15 @@ void link_set_dpms_on(
25482548
if (pipe_ctx->stream->dpms_off)
25492549
return;
25502550

2551+
/* For Dp tunneling link, a pending HPD means that we have a race condition between processing
2552+
* current link and processing the pending HPD. If we enable the link now, we may end up with a
2553+
* link that is not actually connected to a sink. So we skip enabling the link in this case.
2554+
*/
2555+
if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && link->is_hpd_pending) {
2556+
DC_LOG_DEBUG("%s, Link%d HPD is pending, not enable it.\n", __func__, link->link_index);
2557+
return;
2558+
}
2559+
25512560
/* Have to setup DSC before DIG FE and BE are connected (which happens before the
25522561
* link training). This is to make sure the bandwidth sent to DIG BE won't be
25532562
* bigger than what the link and/or DIG BE can handle. VBID[6]/CompressedStream_flag

drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,6 +2312,14 @@ bool dp_verify_link_cap_with_retries(
23122312
} else {
23132313
link->verified_link_cap = last_verified_link_cap;
23142314
}
2315+
2316+
/* For Dp tunneling link, a pending HPD means that we have a race condition between processing
2317+
* current link and processing the pending HPD. Since the training is failed, we should just brak
2318+
* the loop so that we have chance to process the pending HPD.
2319+
*/
2320+
if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && link->is_hpd_pending)
2321+
break;
2322+
23152323
fsleep(10 * 1000);
23162324
}
23172325

0 commit comments

Comments
 (0)