xf86-video-intel: src/i830_crt.c
Jesse Barnes
jbarnes at kemper.freedesktop.org
Mon Dec 10 13:03:24 PST 2007
src/i830_crt.c | 42 +++++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 19 deletions(-)
New commits:
commit e720ae4476c3f986f623ce0f0ab9775b8b9b7e05
Author: Jesse Barnes <jbarnes at jbarnes-mobile.amr.corp.intel.com>
Date: Mon Dec 10 13:00:14 2007 -0800
CRT hotplug detection improvements
Patch from Hong Liu.
Fixup CRT detection by making sure the pipe is enabled before CRT
detection actually occurs. Fixes bugs Hong was seeing on G35 and other
machines.
diff --git a/src/i830_crt.c b/src/i830_crt.c
index d7762a0..cd71dc5 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -349,34 +349,38 @@ i830_crt_detect(xf86OutputPtr output)
I830Ptr pI830 = I830PTR(pScrn);
xf86CrtcPtr crtc;
int dpms_mode;
-
+ xf86OutputStatus status;
+ Bool connected;
+
+ crtc = i830GetLoadDetectPipe (output, NULL, &dpms_mode);
+ if (!crtc)
+ return XF86OutputStatusUnknown;
+
if (IS_I945G(pI830) || IS_I945GM(pI830) || IS_I965G(pI830) ||
IS_G33CLASS(pI830)) {
if (i830_crt_detect_hotplug(output))
- return XF86OutputStatusConnected;
+ status = XF86OutputStatusConnected;
else
- return XF86OutputStatusDisconnected;
+ status = XF86OutputStatusDisconnected;
+
+ goto out;
}
- if (i830_crt_detect_ddc(output))
- return XF86OutputStatusConnected;
+ if (i830_crt_detect_ddc(output)) {
+ status = XF86OutputStatusConnected;
+ goto out;
+ }
/* Use the load-detect method if we have no other way of telling. */
- crtc = i830GetLoadDetectPipe (output, NULL, &dpms_mode);
-
- if (crtc)
- {
- Bool connected;
-
- connected = i830_crt_detect_load (crtc, output);
- i830ReleaseLoadDetectPipe (output, dpms_mode);
- if (connected)
- return XF86OutputStatusConnected;
- else
- return XF86OutputStatusDisconnected;
- }
+ connected = i830_crt_detect_load (crtc, output);
+ if (connected)
+ status = XF86OutputStatusConnected;
+ else
+ status = XF86OutputStatusDisconnected;
- return XF86OutputStatusUnknown;
+out:
+ i830ReleaseLoadDetectPipe (output, dpms_mode);
+ return status;
}
static void
More information about the xorg-commit
mailing list