[Intel-gfx] [PATCH] Detect SDVO digital output according to EDID

ling.ma at intel.com ling.ma at intel.com
Wed Jul 29 07:25:15 CEST 2009


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 at intel.com>
---
 src/i830_sdvo.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

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
-- 
1.5.4.4




More information about the Intel-gfx mailing list