diff options
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 |