diff options
author | Jesse Barnes <jbarnes@jbarnes-mobile.amr.corp.intel.com> | 2007-12-10 13:00:14 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@jbarnes-mobile.amr.corp.intel.com> | 2007-12-10 13:00:14 -0800 |
commit | e720ae4476c3f986f623ce0f0ab9775b8b9b7e05 (patch) | |
tree | 4ce36c3479111c7678786198043211dd54433f57 /src/i830_crt.c | |
parent | d9df93578b74785c08ba860b4c9aa23b0c89c91c (diff) |
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.
Diffstat (limited to 'src/i830_crt.c')
-rw-r--r-- | src/i830_crt.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/i830_crt.c b/src/i830_crt.c index d7762a07..cd71dc59 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 |