diff options
| author | Adam Jackson <ajax@redhat.com> | 2011-07-12 17:38:04 -0400 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-07-25 13:35:03 -0400 |
| commit | 71ba9000e673d6171a52f2a8b14e0419087f7199 (patch) | |
| tree | 4976c78ebac00e607c34a62f048199e7694a0f79 | |
| parent | ac66ae8346fff704301e24ac55da1d76020660b2 (diff) | |
drm/i915/dp: Retry DPCD fetch on G4X too
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 13bddd34c057..9a0c3ca1ffa9 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1596,10 +1596,22 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) | |||
| 1596 | } | 1596 | } |
| 1597 | 1597 | ||
| 1598 | static enum drm_connector_status | 1598 | static enum drm_connector_status |
| 1599 | i915_dp_detect_common(struct intel_dp *intel_dp) | ||
| 1600 | { | ||
| 1601 | enum drm_connector_status status = connector_status_disconnected; | ||
| 1602 | |||
| 1603 | if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, | ||
| 1604 | sizeof (intel_dp->dpcd)) && | ||
| 1605 | (intel_dp->dpcd[DP_DPCD_REV] != 0)) | ||
| 1606 | status = connector_status_connected; | ||
| 1607 | |||
| 1608 | return status; | ||
| 1609 | } | ||
| 1610 | |||
| 1611 | static enum drm_connector_status | ||
| 1599 | ironlake_dp_detect(struct intel_dp *intel_dp) | 1612 | ironlake_dp_detect(struct intel_dp *intel_dp) |
| 1600 | { | 1613 | { |
| 1601 | enum drm_connector_status status; | 1614 | enum drm_connector_status status; |
| 1602 | bool ret; | ||
| 1603 | 1615 | ||
| 1604 | /* Can't disconnect eDP, but you can close the lid... */ | 1616 | /* Can't disconnect eDP, but you can close the lid... */ |
| 1605 | if (is_edp(intel_dp)) { | 1617 | if (is_edp(intel_dp)) { |
| @@ -1609,13 +1621,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp) | |||
| 1609 | return status; | 1621 | return status; |
| 1610 | } | 1622 | } |
| 1611 | 1623 | ||
| 1612 | status = connector_status_disconnected; | 1624 | return i915_dp_detect_common(intel_dp); |
| 1613 | ret = intel_dp_aux_native_read_retry(intel_dp, | ||
| 1614 | 0x000, intel_dp->dpcd, | ||
| 1615 | sizeof (intel_dp->dpcd)); | ||
| 1616 | if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0) | ||
| 1617 | status = connector_status_connected; | ||
| 1618 | return status; | ||
| 1619 | } | 1625 | } |
| 1620 | 1626 | ||
| 1621 | static enum drm_connector_status | 1627 | static enum drm_connector_status |
| @@ -1623,7 +1629,6 @@ g4x_dp_detect(struct intel_dp *intel_dp) | |||
| 1623 | { | 1629 | { |
| 1624 | struct drm_device *dev = intel_dp->base.base.dev; | 1630 | struct drm_device *dev = intel_dp->base.base.dev; |
| 1625 | struct drm_i915_private *dev_priv = dev->dev_private; | 1631 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1626 | enum drm_connector_status status; | ||
| 1627 | uint32_t temp, bit; | 1632 | uint32_t temp, bit; |
| 1628 | 1633 | ||
| 1629 | switch (intel_dp->output_reg) { | 1634 | switch (intel_dp->output_reg) { |
| @@ -1645,15 +1650,7 @@ g4x_dp_detect(struct intel_dp *intel_dp) | |||
| 1645 | if ((temp & bit) == 0) | 1650 | if ((temp & bit) == 0) |
| 1646 | return connector_status_disconnected; | 1651 | return connector_status_disconnected; |
| 1647 | 1652 | ||
| 1648 | status = connector_status_disconnected; | 1653 | return i915_dp_detect_common(intel_dp); |
| 1649 | if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, | ||
| 1650 | sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) | ||
| 1651 | { | ||
| 1652 | if (intel_dp->dpcd[DP_DPCD_REV] != 0) | ||
| 1653 | status = connector_status_connected; | ||
| 1654 | } | ||
| 1655 | |||
| 1656 | return status; | ||
| 1657 | } | 1654 | } |
| 1658 | 1655 | ||
| 1659 | /** | 1656 | /** |
