diff --git a/src/i830_crt.c b/src/i830_crt.c index d8e4a76..f8c9b3d 100644 --- a/src/i830_crt.c +++ b/src/i830_crt.c @@ -202,18 +202,13 @@ i830_crt_detect_hotplug(xf86OutputPtr output) for (try = 0; try < tries; try++) { /* turn FORCE_DETECT on */ OUTREG(PORT_HOTPLUG_EN, hotplug_en); - + OUTREG(PORT_HOTPLUG_STAT, + INREG(PORT_HOTPLUG_STAT) | CRT_HOTPLUG_INT_STATUS); /* wait for FORCE_DETECT to go off */ - for (curtime = starttime = GetTimeInMillis(); - (curtime - starttime) < timeout_ms; - curtime = GetTimeInMillis()) - { - temp = INREG(PORT_HOTPLUG_EN); - - if ((temp & CRT_HOTPLUG_FORCE_DETECT) == 0) - break; - } + while (INREG(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT); } + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, + "\nDEBUG:VGA detected has finished\n"); /* Check the status to see if both blue and green are on now */ temp = INREG(PORT_HOTPLUG_STAT);