xmame  

[patch] DGA2.0 and Matrox G200

Shyouzou Sugitani
Sun, 26 Nov 2000 20:02:23 -0800


I think this is not a bug fix.

With this patch, xmame works well with DGA2.0 on my Matrox G200.
My conclusion is that we need to call XF86DGADirectVideo() before
XF86VidModeSwitchToMode().

>From README.DGA(version 2.0):
    XDGAOpenFramebuffer() should be called prior to initializing
a dga mode if direct framebuffer access is desired for that mode.

Enjoy.

--- src/unix/video-drivers/xf86_dga.c.dist      Sat Nov 18 21:37:21 2000
+++ src/unix/video-drivers/xf86_dga.c   Mon Nov 27 03:46:52 2000
@@ -390,16 +390,6 @@
                        return OSD_NOT_OK;
        }
 
-       fprintf(stderr_file,"VidMode Switching To Mode: %d x %d\n",
-                       bestmode->hdisplay,bestmode->vdisplay);
-
-       if(!XF86VidModeSwitchToMode(display,xf86ctx.screen,bestmode))
-       {
-               fprintf(stderr_file,"XF86VidModeSwitchToMode failed\n");
-               return OSD_NOT_OK;
-       }
-       xf86ctx.vidmode_changed = TRUE;
-
        if(XGrabKeyboard(display,window,True,
                GrabModeAsync,GrabModeAsync,CurrentTime))
        {
@@ -421,6 +411,8 @@
                        xf86ctx.grabbed_mouse = 1;
        }
 
+       XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
+
        if(first_time)
        {
                if(XF86DGAForkApp(xf86ctx.screen))
@@ -437,6 +429,17 @@
                fprintf(stderr_file,"XF86DGADirectVideo failed\n");
                return OSD_NOT_OK;
        }
+
+       fprintf(stderr_file,"VidMode Switching To Mode: %d x %d\n",
+                       bestmode->hdisplay,bestmode->vdisplay);
+
+       XF86VidModeSwitchMode(display,xf86ctx.screen,-1);
+       if(!XF86VidModeSwitchToMode(display,xf86ctx.screen,bestmode))
+       {
+               fprintf(stderr_file,"XF86VidModeSwitchToMode failed\n");
+               return OSD_NOT_OK;
+       }
+       xf86ctx.vidmode_changed = TRUE;
 
        if(!XF86DGASetViewPort(display,xf86ctx.screen,0,0))
        {
----
Shyouzou Sugitani <[EMAIL PROTECTED]>
                  <[EMAIL PROTECTED]>
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]