aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-07-07 14:11:00 -0400
committerKeith Packard <keithp@keithp.com>2011-07-07 16:38:44 -0400
commit899526d9a73fda47516cf11ccb3467ad6702f568 (patch)
treed4bdec27956e40aaa9209da438cea6ae3ef8f7f0
parent59cd09e1aea3ac6eb15b45e5d2261a63ecb1799c (diff)
drm/i915/dp: try to read receiver capabilities 3 times when detecting
If ->detect is called too soon after a hot plug event, the sink may not be ready yet. So try up to 3 times with 1ms sleeps in between tries to get the data (spec dictates that receivers must be ready to respond within 1ms and that sources should try 3 times). 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>
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a9a5051419df..70075d9900da 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1551,6 +1551,7 @@ static enum drm_connector_status
1551ironlake_dp_detect(struct intel_dp *intel_dp) 1551ironlake_dp_detect(struct intel_dp *intel_dp)
1552{ 1552{
1553 enum drm_connector_status status; 1553 enum drm_connector_status status;
1554 int ret, i;
1554 1555
1555 /* Can't disconnect eDP, but you can close the lid... */ 1556 /* Can't disconnect eDP, but you can close the lid... */
1556 if (is_edp(intel_dp)) { 1557 if (is_edp(intel_dp)) {
@@ -1561,12 +1562,16 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
1561 } 1562 }
1562 1563
1563 status = connector_status_disconnected; 1564 status = connector_status_disconnected;
1564 if (intel_dp_aux_native_read(intel_dp, 1565 for (i = 0; i < 3; i++) {
1565 0x000, intel_dp->dpcd, 1566 ret = intel_dp_aux_native_read(intel_dp,
1566 sizeof (intel_dp->dpcd)) 1567 0x000, intel_dp->dpcd,
1567 == sizeof(intel_dp->dpcd)) { 1568 sizeof (intel_dp->dpcd));
1568 if (intel_dp->dpcd[DP_DPCD_REV] != 0) 1569 if (ret == sizeof(intel_dp->dpcd) &&
1570 intel_dp->dpcd[DP_DPCD_REV] != 0) {
1569 status = connector_status_connected; 1571 status = connector_status_connected;
1572 break;
1573 }
1574 msleep(1);
1570 } 1575 }
1571 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], 1576 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0],
1572 intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]); 1577 intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]);