diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c index 0abb151..4569517 100644 --- a/src/i830_hdmi.c +++ b/src/i830_hdmi.c @@ -155,6 +155,13 @@ i830_hdmi_detect(xf86OutputPtr output) dev_priv->has_hdmi_sink = FALSE; + edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus); + if (edid_mon != NULL) { + status = XF86OutputStatusConnected; + xf86DrvMsg(pScrn->scrnIndex, X_INFO,"\n this is mytest\n"); + 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 * generated on the port when a cable is not attached. @@ -166,14 +173,22 @@ i830_hdmi_detect(xf86OutputPtr output) temp = INREG(PORT_HOTPLUG_EN); - OUTREG(PORT_HOTPLUG_EN, - temp | - HDMIB_HOTPLUG_INT_EN | - HDMIC_HOTPLUG_INT_EN | - HDMID_HOTPLUG_INT_EN); + switch (dev_priv->output_reg) { + case SDVOB: + temp |= HDMIB_HOTPLUG_INT_EN; + break; + case SDVOC: + temp |= HDMIC_HOTPLUG_INT_EN; + break; + default: + return XF86OutputStatusUnknown; + } + + OUTREG(PORT_HOTPLUG_EN, temp); POSTING_READ(PORT_HOTPLUG_EN); + i830WaitForVblank(pScrn); switch (dev_priv->output_reg) { case SDVOB: bit = HDMIB_HOTPLUG_INT_STATUS; @@ -190,7 +205,7 @@ i830_hdmi_detect(xf86OutputPtr output) else return XF86OutputStatusDisconnected; - edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus); +end: if (!edid_mon || !DIGITAL(edid_mon->features.input_type)) status = XF86OutputStatusDisconnected;