xserver: Branch 'master' - 7 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jun 28 10:39:45 PDT 2012


 configure.ac                   |    3 +-
 hw/xwin/glx/gen_gl_wrappers.py |   14 ++++++++++---
 hw/xwin/glx/indirect.c         |   44 +++++++++++++++++++++++++++--------------
 3 files changed, 42 insertions(+), 19 deletions(-)

New commits:
commit 8b4f0a4fdd6c15f49458bc3a8c3135b8c389240d
Merge: 59294a2... d642e71...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jun 28 10:38:26 2012 -0700

    Merge remote-tracking branch 'jturney/master'

commit d642e7128790ec6b709df8d1a91333ab87598077
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Thu Jun 21 20:01:49 2012 +0100

    configure.ac: link XWIN with GLX_SYS_LIBS
    
    Link XWIN with GLX_SYS_LIBS, just like all the other DDXs
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/configure.ac b/configure.ac
index fb3d120..7576dae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1879,8 +1879,9 @@ if test "x$XWIN" = xyes; then
 			XWIN_SYS_LIBS=-lws2_32
 			;;
 	esac
+
 	XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
-	XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
+	XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS"
 	AC_SUBST(XWIN_LIBS)
 	AC_SUBST(XWIN_SERVER_NAME)
 	AC_SUBST(XWIN_SYS_LIBS)
