Commit 2770b915 authored by Joan Lee's avatar Joan Lee Committed by Alex Deucher

drm/amd/display: Add retires when read DPCD

[why & how]
Sometimes read DPCD return fail while result not retrieved yet. Add
retries mechanism in Replay handle hpd irq to get real result.
Reviewed-by: default avatarJerry Zuo <jerry.zuo@amd.com>
Acked-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: default avatarJoan Lee <joan.lee@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cc4d6ea0
...@@ -189,16 +189,30 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link) ...@@ -189,16 +189,30 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link)
union dpcd_replay_configuration replay_configuration = {0}; union dpcd_replay_configuration replay_configuration = {0};
/*AMD Replay version reuse DP_PSR_ERROR_STATUS for REPLAY_ERROR status.*/ /*AMD Replay version reuse DP_PSR_ERROR_STATUS for REPLAY_ERROR status.*/
union psr_error_status replay_error_status = {0}; union psr_error_status replay_error_status = {0};
bool ret = false;
int retries = 0;
if (!link->replay_settings.replay_feature_enabled) if (!link->replay_settings.replay_feature_enabled)
return; return;
dm_helpers_dp_read_dpcd( while (retries < 10) {
link->ctx, ret = dm_helpers_dp_read_dpcd(
link, link->ctx,
DP_SINK_PR_REPLAY_STATUS, link,
&replay_configuration.raw, DP_SINK_PR_REPLAY_STATUS,
sizeof(replay_configuration.raw)); &replay_configuration.raw,
sizeof(replay_configuration.raw));
if (ret)
break;
retries++;
}
if (!ret)
DC_LOG_WARNING("[%s][%d] DPCD read addr.0x%x failed with %d retries\n",
__func__, __LINE__,
DP_SINK_PR_REPLAY_STATUS, retries);
dm_helpers_dp_read_dpcd( dm_helpers_dp_read_dpcd(
link->ctx, link->ctx,
......
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