[Intel-gfx] [PATCH] detect hdmi monitor by reading edid

ling.ma at intel.com ling.ma at intel.com
Mon Jun 29 08:41:28 CEST 2009


We detect HDMI output status by setting interrupt enable bit,
then read interrupt status, which is effective for most cases.
However G4x platform will indicate incorrect detection result 
even if current output is HDMI monitor. The patch intends
to read edid, then determin connect status by EDID type.

It fixed freedesktop.org bug #21322 and #22497.

Signed-off-by: Ma Ling <ling.ma at intel.com>
---
 src/i830_hdmi.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c
index 63fc6dc..958e635 100644
--- a/src/i830_hdmi.c
+++ b/src/i830_hdmi.c
@@ -154,6 +154,11 @@ i830_hdmi_detect(xf86OutputPtr output)
     xf86MonPtr edid_mon;
 
     dev_priv->has_hdmi_sink = FALSE;
+    edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
+    if (edid_mon != NULL) {
+        status = XF86OutputStatusConnected;
+        goto end;
+    }
 
     /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written 0xd.
      * Failure to do so will result in spurious interrupts being
@@ -197,8 +202,7 @@ i830_hdmi_detect(xf86OutputPtr output)
 	status = XF86OutputStatusConnected;
     else
 	return XF86OutputStatusDisconnected;
-
-    edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus);
+end:
     if (!edid_mon || !DIGITAL(edid_mon->features.input_type))
 	status = XF86OutputStatusDisconnected;
 
-- 
1.5.4.4




More information about the Intel-gfx mailing list