aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-07-07 14:10:57 -0400
committerKeith Packard <keithp@keithp.com>2011-07-07 16:38:27 -0400
commit61da5fab5a9b129cf05b1fe4666c3e45b3103fd4 (patch)
treed32b39d60881878ae7df4818a9387a884b7fba78 /drivers/gpu
parentfe0d42203cb5616eeff68b14576a0f7e2dd56625 (diff)
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 391b55f1cc74..86912bd737ad 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1019,14 +1019,20 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
1019static bool 1019static bool
1020intel_dp_get_link_status(struct intel_dp *intel_dp) 1020intel_dp_get_link_status(struct intel_dp *intel_dp)
1021{ 1021{
1022 int ret; 1022 int ret, i;
1023
1024 /* Must try AUX reads for this at least 3 times */
1025 for (i = 0; i < 3; i++) {
1026 ret = intel_dp_aux_native_read(intel_dp,
1027 DP_LANE0_1_STATUS,
1028 intel_dp->link_status,
1029 DP_LINK_STATUS_SIZE);
1030 if (ret == DP_LINK_STATUS_SIZE)
1031 return true;
1032 msleep(1);
1033 }
1023 1034
1024 ret = intel_dp_aux_native_read(intel_dp, 1035 return false;
1025 DP_LANE0_1_STATUS,
1026 intel_dp->link_status, DP_LINK_STATUS_SIZE);
1027 if (ret != DP_LINK_STATUS_SIZE)
1028 return false;
1029 return true;
1030} 1036}
1031 1037
1032static uint8_t 1038static uint8_t