open-src/driver/xf86-video-intel/Do-force-CRT-detect-sequence-twice-on-4-series-chips.patch
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Thu, 15 Jan 2009 12:55:00 -0800
changeset 606 068c11b419c9
permissions -rw-r--r--
6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates Includes changes contributed by Liang, Kan <[email protected]>: - G41 support patches - DRM_CAS in libdrm type error can cause deadlock and hang the glxgears. Includes changes contributed by Martin Bochnig <[email protected]>: - Make SUNWxorg-mesa package platform-clean

From d6b2696f9ac14a81598e0147698209ad428fd45d Mon Sep 17 00:00:00 2001
From: Zhenyu Wang <[email protected]>
Date: Fri, 26 Sep 2008 09:53:03 +0800
Subject: [PATCH] Do force CRT detect sequence twice on 4 series chipset

---
 src/i830_crt.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/i830_crt.c b/src/i830_crt.c
index 5812e2b..2e70eb8 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -161,6 +161,14 @@ i830_crt_detect_hotplug(xf86OutputPtr output)
     uint32_t	temp;
     const int	timeout_ms = 1000;
     int		starttime, curtime;
+    int		tries = 1;
+
+    /* On 4 series, CRT detect sequence need to be done twice for safe. */
+    if (IS_G4X(pI830))
+	tries = 2;
+
+retry:
+    tries--;
 
     temp = INREG(PORT_HOTPLUG_EN);
 
@@ -173,6 +181,9 @@ i830_crt_detect_hotplug(xf86OutputPtr output)
 	    break;
     }
 
+    if (tries > 0)
+	goto retry;
+
     if ((INREG(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) ==
 	CRT_HOTPLUG_MONITOR_COLOR)
     {
-- 
1.5.6.5