diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c index 44e5c05..be35dc5 100644 --- a/src/i830_hdmi.c +++ b/src/i830_hdmi.c @@ -141,6 +141,7 @@ i830_hdmi_detect(xf86OutputPtr output) uint32_t temp, bit; xf86OutputStatus status; xf86MonPtr edid_mon; + int attemp = 3; /* For G4X, PEG_BAND_GAP_DATA 3:0 must first be written 0xd. * Failure to do so will result in spurious interrupts being @@ -151,13 +152,15 @@ i830_hdmi_detect(xf86OutputPtr output) OUTREG(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd); } +again: + --attemp; + temp = INREG(PORT_HOTPLUG_EN); OUTREG(PORT_HOTPLUG_EN, temp | HDMIB_HOTPLUG_INT_EN | - HDMIC_HOTPLUG_INT_EN | - HDMID_HOTPLUG_INT_EN); + HDMIC_HOTPLUG_INT_EN ); POSTING_READ(PORT_HOTPLUG_EN); @@ -174,8 +177,13 @@ i830_hdmi_detect(xf86OutputPtr output) if ((INREG(PORT_HOTPLUG_STAT) & bit) != 0) status = XF86OutputStatusConnected; - else + else { + if (attemp > 0) + goto again; return XF86OutputStatusDisconnected; + } + + ErrorF("zhen: %d attemps ok\n", 3 - attemp); edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus); if (!edid_mon || !DIGITAL(edid_mon->features.input_type))