From aa40d0c07173209a2c13b332f1168e0df499a19e Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 13 Jun 2014 16:16:51 +0100 Subject: [PATCH 01/10] hw/xwin/glx: When generating shims, limit the considered features to GL version <=1.2 This fixes a problem when using Khronos registry data since the change of 2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to GL_ARB_imaging. If shim generation considers all features, no shims are generated for glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore as shims are only generated for GL version <=1.2), then emission for GL_ARB_imaging is skipped as they have already been emitted. Also improve feature name matching so it is exact, not on an initial substring, so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc' aren't matched by 'GL_ARB_texture_compression'. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/gen_gl_wrappers.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py index cdbba638a..69ab1efa9 100755 --- a/hw/xwin/glx/gen_gl_wrappers.py +++ b/hw/xwin/glx/gen_gl_wrappers.py @@ -100,13 +100,16 @@ reg = Registry() tree = etree.parse(regFilename) reg.loadElementTree(tree) -allVersions = '.*' +if shim: + versions = '1\.[012]' +else: + versions = '.*' genOpts = CGeneratorOptions( apiname = prefix, profile = 'compatibility', - versions = allVersions, - emitversions = allVersions, + versions = versions, + emitversions = versions, defaultExtensions = prefix, # Default extensions for GL protectFile = protect, protectFeature = protect, @@ -257,7 +260,7 @@ class ThunkOutputGenerator(OutputGenerator): pass def beginFeature(self, interface, emit): OutputGenerator.beginFeature(self, interface, emit) - self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') + self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1']) def endFeature(self): OutputGenerator.endFeature(self) def genType(self, typeinfo, name): @@ -355,7 +358,7 @@ class ShimOutputGenerator(OutputGenerator): pass def beginFeature(self, interface, emit): OutputGenerator.beginFeature(self, interface, emit) - self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') or self.featureName.startswith('GL_VERSION_1_2') or self.featureName.startswith('GL_ARB_imaging') or self.featureName.startswith('GL_ARB_multitexture') or self.featureName.startswith('GL_ARB_texture_compression') + self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1', 'GL_VERSION_1_2', 'GL_ARB_imaging', 'GL_ARB_multitexture', 'GL_ARB_texture_compression']) def endFeature(self): OutputGenerator.endFeature(self) def genType(self, typeinfo, name): From 95357539c1178a97d8a167461806a280d2803ec4 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 1 Jan 2014 20:34:36 +0000 Subject: [PATCH 02/10] hw/xwin: Makefile.am cleanup - Rename XWIN_GLX_LINK_FLAGS -> XWIN_GLX_SYS_LIBS for consistency - Rename MULTIWINDOW_LIBS -> MULTIWINDOW_SYS_LIBS for consistency - Don't link with XWin with $(MAIN_LIB), it provides it's own main() - Put one library per line for more intelligible diffs when one is added Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/Makefile.am | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 4ee963227..5908dfce4 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -15,7 +15,7 @@ if XWIN_GLX_WINDOWS GLX_DIR = glx DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS XWIN_GLX_LIBS = $(top_builddir)/hw/xwin/glx/libXwinGLX.la -XWIN_GLX_LINK_FLAGS = -lopengl32 +XWIN_GLX_SYS_LIBS = -lopengl32 endif if XWIN_MULTIWINDOW @@ -27,7 +27,7 @@ SRCS_MULTIWINDOW = \ propertystore.h \ winSetAppUserModelID.c DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW -MULTIWINDOW_LIBS = -lshlwapi -lole32 +MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32 endif if XWIN_MULTIWINDOWEXTWM @@ -150,11 +150,28 @@ XWin_SOURCES = $(SRCS) AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid -XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la \ - $(top_builddir)/Xi/libXistubs.la -XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) + +XWIN_LIBS += \ + $(top_builddir)/pseudoramiX/libPseudoramiX.la \ + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la + +XWin_DEPENDENCIES = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(XSERVER_LIBS) + +XWin_LDADD = \ + $(MULTIWINDOWEXTWM_LIBS) \ + $(XWIN_GLX_LIBS) \ + $(XWIN_LIBS) \ + $(XSERVER_LIBS) \ + $(XWIN_GLX_SYS_LIBS) \ + $(XSERVER_SYS_LIBS) \ + $(XWIN_SYS_LIBS) \ + $(MULTIWINDOW_SYS_LIBS) + XWin_LDFLAGS = -mwindows -Wl,--disable-stdcall-fixup $(LD_EXPORT_SYMBOLS_FLAG) From 16d9da08861fe504de4be8c31708592e30687156 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 18 Feb 2010 23:36:27 -0600 Subject: [PATCH 03/10] hw/xwin: Improve choice of display name used by internal clients Choose the display name used to connect to internal clients and exported into environment of processes started from the traymenu so that it uses a transport we know is working This should mean the server can start correctly with -multiwindow and/or -clipboard and any two of -nolisten inet6, -nolisten inet and -nolisten unix (the server will correctly refuse to start if all 3 are used, as it must be listening on at least one socket) v2: Place prototype for winGetDisplayName() in windisplay.h, and include it where needed. v3: Include xwin-config.h, so that _XSERVER64 is defined, just in case anything relies on that. v4: Replace grovelling around in the server's list of listeners with new Xtrans TransIsListening() interface, added in Xtrans 1.3.3 See also [1] [1] https://sourceware.org/bugzilla/show_bug.cgi?id=10725 Signed-off-by: Jon TURNEY Reviewed-by: Yaakov Selkowitz Reviewed-by: Colin Harrison --- hw/xwin/Makefile.am | 2 ++ hw/xwin/winclipboardthread.c | 3 +- hw/xwin/windisplay.c | 64 ++++++++++++++++++++++++++++++++++++ hw/xwin/windisplay.h | 34 +++++++++++++++++++ hw/xwin/winmsg.h | 2 ++ hw/xwin/winmultiwindowwm.c | 7 ++-- hw/xwin/winprefs.c | 8 ++--- 7 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 hw/xwin/windisplay.c create mode 100644 hw/xwin/windisplay.h diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 5908dfce4..326ffa03d 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -126,6 +126,8 @@ SRCS = InitInput.c \ winprefs.h \ winresource.h \ winwindow.h \ + windisplay.c \ + windisplay.h \ XWin.rc \ $(top_srcdir)/mi/miinitext.c \ $(SRCS_CLIPBOARD) \ diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index 33595be7f..e70896081 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -38,6 +38,7 @@ #include #include #include "winclipboard.h" +#include "windisplay.h" #ifdef __CYGWIN__ #include #endif @@ -157,7 +158,7 @@ winClipboardProc(void *pvNotUsed) * for all screens on the display. That is why there is only * one clipboard client thread. */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); + winGetDisplayName(szDisplay, 0); /* Print the display connection string */ ErrorF("winClipboardProc - DISPLAY=%s\n", szDisplay); diff --git a/hw/xwin/windisplay.c b/hw/xwin/windisplay.c new file mode 100644 index 000000000..17f0c7789 --- /dev/null +++ b/hw/xwin/windisplay.c @@ -0,0 +1,64 @@ +/* + * File: windisplay.c + * Purpose: Retrieve server display name + * + * Copyright (C) Jon TURNEY 2009 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include // for display +#include "windisplay.h" +#include "winmsg.h" + +#define XSERV_t +#define TRANS_SERVER +#include + +/* + Generate a display name string referring to the display of this server, + using a transport we know is enabled +*/ + +void +winGetDisplayName(char *szDisplay, unsigned int screen) +{ + if (_XSERVTransIsListening("local")) { + snprintf(szDisplay, 512, ":%s.%d", display, screen); + } + else if (_XSERVTransIsListening("inet")) { + snprintf(szDisplay, 512, "127.0.0.1:%s.%d", display, screen); + } + else if (_XSERVTransIsListening("inet6")) { + snprintf(szDisplay, 512, "::1:%s.%d", display, screen); + } + else { + // this can't happen! + ErrorF("winGetDisplay: Don't know what to use for DISPLAY\n"); + snprintf(szDisplay, 512, "localhost:%s.%d", display, screen); + } + + winDebug("winGetDisplay: DISPLAY=%s\n", szDisplay); +} diff --git a/hw/xwin/windisplay.h b/hw/xwin/windisplay.h new file mode 100644 index 000000000..d1d4549bf --- /dev/null +++ b/hw/xwin/windisplay.h @@ -0,0 +1,34 @@ +/* + * File: windisplay.h + * Purpose: Interface to retrieve server display name + * + * Copyright (C) Jon TURNEY 2009 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef WINDISPLAY_H +#define WINDISPLAY_H + +void +winGetDisplayName(char *szDisplay, unsigned int screen); + +#endif /* !WINDISPLAY_H */ diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h index b638f2cb3..6c96c4070 100644 --- a/hw/xwin/winmsg.h +++ b/hw/xwin/winmsg.h @@ -30,6 +30,8 @@ * Authors: Alexander Gottwald */ +#include + /* * Function prototypes */ diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 618e38121..e17a9502d 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -61,6 +61,7 @@ #include "pixmapstr.h" #include "windowstr.h" #include "winglobals.h" +#include "windisplay.h" #ifdef XWIN_MULTIWINDOWEXTWM #include @@ -1053,8 +1054,7 @@ winMultiWindowXMsgProc(void *pArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winMultiWindowXMsgProc - DISPLAY=%s\n", pszDisplay); @@ -1446,8 +1446,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) } /* Setup the display connection string x */ - snprintf(pszDisplay, - 512, "127.0.0.1:%s.%d", display, (int) pProcArg->dwScreen); + winGetDisplayName(pszDisplay, (int) pProcArg->dwScreen); /* Print the display connection string */ ErrorF("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay); diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index f386facdd..53abc163f 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -44,6 +44,7 @@ #include #include "winprefs.h" +#include "windisplay.h" #include "winmultiwindowclass.h" /* Where will the custom menu commands start counting from? */ @@ -712,15 +713,14 @@ LoadPreferences(void) /* Setup a DISPLAY environment variable, need to allocate on heap */ /* because putenv doesn't copy the argument... */ - snprintf(szDisplay, 512, "DISPLAY=127.0.0.1:%s.0", display); - szEnvDisplay = (char *) (malloc(strlen(szDisplay) + 1)); + winGetDisplayName(szDisplay, 0); + szEnvDisplay = (char *) (malloc(strlen(szDisplay) + strlen("DISPLAY=") + 1)); if (szEnvDisplay) { - strcpy(szEnvDisplay, szDisplay); + snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay); putenv(szEnvDisplay); } /* Replace any "%display%" in menu commands with display string */ - snprintf(szDisplay, 512, "127.0.0.1:%s.0", display); for (i = 0; i < pref.menuItems; i++) { for (j = 0; j < pref.menu[i].menuItems; j++) { if (pref.menu[i].menuItem[j].cmd == CMD_EXEC) { From 1c34e774eff6c5a22501833444a10440cf3f915a Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 11 Nov 2013 15:09:18 +0000 Subject: [PATCH 04/10] hw/xwin: Fix a potential crash in winRedrawScreenShadowDDNL() Seen during shutdown when using '-fullscreen' and '-depth 8' Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winshadddnl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 55af5c383..cb326dc81 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -986,6 +986,10 @@ winRedrawScreenShadowDDNL(ScreenPtr pScreen) RECT rcSrc, rcDest; POINT ptOrigin; + /* Return immediately if we didn't get needed surfaces */ + if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4) + return; + /* Get the origin of the window in the screen coords */ ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; From c99cd058a89bbfc9ceab3c91b93451f70351ddce Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 4 Mar 2014 22:37:13 +0000 Subject: [PATCH 05/10] hw/xwin: Add an idempotency guard to glwindows.h Add an idempotency guard to glwindows.h Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/glwindows.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xwin/glx/glwindows.h b/hw/xwin/glx/glwindows.h index 4f859b498..34ff24c24 100644 --- a/hw/xwin/glx/glwindows.h +++ b/hw/xwin/glx/glwindows.h @@ -28,6 +28,9 @@ * DEALINGS IN THE SOFTWARE. */ +#ifndef GLWINDOWS_H +#define GLWINDOWS_H + #include typedef struct { @@ -53,3 +56,5 @@ int glWinSelectImplementation(int native); #define GLWIN_TRACE_MSG(a, ...) #define GLWIN_DEBUG_MSG(a, ...) #endif + +#endif From d1d3bd359670a8f55c9350fd905af32ba6e67d33 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 30 Mar 2014 20:51:36 +0100 Subject: [PATCH 06/10] hw/xwin/glx: Don't override the server supported GL extensions string. Don't override the server supported GL extensions string. The string reported to the client is the intersection of client, server and GL implementation extensions. Overriding the server supported GL extensions string like this causes extensions which are supported by the client and implementation, but not by the server, to be erroneously reported, so don't change it. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/indirect.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 9bfaac03d..6c0303322 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -738,9 +738,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - // Override the GL extensions string set by __glXScreenInit() - screen->base.GLextensions = strdup(gl_extensions); - // Generate the GLX extensions string (overrides that set by __glXScreenInit()) { unsigned int buffer_size = From b1ea714cdce8444c6ad7778dae04e35c6bcc1750 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 27 Apr 2014 22:10:31 +0100 Subject: [PATCH 07/10] hw/xwin/glx: Update .gitignore Update to align with rewrite of wrapper generation script in commit 583a1146233f16d861706926706e5feec3baffba Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/.gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore index 062fd8573..9684410ac 100644 --- a/hw/xwin/glx/.gitignore +++ b/hw/xwin/glx/.gitignore @@ -1,3 +1,6 @@ # ignore generated files -generated_gl_wrappers.c +diag.txt +generated_gl_shim.c +generated_gl_thunks.c +generated_gl_thunks.def generated_wgl_wrappers.c From 31d089633683ea2a2716651c3c48e1456cc595bf Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 16 Jul 2014 13:44:33 +0100 Subject: [PATCH 08/10] hw/xwin/glx: Fix a couple of typo bugs in indirect.c fbConfigToPixelFormatIndex()'s drawableTypeOverride parameter is a drawable type bitmask, not a drawable type enum value WGL_SWAP_COPY_ARB is a value of the WGL_SWAP_METHOD_ARB attribute for wglChoosePixelFormatARB(), not an attribute itself also remove duplicate error reporting for wglChoosePixelFormat() and fix a comment Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/indirect.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 6c0303322..70b9156cc 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -1120,7 +1120,6 @@ glxWinSetPixelFormat(__GLXWinContext * gc, HDC hdc, int bppOverride, fbConfigToPixelFormatIndex(hdc, gc->base.config, drawableTypeOverride, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage()); return FALSE; } @@ -1303,7 +1302,7 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) glxWinScreen *winScreen; int pixelFormat; - // XXX: which DC are supposed to use??? + // XXX: which DC are we supposed to use??? HDC screenDC = GetDC(NULL); if (!(gc->base.config->drawableType & GLX_PBUFFER_BIT)) { @@ -1316,10 +1315,8 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) pixelFormat = fbConfigToPixelFormatIndex(screenDC, gc->base.config, - GLX_DRAWABLE_PBUFFER, winScreen); + GLX_PBUFFER_BIT, winScreen); if (pixelFormat == 0) { - ErrorF("wglChoosePixelFormat error: %s\n", - glxWinErrorMessage()); return; } @@ -1758,7 +1755,7 @@ fbConfigToPixelFormatIndex(HDC hdc, __GLXconfig * mode, SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_EXCHANGE_ARB); if (mode->swapMethod == GLX_SWAP_COPY_OML) - SET_ATTR_VALUE(WGL_SWAP_COPY_ARB, TRUE); + SET_ATTR_VALUE(WGL_SWAP_METHOD_ARB, WGL_SWAP_COPY_ARB); // XXX: this should probably be the other way around, but that messes up drawableTypeOverride if (mode->visualRating == GLX_SLOW_VISUAL_EXT) From b21321e515fc778f87077b7ce47922c43a4ba103 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 14 Jul 2014 19:41:25 +0100 Subject: [PATCH 09/10] hw/xwin/glx: Downgrade "forcing window to exist" message to debug It happens whenever a GLX client uses GL on a window before it's been mapped, so don't log it like an error. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/winpriv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c index 4f6e4ffd5..9b4baf381 100644 --- a/hw/xwin/glx/winpriv.c +++ b/hw/xwin/glx/winpriv.c @@ -51,7 +51,7 @@ winGetWindowInfo(WindowPtr pWin) if (pWinPriv->hWnd == NULL) { winCreateWindowsWindow(pWin); - ErrorF("winGetWindowInfo: forcing window to exist...\n"); + winDebug("winGetWindowInfo: forcing window to exist\n"); } if (pWinPriv->hWnd != NULL) { From f92df22a037cb8b672dab2e7aef18a22275f5660 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 18 Jul 2014 15:08:17 +0100 Subject: [PATCH 10/10] hw/xwin/glx: Remove an incorrect assertion in glxWinDrawableSwapBuffers The piglit test glx_make_current triggers this assertion, by making the context current on a different drawable before issuing a glXSwapBuffers() Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/glx/indirect.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 70b9156cc..93cdb29d6 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -890,13 +890,6 @@ glxWinDrawableSwapBuffers(ClientPtr client, __GLXdrawable * base) ("glxWinSwapBuffers on drawable %p, last context %p (native ctx %p)", base, draw->drawContext, draw->drawContext->ctx); - /* - draw->drawContext->base.drawPriv will not be set if the context is not current anymore, - but if it is, it should point to this drawable.... - */ - assert((draw->drawContext->base.drawPriv == NULL) || - (draw->drawContext->base.drawPriv == base)); - dc = glxWinMakeDC(draw->drawContext, draw, &dc, &hwnd); if (dc == NULL) return GL_FALSE;