Commit c99fcb02 authored by Zhikai Zhai's avatar Zhikai Zhai Committed by Alex Deucher

drm/amd/display: refine to decide the verified link setting

[WHY]
We return false by default when link training fail at link loss.
It will cause we get a fail verified link caps directly.

[HOW]
Record the highest verified link caps. Use the recorded value as
the verified link caps if it is not successful in the last attempt
to avoid to use the lowest link setting.
Reviewed-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Acked-by: default avatarAlan Liu <haoping.liu@amd.com>
Signed-off-by: default avatarZhikai Zhai <zhikai.zhai@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3a87e25a
...@@ -2165,7 +2165,9 @@ static bool dp_verify_link_cap( ...@@ -2165,7 +2165,9 @@ static bool dp_verify_link_cap(
link, link,
&irq_data)) &irq_data))
(*fail_count)++; (*fail_count)++;
} else if (status == LINK_TRAINING_LINK_LOSS) {
success = true;
(*fail_count)++;
} else { } else {
(*fail_count)++; (*fail_count)++;
} }
...@@ -2188,6 +2190,7 @@ bool dp_verify_link_cap_with_retries( ...@@ -2188,6 +2190,7 @@ bool dp_verify_link_cap_with_retries(
int i = 0; int i = 0;
bool success = false; bool success = false;
int fail_count = 0; int fail_count = 0;
struct dc_link_settings last_verified_link_cap = fail_safe_link_settings;
dp_trace_detect_lt_init(link); dp_trace_detect_lt_init(link);
...@@ -2204,10 +2207,14 @@ bool dp_verify_link_cap_with_retries( ...@@ -2204,10 +2207,14 @@ bool dp_verify_link_cap_with_retries(
if (!link_detect_connection_type(link, &type) || type == dc_connection_none) { if (!link_detect_connection_type(link, &type) || type == dc_connection_none) {
link->verified_link_cap = fail_safe_link_settings; link->verified_link_cap = fail_safe_link_settings;
break; break;
} else if (dp_verify_link_cap(link, known_limit_link_setting, } else if (dp_verify_link_cap(link, known_limit_link_setting, &fail_count)) {
&fail_count) && fail_count == 0) { last_verified_link_cap = link->verified_link_cap;
success = true; if (fail_count == 0) {
break; success = true;
break;
}
} else {
link->verified_link_cap = last_verified_link_cap;
} }
fsleep(10 * 1000); fsleep(10 * 1000);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment