Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 28424981d3099dcac047cea5424ec3f7 > files > 4

x11-driver-video-intel-2.4.2-7.6mdv2009.0.src.rpm

From 092ae0577e68220754702c0ee2e08f6daaa75c3f Mon Sep 17 00:00:00 2001
From: Jesse Barnes <jbarnes@virtuousgeek.org>
Date: Wed, 20 Aug 2008 14:40:29 -0700
Subject: [PATCH] Don't allocate a pipe for hotplug detection

It shouldn't be needed...
---
 src/i830_crt.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/i830_crt.c b/src/i830_crt.c
index 2a99f9c..8274c0c 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -352,10 +352,9 @@ i830_crt_detect(xf86OutputPtr output)
     xf86OutputStatus	    status;
     Bool		    connected;
 
-    crtc = i830GetLoadDetectPipe (output, NULL, &dpms_mode);
-    if (!crtc)
-	return XF86OutputStatusUnknown;
-
+    /*
+     * Try hotplug detection where supported
+     */
     if (IS_I945G(pI830) || IS_I945GM(pI830) || IS_I965G(pI830) ||
 	    IS_G33CLASS(pI830)) {
 	if (i830_crt_detect_hotplug(output))
@@ -363,12 +362,19 @@ i830_crt_detect(xf86OutputPtr output)
 	else
 	    status = XF86OutputStatusDisconnected;
 
-	goto out;
+	goto done;
     }
 
+    /*
+     * DDC is next best, no flicker
+     */
+    crtc = i830GetLoadDetectPipe (output, NULL, &dpms_mode);
+    if (!crtc)
+	return XF86OutputStatusUnknown;
+
     if (i830_crt_detect_ddc(output)) {
 	status = XF86OutputStatusConnected;
-	goto out;
+	goto out_release_pipe;
     }
 
     /* Use the load-detect method if we have no other way of telling. */
@@ -378,9 +384,10 @@ i830_crt_detect(xf86OutputPtr output)
     else
 	status = XF86OutputStatusDisconnected;
 
-out:
+out_release_pipe:
     i830ReleaseLoadDetectPipe (output, dpms_mode);
 
+done:
     return status;
 }
 
-- 
1.6.0.1