diff mbox

Detect SDVO digital output according to EDID

Message ID 1248845115-22508-1-git-send-email-ling.ma@intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

ling.ma@intel.com July 29, 2009, 5:25 a.m. UTC
We send sdvo attach command to check sdvo output status, it is good enough
for most cases. However we also should care about the similar case on 4X
platform, which also share DDC bus with other analog devices.

The patch fixed bug on MP965-D. When plugged VGA by DVI-I output,
it shows sdvo dvi is detected incorrectly.

Signed-off-by: Ma Ling <ling.ma@intel.com>
---
 src/i830_sdvo.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 8f3193b..f46306e 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1819,18 +1819,20 @@  i830_sdvo_detect(xf86OutputPtr output)
 	}
     }
 
+    status =  XF86OutputStatusConnected;
     if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
     {
 	xf86MonPtr edid_mon;
 	/* Check EDID in DVI-I case */
 	edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
-	if (edid_mon && !DIGITAL(edid_mon->features.input_type)) {
-	    xfree(edid_mon);
-	    return XF86OutputStatusDisconnected;
+	if (edid_mon == NULL || !DIGITAL(edid_mon->features.input_type)) {
+	    status = XF86OutputStatusDisconnected;
 	}
-	xfree(edid_mon);
+
+	if (edid_mon)
+	    xfree(edid_mon);
     }
-    return XF86OutputStatusConnected;
+    return status;
 }
 
 static DisplayModePtr