commit c9bbf8fe574591c8e191eeef20f8994781718772
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jun 21 19:38:55 2012 +0100

    hw/xwin/glx: Fix glxWinCreateContext() function pointer mismatch
    
    Fix glxWinCreateContext() function signature to align with commit 96d74138
    "glx: Extend __GLXscreen::createContext to take attributes", which added more
    parameters to the screen createContext function for implementing GLX_ARB_create_context
    
    indirect.c: In function 'glxWinScreenProbe':
    indirect.c:683:36: warning: assignment from incompatible pointer type
    
    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 0582569..3f34146 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -398,7 +398,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c)
 static __GLXscreen *glxWinScreenProbe(ScreenPtr pScreen);
 static __GLXcontext *glxWinCreateContext(__GLXscreen * screen,
                                          __GLXconfig * modes,
-                                         __GLXcontext * baseShareContext);
+                                         __GLXcontext * baseShareContext,
+                                         unsigned num_attribs,
+                                         const uint32_t * attribs, int *error);
 static __GLXdrawable *glxWinCreateDrawable(ClientPtr client,
                                            __GLXscreen * screen,
                                            DrawablePtr pDraw,
@@ -1582,7 +1584,8 @@ glxWinContextDestroy(__GLXcontext * base)
 
 static __GLXcontext *
 glxWinCreateContext(__GLXscreen * screen,
-                    __GLXconfig * modes, __GLXcontext * baseShareContext)
+                    __GLXconfig * modes, __GLXcontext * baseShareContext,
+                    unsigned num_attribs, const uint32_t * attribs, int *error)
 {
     __GLXWinContext *context;
     __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
commit 6e85660c7503c7e88e24003562444dffde6c88ff
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Mar 5 23:07:56 2012 +0000

    hw/xwin/glx: Update gen_gl_wrappers.py for the current glx/dispatch.h
    
    Fix the code generator for the dispatch table initialization after
    the whitespace/coding style changes to glx/dispatch.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/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index d86acc8..15f7ef8 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -67,7 +67,7 @@ if dispatchheader :
         fh = open(dispatchheader)
         dispatchh = fh.readlines()
 
-        dispatch_regex = re.compile(r'#define\sSET_(\S*)\(')
+        dispatch_regex = re.compile(r'^SET_(\S*)\(')
 
         for line in dispatchh :
                 line = line.strip()
commit cb638ed9c81f07d8603b07db395e31a41fed8685
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jun 21 18:55:57 2012 +0100

    hw/xwin/glx: Blacklist 'GDI generic' GL renderer
    
    If the native GL renderer is the GDI generic renderer (as can happen
    if we are in safe mode, or the video driver is VGA, or we have hybrid
    graphics which hasn't noticed that xwin requires 3d acceleration), don't
    use it.  It's not accelerated and we will probably get better conformance
    and perfomance from swrast.
    
    Fix so we don't install screen function wrappers in glxWinScreenProbe
    unless we are succesful.
    
    Also, move fbConfig dumping to after GLX version has been determined
    from extensions
    
    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 41b4cd8..0582569 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -517,6 +517,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
 {
     glxWinScreen *screen;
     const char *gl_extensions;
+    const char *gl_renderer;
     const char *wgl_extensions;
     HWND hwnd;
     HDC hdc;
@@ -540,14 +541,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
     if (NULL == screen)
         return NULL;
 
-    /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
-    screen->RealizeWindow = pScreen->RealizeWindow;
-    pScreen->RealizeWindow = glxWinRealizeWindow;
-    screen->UnrealizeWindow = pScreen->UnrealizeWindow;
-    pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
-    screen->CopyWindow = pScreen->CopyWindow;
-    pScreen->CopyWindow = glxWinCopyWindow;
-
     /* Dump out some useful information about the native renderer */
 
     // create window class
@@ -597,7 +590,8 @@ glxWinScreenProbe(ScreenPtr pScreen)
 
     ErrorF("GL_VERSION:     %s\n", glGetStringWrapperNonstatic(GL_VERSION));
     ErrorF("GL_VENDOR:      %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
-    ErrorF("GL_RENDERER:    %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
+    gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER);
+    ErrorF("GL_RENDERER:    %s\n", gl_renderer);
     gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS);
     glxLogExtensions("GL_EXTENSIONS:  ", gl_extensions);
     wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
@@ -605,6 +599,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
         wgl_extensions = "";
     glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
 
+    if (strcasecmp(gl_renderer, "GDI Generic") == 0) {
+        free(screen);
+        LogMessage(X_ERROR,
+                   "AIGLX: Won't use generic native renderer as it is not accelerated\n");
+        return NULL;
+    }
+
     // Can you see the problem here?  The extensions string is DC specific
     // Different DCs for windows on a multimonitor system driven by multiple cards
     // might have completely different capabilities.  Of course, good luck getting
@@ -722,9 +723,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
 
         __glXScreenInit(&screen->base, pScreen);
 
-        // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
-        fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
-
         // Override the GL extensions string set by __glXScreenInit()
         screen->base.GLextensions = strdup(gl_extensions);
 
@@ -767,6 +765,17 @@ glxWinScreenProbe(ScreenPtr pScreen)
     ReleaseDC(hwnd, hdc);
     DestroyWindow(hwnd);
 
+    // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
+    fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
+
+    /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
+    screen->RealizeWindow = pScreen->RealizeWindow;
+    pScreen->RealizeWindow = glxWinRealizeWindow;
+    screen->UnrealizeWindow = pScreen->UnrealizeWindow;
+    pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+    screen->CopyWindow = pScreen->CopyWindow;
+    pScreen->CopyWindow = glxWinCopyWindow;
+
     return &screen->base;
 }
 
commit 8c24d20933ba9c2ef0e9a81815c3be23fa896aea
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jun 21 18:05:24 2012 +0100

    hw/xwin/glx: Fix glxLogExtensions to handle a null string without crashing
    
    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 56f677a..41b4cd8 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -473,7 +473,7 @@ static void
 glxLogExtensions(const char *prefix, const char *extensions)
 {
     int length = 0;
-    char *strl;
+    const char *strl;
     char *str = strdup(extensions);
 
     if (str == NULL) {
@@ -482,6 +482,8 @@ glxLogExtensions(const char *prefix, const char *extensions)
     }
 
     strl = strtok(str, " ");
+    if (strl == NULL)
+        strl = "";
     ErrorF("%s%s", prefix, strl);
     length = strlen(prefix) + strlen(strl);
 
commit c08c7c8f655d7721c1e02bfeeb965b6379f72553
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jun 24 13:32:10 2011 +0100

    hw/xwin/glx: Create a new dispatch table rather than modifying the existing one
    
    Create a new dispatch table rather than modifying the existing one
    
    struct _glapi_table is not a complete type after including glapi.h, so we use
    glapi_get_dispatch_table_size() to determine it's size (alternatively, we could
    include glapitable.h, to complete the type)
    
    This could possibly be written to use _glapi_create_table_from_handle() instead, but
    that requires making all the wrapper functions exports
    
    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 e2d960e..d86acc8 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -308,12 +308,20 @@ for w in sorted(wrappers.keys()) :
 if dispatchheader :
         print 'void glWinSetupDispatchTable(void)'
         print '{'
-        print '  struct _glapi_table *disp = _glapi_get_dispatch();'
+        print '  static struct _glapi_table *disp = NULL;'
+        print ''
+        print '  if (!disp)'
+        print '    {'
+        print '      disp = calloc(sizeof(void *), _glapi_get_dispatch_table_size());'
+        print '      assert(disp);'
 
         for d in sorted(dispatch.keys()) :
                 if wrappers.has_key(d) :
-                        print '  SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);'
+                        print '      SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);'
                 else :
                         print '#warning  No wrapper for ' + prefix + d + ' !'
 
+        print '    }'
+        print ''
+        print '  _glapi_set_dispatch(disp);'
         print '}'


More information about the xorg-commit mailing list