Commit 61da5fab authored by Jesse Barnes's avatar Jesse Barnes Committed by Keith Packard

drm/i915/dp: retry link status read 3 times on failure

Especially after a hotplug or power status change, the sink may not
reply immediately to a link status query.  So retry 3 times per the spec
to really make sure nothing is there.

See section 9.1 of the 1.1a DisplayPort spec.
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent fe0d4220
...@@ -1019,14 +1019,20 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) ...@@ -1019,14 +1019,20 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
static bool static bool
intel_dp_get_link_status(struct intel_dp *intel_dp) intel_dp_get_link_status(struct intel_dp *intel_dp)
{ {
int ret; int ret, i;
/* Must try AUX reads for this at least 3 times */
for (i = 0; i < 3; i++) {
ret = intel_dp_aux_native_read(intel_dp, ret = intel_dp_aux_native_read(intel_dp,
DP_LANE0_1_STATUS, DP_LANE0_1_STATUS,
intel_dp->link_status, DP_LINK_STATUS_SIZE); intel_dp->link_status,
if (ret != DP_LINK_STATUS_SIZE) DP_LINK_STATUS_SIZE);
return false; if (ret == DP_LINK_STATUS_SIZE)
return true; return true;
msleep(1);
}
return false;
} }
static uint8_t static uint8_t
......
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