dect
/
linux-2.6
Archived
13
0
Fork 0

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: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Jesse Barnes 2011-07-07 11:10:57 -07:00 committed by Keith Packard
parent fe0d42203c
commit 61da5fab5a
1 changed files with 13 additions and 7 deletions

View File

@ -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;
ret = intel_dp_aux_native_read(intel_dp, /* Must try AUX reads for this at least 3 times */
DP_LANE0_1_STATUS, for (i = 0; i < 3; i++) {
intel_dp->link_status, DP_LINK_STATUS_SIZE); ret = intel_dp_aux_native_read(intel_dp,
if (ret != DP_LINK_STATUS_SIZE) DP_LANE0_1_STATUS,
return false; intel_dp->link_status,
return true; DP_LINK_STATUS_SIZE);
if (ret == DP_LINK_STATUS_SIZE)
return true;
msleep(1);
}
return false;
} }
static uint8_t static uint8_t