Commit 818832bf authored by Xiaodong Yan's avatar Xiaodong Yan Committed by Alex Deucher

drm/amd/display: retry 3 times before successfully reading

DPCD Extended Receiver Capability Field

[Why]
1.dpcd extended receiver capability sometimes read fail,
  and corrupted data leads to sink caps is not correct.
2.sometimes sink reply ack with fewer data

[How]
  check the return value of core_link_read_dpcd,
  try to read again when failure happens
Signed-off-by: default avatarXiaodong Yan <Xiaodong.Yan@amd.com>
Reviewed-by: default avatarWenjing Liu <Wenjing.Liu@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a7513419
...@@ -2371,11 +2371,22 @@ static bool retrieve_link_cap(struct dc_link *link) ...@@ -2371,11 +2371,22 @@ static bool retrieve_link_cap(struct dc_link *link)
dpcd_data[DP_TRAINING_AUX_RD_INTERVAL]; dpcd_data[DP_TRAINING_AUX_RD_INTERVAL];
if (aux_rd_interval.bits.EXT_RECIEVER_CAP_FIELD_PRESENT == 1) { if (aux_rd_interval.bits.EXT_RECIEVER_CAP_FIELD_PRESENT == 1) {
core_link_read_dpcd( uint8_t ext_cap_data[16];
memset(ext_cap_data, '\0', sizeof(ext_cap_data));
for (i = 0; i < read_dpcd_retry_cnt; i++) {
status = core_link_read_dpcd(
link, link,
DP_DP13_DPCD_REV, DP_DP13_DPCD_REV,
dpcd_data, ext_cap_data,
sizeof(dpcd_data)); sizeof(ext_cap_data));
if (status == DC_OK) {
memcpy(dpcd_data, ext_cap_data, sizeof(dpcd_data));
break;
}
}
if (status != DC_OK)
dm_error("%s: Read extend caps data failed, use cap from dpcd 0.\n", __func__);
} }
} }
......
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