xserver: Branch 'master' - 11 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Sep 11 18:27:50 PDT 2014


 hw/xwin/Makefile.am            |   33 ++++++++++++++++-----
 hw/xwin/glx/.gitignore         |    5 ++-
 hw/xwin/glx/gen_gl_wrappers.py |   13 +++++---
 hw/xwin/glx/glwindows.h        |    5 +++
 hw/xwin/glx/indirect.c         |   19 +-----------
 hw/xwin/glx/winpriv.c          |    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 ++---
 hw/xwin/winshadddnl.c          |    4 ++
 13 files changed, 160 insertions(+), 39 deletions(-)

New commits:
commit 54a1d4db825be90fb7be138e3267a15922d62f03
Merge: 8f8dcfe f92df22
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Sep 11 18:27:41 2014 -0700

    Merge remote-tracking branch 'jturney/master'

commit f92df22a037cb8b672dab2e7aef18a22275f5660
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jul 18 15:08:17 2014 +0100

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 70b9156..93cdb29 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;
commit b21321e515fc778f87077b7ce47922c43a4ba103
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jul 14 19:41:25 2014 +0100

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index 4f6e4ff..9b4baf3 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) {
commit 31d089633683ea2a2716651c3c48e1456cc595bf
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Jul 16 13:44:33 2014 +0100

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 6c03033..70b9156 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)
commit b1ea714cdce8444c6ad7778dae04e35c6bcc1750
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Apr 27 22:10:31 2014 +0100

    hw/xwin/glx: Update .gitignore
    
    Update to align with rewrite of wrapper generation script in commit
    583a1146233f16d861706926706e5feec3baffba
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore
index 062fd85..9684410 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
commit d1d3bd359670a8f55c9350fd905af32ba6e67d33
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Mar 30 20:51:36 2014 +0100

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 9bfaac0..6c03033 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 =
commit c99cd058a89bbfc9ceab3c91b93451f70351ddce
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue Mar 4 22:37:13 2014 +0000

    hw/xwin: Add an idempotency guard to glwindows.h
    
    Add an idempotency guard to glwindows.h
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/glwindows.h b/hw/xwin/glx/glwindows.h
index 4f859b4..34ff24c 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 <GL/gl.h>
 
 typedef struct {
@@ -53,3 +56,5 @@ int glWinSelectImplementation(int native);
 #define GLWIN_TRACE_MSG(a, ...)
 #define GLWIN_DEBUG_MSG(a, ...)
 #endif
+
+#endif
commit 1c34e774eff6c5a22501833444a10440cf3f915a
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Nov 11 15:09:18 2013 +0000

    hw/xwin: Fix a potential crash in winRedrawScreenShadowDDNL()
    
    Seen during shutdown when using '-fullscreen' and '-depth 8'
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 55af5c3..cb326dc 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;
commit 16d9da08861fe504de4be8c31708592e30687156
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Feb 18 23:36:27 2010 -0600

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 5908dfc..326ffa0 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 33595be..e708960 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -38,6 +38,7 @@
 #include <sys/types.h>
 #include <signal.h>
 #include "winclipboard.h"
+#include "windisplay.h"
 #ifdef __CYGWIN__
 #include <errno.h>
 #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 0000000..17f0c77
--- /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 <xwin-config.h>
+#endif
+
+#include <opaque.h>             // for display
+#include "windisplay.h"
+#include "winmsg.h"
+
+#define XSERV_t
+#define TRANS_SERVER
+#include <X11/Xtrans/Xtrans.h>
+
+/*
+  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 0000000..d1d4549
--- /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 b638f2c..6c96c40 100644
--- a/hw/xwin/winmsg.h
+++ b/hw/xwin/winmsg.h
@@ -30,6 +30,8 @@
  * Authors: Alexander Gottwald	
  */
 
+#include <X11/Xwindows.h>
+
 /*
  * Function prototypes
  */
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 618e381..e17a950 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 <X11/extensions/windowswmstr.h>
@@ -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 f386fac..53abc16 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -44,6 +44,7 @@
 #include <shellapi.h>
 
 #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) {
commit 95357539c1178a97d8a167461806a280d2803ec4
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Jan 1 20:34:36 2014 +0000

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 4ee9632..5908dfc 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)
 
 
commit aa40d0c07173209a2c13b332f1168e0df499a19e
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jun 13 16:16:51 2014 +0100

    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 <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index cdbba63..69ab1ef 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):


More information about the xorg-commit mailing list