Re: [AD] Changes in CVS

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I have applied last DGA2 driver changes to CVS.

Thank you. I was waiting this one to submit another small patch which adds
refresh rate support... Sorry to bother you, but I don't have write
permissions...

-- 
Angelo Mottola
a.mottola@xxxxxxxxxx

PS: Is there anyone who tried my new menu auto opening patch?
--- /usr/src/allegro_CVS/allegro.current/src/x/xdga2.c	Wed Oct  4 14:34:26 2000
+++ xdga2.c	Mon Oct  2 13:28:41 2000
@@ -78,6 +78,7 @@
 
    mode = XDGAQueryModes(_xwin.display, _xwin.screen, &num_modes);
 
+   /* Let's first try setting also requested refresh rate */
    for (i=0; i<num_modes; i++) {
       bpp = mode[i].depth;
       if (bpp == 24) bpp = mode[i].bitsPerPixel;
@@ -86,12 +87,27 @@
           (mode[i].viewportHeight == h) &&
           (mode[i].imageWidth >= vw) &&
           (mode[i].imageHeight >= vh) &&
+          (mode[i].verticalRefresh >= _refresh_rate_request) &&
           (bpp == depth)) break;
    }
 
    if (i == num_modes) {
-      XFree(mode);
-      return 0;
+      /* No modes were found, so now we don't care about refresh rate */
+      for (i=0; i<num_modes; i++) {
+         bpp = mode[i].depth;
+         if (bpp == 24) bpp = mode[i].bitsPerPixel;
+      
+         if ((mode[i].viewportWidth == w) &&
+            (mode[i].viewportHeight == h) &&
+            (mode[i].imageWidth >= vw) &&
+            (mode[i].imageHeight >= vh) &&
+            (bpp == depth)) break;
+      }
+      if (i == num_modes) {
+         /* No way out: mode not found */
+         XFree(mode);
+         return 0;
+      }
    }
    
    found = mode[i].num;
@@ -285,6 +301,7 @@
       return NULL;
    }
    _xwin.in_dga_mode = 2;
+   _current_refresh_rate = dga_device->mode.verticalRefresh;
    set_display_switch_mode(SWITCH_NONE);
 
    /* Installs DGA color map */
@@ -456,7 +473,7 @@
       set_display_switch_mode(SWITCH_BACKGROUND);
 
    }
-
+   
    ENABLE();
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/