Ove Kaaven wrote:
On Mon, 12 Nov 2001, geschrader wrote:
Your reasoning makes sense but with your patch I get the following error:
X Error of failed request: XF86DGADirectNotActivated Major opcode of failed request: 138 (XFree86-DGA) Minor opcode of failed request: 26 (XDGACreateColormap) Serial number of failed request: 3691 Current serial number in output stream: 3951
I'm not sure how to interpret this. Documentation for DGA seems to be pretty non-existant. Is this complaining that the CreateColormap failed because DGA wasn't activated or that DGA wasn't activated because of the colormap failure?
It's probably the former. I'm guessing that you need to create the colormap on the same display that XDGAOpenFrameBuffer and XDGASetMode was done on (those are currently done on thread_display(), you'll probably have to change them too, then?)
The two attached patches seem to do the job. Thanks for the hints.
---
Glenn Schrader
------------------------------------------------------------------------
Index: dga2.c =================================================================== RCS file: /home/wine/wine/dlls/x11drv/dga2.c,v retrieving revision 1.5 diff -u -r1.5 dga2.c --- dga2.c 2001/09/11 00:32:33 1.5 +++ dga2.c 2001/11/20 22:13:32 @@ -102,7 +102,7 @@ { LPDDRAWI_DIRECTDRAW_LCL ddlocal = data->lpDD->lpExclusiveOwner; DWORD vram; - Display *display = thread_display(); + Display *display = gdi_display;
data->ddRVal = DD_OK; if (data->dwModeIndex) { @@ -174,7 +174,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(display, DefaultScreen(display), dga_dev, AllocAll); if (data->lpColorTable) X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256, @@ -185,7 +185,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_Flip(LPDDHAL_FLIPDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if (data->lpSurfCurr == X11DRV_DD_Primary) { DWORD ofs = data->lpSurfCurr->lpGbl->fpVidMem - dga_mem.fpStart; TSXDGASetViewport(display, DefaultScreen(display), @@ -199,7 +199,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_SetPalette(LPDDHAL_SETPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if ((data->lpDDSurface == X11DRV_DD_Primary) && data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) { TSXDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1);
Index: x11ddraw.c =================================================================== RCS file: /home/wine/wine/dlls/x11drv/x11ddraw.c,v retrieving revision 1.12 diff -u -r1.12 x11ddraw.c --- x11ddraw.c 2001/08/27 19:04:18 1.12 +++ x11ddraw.c 2001/11/20 22:13:42 @@ -49,7 +49,7 @@
static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - Display *display = thread_display(); + Display *display = gdi_display;
if(message != X11DRV_DD_GrabMessage) return CallWindowProcA(X11DRV_DD_GrabOldProcedure, hWnd, message, wParam, lParam); @@ -81,7 +81,7 @@ if(grab) { Window window = X11DRV_get_whole_window(GetFocus()); if(window) - XSetInputFocus(thread_display(), window, RevertToParent, CurrentTime); + XSetInputFocus(gdi_display, window, RevertToParent, CurrentTime); }
if(!X11DRV_DD_GrabMessage)
On Tue, 20 Nov 2001, Glenn Schrader wrote:
The two attached patches seem to do the job. Thanks for the hints.
Hmm.
@@ -49,7 +49,7 @@
static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
- Display *display = thread_display();
- Display *display = gdi_display;
Is this part really necessary?
Ove Kaaven wrote:
On Tue, 20 Nov 2001, Glenn Schrader wrote:
The two attached patches seem to do the job. Thanks for the hints.
Hmm.
@@ -49,7 +49,7 @@
static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - Display *display = thread_display();
- Display *display = gdi_display;
Is this part really necessary?
No it isn't, my mistake. Updated patches are attached.
---
Glenn Schrader
Index: dga2.c =================================================================== RCS file: /home/wine/wine/dlls/x11drv/dga2.c,v retrieving revision 1.5 diff -u -r1.5 dga2.c --- dga2.c 2001/09/11 00:32:33 1.5 +++ dga2.c 2001/11/20 22:13:32 @@ -102,7 +102,7 @@ { LPDDRAWI_DIRECTDRAW_LCL ddlocal = data->lpDD->lpExclusiveOwner; DWORD vram; - Display *display = thread_display(); + Display *display = gdi_display;
data->ddRVal = DD_OK; if (data->dwModeIndex) { @@ -174,7 +174,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(display, DefaultScreen(display), dga_dev, AllocAll); if (data->lpColorTable) X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256, @@ -185,7 +185,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_Flip(LPDDHAL_FLIPDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if (data->lpSurfCurr == X11DRV_DD_Primary) { DWORD ofs = data->lpSurfCurr->lpGbl->fpVidMem - dga_mem.fpStart; TSXDGASetViewport(display, DefaultScreen(display), @@ -199,7 +199,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_SetPalette(LPDDHAL_SETPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if ((data->lpDDSurface == X11DRV_DD_Primary) && data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) { TSXDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1);
Index: x11ddraw.c =================================================================== RCS file: /home/wine/wine/dlls/x11drv/x11ddraw.c,v retrieving revision 1.12 diff -u -r1.12 x11ddraw.c --- x11ddraw.c 2001/08/27 19:04:18 1.12 +++ x11ddraw.c 2001/11/21 10:40:13 @@ -81,7 +81,7 @@ if(grab) { Window window = X11DRV_get_whole_window(GetFocus()); if(window) - XSetInputFocus(thread_display(), window, RevertToParent, CurrentTime); + XSetInputFocus(gdi_display, window, RevertToParent, CurrentTime); }
if(!X11DRV_DD_GrabMessage)
On Wed, 21 Nov 2001, Glenn Schrader wrote:
No it isn't, my mistake. Updated patches are attached.
If that's the case, then this shouldn't be needed either...
@@ -81,7 +81,7 @@ if(grab) { Window window = X11DRV_get_whole_window(GetFocus()); if(window)
XSetInputFocus(thread_display(), window, RevertToParent, CurrentTime);
XSetInputFocus(gdi_display, window, RevertToParent, CurrentTime);
Ove Kaaven wrote:
On Wed, 21 Nov 2001, Glenn Schrader wrote:
No it isn't, my mistake. Updated patches are attached.
If that's the case, then this shouldn't be needed either...
@@ -81,7 +81,7 @@ if(grab) { Window window = X11DRV_get_whole_window(GetFocus()); if(window)
XSetInputFocus(thread_display(), window, RevertToParent,
CurrentTime); + XSetInputFocus(gdi_display, window, RevertToParent, CurrentTime);
I went back and tried to re-create the conditions that made me think that I needed patches in the x11ddraw.c file. They don't seem to be needed. What I think happened is that (sometimes) when I reset the X server (because DGA locks up the screen when an error happens) my graphics card doesn't reset cleanly. When this happens the X server restarts and appears to be working but attempting to run any DGA app causes it to lock up again. Reseting the server two or three times seems to actually reset everything. Has anybody else out there seen this kind of behavior?
I've attached only dga2.c.diff since thats the only one that seems to be needed.
---
Glenn Schrader
Index: dga2.c =================================================================== RCS file: /home/wine/wine/dlls/x11drv/dga2.c,v retrieving revision 1.6 diff -u -r1.6 dga2.c --- dga2.c 2001/11/19 02:30:05 1.6 +++ dga2.c 2001/11/24 13:34:31 @@ -102,7 +102,7 @@ { LPDDRAWI_DIRECTDRAW_LCL ddlocal = data->lpDD->lpExclusiveOwner; DWORD vram; - Display *display = thread_display(); + Display *display = gdi_display;
data->ddRVal = DD_OK; if (data->dwModeIndex) { @@ -174,7 +174,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_CreatePalette(LPDDHAL_CREATEPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; data->lpDDPalette->u1.dwReserved1 = TSXDGACreateColormap(display, DefaultScreen(display), dga_dev, AllocAll); if (data->lpColorTable) X11DRV_DDHAL_SetPalEntries(data->lpDDPalette->u1.dwReserved1, 0, 256, @@ -185,7 +185,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_Flip(LPDDHAL_FLIPDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if (data->lpSurfCurr == X11DRV_DD_Primary) { DWORD ofs = data->lpSurfCurr->lpGbl->fpVidMem - dga_mem.fpStart; TSXDGASetViewport(display, DefaultScreen(display), @@ -199,7 +199,7 @@
static DWORD PASCAL X11DRV_XF86DGA2_SetPalette(LPDDHAL_SETPALETTEDATA data) { - Display *display = thread_display(); + Display *display = gdi_display; if ((data->lpDDSurface == X11DRV_DD_Primary) && data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) { TSXDGAInstallColormap(display, DefaultScreen(display), data->lpDDPalette->u1.dwReserved1);