Commit 0bfcb56e authored by Zhikai Zhai's avatar Zhikai Zhai Committed by Alex Deucher
Browse files

drm/amd/display: Modify the link training policy



[Why&How]
Currently fallback to low link rate if the link training
fails once on USB4. It may cause the bandwidth couldn't
satisfy the requirement of streams. Modify the policy
to do training retry in the previous few times, only
do fallback at the last time.

Reviewed-by: default avatarMeenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
Signed-off-by: default avatarZhikai Zhai <zhikai.zhai@amd.com>
Signed-off-by: default avatarRay Wu <ray.wu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 46fbe1e3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1729,6 +1729,15 @@ bool perform_link_training_with_retries(
				break;
		}

		if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA &&
				stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST &&
				!link->dc->config.enable_dpia_pre_training) {
			if (j == (attempts - 1))
				do_fallback = true;
			else
				do_fallback = false;
		}

		if (j == (attempts - 1)) {
			DC_LOG_WARNING(
				"%s: Link(%d) training attempt %u of %d failed @ rate(%d) x lane(%d) @ spread = %x : fail reason:(%d)\n",