diff mbox

drm/i915: Workaround CRT detect issue for Ironlake

Message ID 1260324253-22738-1-git-send-email-zhenyuw@linux.intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zhenyu Wang Dec. 9, 2009, 2:04 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index e505144..602aeba 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -179,10 +179,16 @@  static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	u32 adpa;
+	u32 adpa, temp;
 	bool ret;
 
-	adpa = I915_READ(PCH_ADPA);
+	temp = adpa = I915_READ(PCH_ADPA);
+
+	/* Workaround for detect issue, disable analog port before
+	 * detect sequence, then restore the origin state after detect.
+	 */
+	adpa &= ~ADPA_DAC_ENABLE;
+	I915_WRITE(PCH_ADPA, adpa);
 
 	adpa &= ~ADPA_CRT_HOTPLUG_MASK;
 
@@ -209,6 +215,9 @@  static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector)
 	else
 		ret = false;
 
+	/* restore origin state */
+	I915_WRITE(PCH_ADPA, temp);
+
 	return ret;
 }