summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2011-07-12 21:38:04 (GMT)
committerKeith Packard <keithp@keithp.com>2011-07-25 17:35:03 (GMT)
commit71ba9000e673d6171a52f2a8b14e0419087f7199 (patch)
tree4976c78ebac00e607c34a62f048199e7694a0f79
parentac66ae8346fff704301e24ac55da1d76020660b2 (diff)
downloadlinux-fsl-qoriq-71ba9000e673d6171a52f2a8b14e0419087f7199.tar.xz
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.c33
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 13bddd3..9a0c3ca 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)
}
static enum drm_connector_status
+i915_dp_detect_common(struct intel_dp *intel_dp)
+{
+ enum drm_connector_status status = connector_status_disconnected;
+
+ if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
+ sizeof (intel_dp->dpcd)) &&
+ (intel_dp->dpcd[DP_DPCD_REV] != 0))
+ status = connector_status_connected;
+
+ return status;
+}
+
+static enum drm_connector_status
ironlake_dp_detect(struct intel_dp *intel_dp)
{
enum drm_connector_status status;
- bool ret;
/* Can't disconnect eDP, but you can close the lid... */
if (is_edp(intel_dp)) {
@@ -1609,13 +1621,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
return status;
}
- status = connector_status_disconnected;
- ret = intel_dp_aux_native_read_retry(intel_dp,
- 0x000, intel_dp->dpcd,
- sizeof (intel_dp->dpcd));
- if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0)
- status = connector_status_connected;
- return status;
+ return i915_dp_detect_common(intel_dp);
}
static enum drm_connector_status
@@ -1623,7 +1629,6 @@ g4x_dp_detect(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp->base.base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- enum drm_connector_status status;
uint32_t temp, bit;
switch (intel_dp->output_reg) {
@@ -1645,15 +1650,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
if ((temp & bit) == 0)
return connector_status_disconnected;
- status = connector_status_disconnected;
- if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd,
- sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd))
- {
- if (intel_dp->dpcd[DP_DPCD_REV] != 0)
- status = connector_status_connected;
- }
-
- return status;
+ return i915_dp_detect_common(intel_dp);
}
/**