Hi,

Except for matrox, most drivers use waitretrace to sync on vertical
refresh which basically polls the status register 0x3da.  However, this
register is only valid if the hardware is in CGA emulation.  If the
hardware is in MDA emulation, then the correct status register is
0x3ba.  Polling 0x3da when hardware is in MDA emulation will result in
an infinite loop.

So, either we force the hardware to be always in CGA emulation, or we
can just check the current emulation before polling the correct status
register.  Most hardware are probably in CGA emulation anyway, and the
few that don't sets the hardware to CGA.  Do you think this is a good idea?

Tony

--- /home/tony/src/temp/DirectFB-0.9.10/src/core/fbdev.c        Mon Apr 22 21:23:33 
2002
+++ fbdev.c     Wed Apr 24 09:06:29 2002
@@ -188,11 +188,20 @@
 #if defined(HAVE_INB_OUTB_IOPL)
      iopl(3);
 
-     while ((inb (0x3da) & 0x8))
-          ;
-
-     while (!(inb (0x3da) & 0x8))
-          ;
+     if (!(inb (0x3cc) & 1)) {
+       while ((inb (0x3ba) & 0x8))
+        ;
+       
+       while (!(inb (0x3ba) & 0x8))
+        ;
+     }
+     else {
+       while ((inb (0x3da) & 0x8))
+        ;
+       
+       while (!(inb (0x3da) & 0x8))
+        ;
+     }
 #endif
 }
 





-- 
Info:  To unsubscribe send a mail to [EMAIL PROTECTED] with 
"unsubscribe directfb-dev" as subject.

Reply via email to