[Intel-gfx] [PATCH] SDVO: use EDID digital info for detect in DVI-I

Zhenyu Wang zhenyu.z.wang at intel.com
Wed Dec 10 04:38:19 CET 2008


This trys to take the detect change for DVI-I from i830_hdmi.c.
So for SDVO DVI-I, we use EDID's digital type to check for
current type.
---
 src/i830_sdvo.c |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index f15cb04..e7d2488 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1467,6 +1467,19 @@ i830_sdvo_get_attached_display (xf86OutputPtr output, uint16_t* response)
     return TRUE;
 }
 
+
+static Bool
+i830_sdvo_digital_output(xf86OutputPtr output)
+{
+    I830OutputPrivatePtr intel_output = output->driver_private;
+    struct i830_sdvo_priv *dev_priv = intel_output->dev_priv;
+
+    if (dev_priv->attached_output & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1))
+	return TRUE;
+    else
+	return FALSE;
+}
+
 /**
  * Asks the SDVO device if any displays are currently connected.
  *
@@ -1479,15 +1492,27 @@ i830_sdvo_get_attached_display (xf86OutputPtr output, uint16_t* response)
 static xf86OutputStatus
 i830_sdvo_detect(xf86OutputPtr output)
 {
+    I830OutputPrivatePtr intel_output = output->driver_private;
+    xf86MonPtr edid_mon;
     uint16_t response;
 
     if (i830_sdvo_get_attached_display(output, &response) == FALSE)
 	return XF86OutputStatusUnknown;
 
-    if (response != 0)
-	return XF86OutputStatusConnected;
-    else
+    if (response == 0)
 	return XF86OutputStatusDisconnected;
+
+    /* For SDVO DVI-I, check if EDID exists and with digital type */
+    if (i830_sdvo_digital_output(output)) {
+	edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
+	if (!edid_mon || !DIGITAL(edid_mon->features.input_type)) {
+	    xfree(edid_mon);
+	    return XF86OutputStatusDisconnected;
+	}
+	xfree(edid_mon);
+    }
+
+    return XF86OutputStatusConnected;
 }
 
 static DisplayModePtr
-- 
1.5.6.5




More information about the Intel-gfx mailing list