[Xquartz-changes] xserver: Branch 'master' - 6 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Fri Apr 29 11:07:10 PDT 2011


 configure.ac                   |   25 ++++++++++++++++++++-----
 glx/Makefile.am                |    2 +-
 hw/xfree86/dixmods/Makefile.am |    2 +-
 hw/xquartz/applewmExt.h        |    6 +++---
 hw/xquartz/xpr/xprFrame.c      |   20 ++++++++++----------
 hw/xwin/glx/.gitignore         |    7 +------
 hw/xwin/glx/Makefile.am        |   34 +++++++---------------------------
 hw/xwin/glx/wgl_ext_api.c      |    2 +-
 hw/xwin/glx/wgl_ext_api.h      |    2 +-
 9 files changed, 45 insertions(+), 55 deletions(-)

New commits:
commit 0fc7ec6dd504aa03e1a1b18c60942c0c8c8b701b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 29 11:06:18 2011 -0700

    XQuartz: Fix incorrect typedefs with XPLUGIN_VERSION < 4
    
    Ok, this time for sure... how many brown bags can I fit over my face?
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/applewmExt.h b/hw/xquartz/applewmExt.h
index 35c8f8f..c46a7bd 100644
--- a/hw/xquartz/applewmExt.h
+++ b/hw/xquartz/applewmExt.h
@@ -35,9 +35,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <Xplugin.h>
 
 #if XPLUGIN_VERSION < 4
-typedef xp_frame_attr int;
-typedef xp_frame_class int;
-typedef xp_frame_rect int;
+typedef int xp_frame_attr;
+typedef int xp_frame_class;
+typedef int xp_frame_rect;
 #endif
 
 typedef int (*DisableUpdateProc)(void);
commit 29d471663e4414a3cdf154fd032d74381a921ae0
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Apr 23 18:09:11 2011 -0700

    XQuartz: Use a rwlock instead of a mutex to protect window_hash in the pthread case
    
    Concurrent reads are acceptable, so using an rwlock should be better.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 5f6b1cb..4818653 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -69,7 +69,7 @@ static x_hash_table *window_hash;
 #ifdef HAVE_LIBDISPATCH
 static dispatch_queue_t window_hash_serial_q;
 #else
-static pthread_mutex_t window_hash_mutex;
+static pthread_rwlock_t window_hash_rwlock;
 #endif
 
 /* Prototypes for static functions */
@@ -192,9 +192,9 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
         x_hash_table_insert(window_hash, pFrame->wid, pFrame);
     });
 #else
-    pthread_mutex_lock(&window_hash_mutex);
+    pthread_rwlock_wrlock(&window_hash_rwlock);
     x_hash_table_insert(window_hash, pFrame->wid, pFrame);
-    pthread_mutex_unlock(&window_hash_mutex);
+    pthread_rwlock_wrlock(&window_hash_rwlock);
 #endif
 
     xprSetNativeProperty(pFrame);
@@ -216,9 +216,9 @@ xprDestroyFrame(RootlessFrameID wid)
         x_hash_table_remove(window_hash, wid);
     });
 #else
-    pthread_mutex_lock(&window_hash_mutex);
+    pthread_rwlock_wrlock(&window_hash_rwlock);
     x_hash_table_remove(window_hash, wid);
-    pthread_mutex_unlock(&window_hash_mutex);
+    pthread_rwlock_unlock(&window_hash_rwlock);
 #endif
 
     err = xp_destroy_window(x_cvt_vptr_to_uint(wid));
@@ -292,9 +292,9 @@ static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) {
         winRec = x_hash_table_lookup(window_hash, wid, NULL);
     });
 #else
-    pthread_mutex_lock(&window_hash_mutex);
+    pthread_rwlock_rdlock(&window_hash_rwlock);
     winRec = x_hash_table_lookup(window_hash, wid, NULL);
-    pthread_mutex_unlock(&window_hash_mutex);
+    pthread_rwlock_unlock(&window_hash_rwlock);
 #endif
     
     if(winRec) {
@@ -479,7 +479,7 @@ xprInit(ScreenPtr pScreen)
 #ifdef HAVE_LIBDISPATCH
     assert((window_hash_serial_q = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.xpr_window_hash", NULL)));
 #else
-    assert(0 == pthread_mutex_init(&window_hash_mutex, NULL));
+    assert(0 == pthread_rwlock_init(&window_hash_rwlock, NULL));
 #endif
     
     return TRUE;
@@ -500,9 +500,9 @@ xprGetXWindow(xp_window_id wid)
     });
 #else
     RootlessWindowRec *winRec;
-    pthread_mutex_lock(&window_hash_mutex);
+    pthread_rwlock_rdlock(&window_hash_rwlock);
     winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr(wid), NULL);
-    pthread_mutex_unlock(&window_hash_mutex);
+    pthread_rwlock_unlock(&window_hash_rwlock);
 #endif
 
     return winRec != NULL ? winRec->win : NULL;
commit 5cb31cd0cbf83fff5f17a475e7b0e45246b19bf3
Merge: 0f284f0... 4d8735d...
Author: Keith Packard <keithp at keithp.com>
Date:   Fri Apr 29 09:59:49 2011 -0700

    Merge remote-tracking branch 'jturney/remove-opengl-spec-download'

commit 4d8735d388c3c6af27ef3d6a645e38e556f392f4
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Apr 6 16:26:45 2011 +0100

    hw/xwin: wglext.h should be provided by w32api, rather than downloaded
    
    wglext.h should be provided by the w32api package, rather than downloaded.
    if it's not, do 'wget -P /usr/include/w32api/GL http://www.opengl.org/registry/api/wglext.h'
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore
index 20d1c1e..062fd85 100644
--- a/hw/xwin/glx/.gitignore
+++ b/hw/xwin/glx/.gitignore
@@ -1,4 +1,3 @@
-# ignore downloaded and generated files
+# ignore generated files
 generated_gl_wrappers.c
 generated_wgl_wrappers.c
-wglext.h
diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index 499e3cb..cdcba35 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -26,6 +26,7 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             -I$(top_srcdir)/hw/xwin/
 
 if XWIN_GLX_WINDOWS
+
 generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm
 	$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
 
@@ -33,11 +34,7 @@ generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(K
 	$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
 endif
 
-wglext.h:
-	wget http://www.opengl.org/registry/api/wglext.h
-
 BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c
 CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = wglext.h
 
-EXTRA_DIST = gen_gl_wrappers.py wglext.h
+EXTRA_DIST = gen_gl_wrappers.py
diff --git a/hw/xwin/glx/wgl_ext_api.c b/hw/xwin/glx/wgl_ext_api.c
index 4b8359f..1020916 100644
--- a/hw/xwin/glx/wgl_ext_api.c
+++ b/hw/xwin/glx/wgl_ext_api.c
@@ -35,7 +35,7 @@
 #include <GL/glext.h>
 #include <glx/glxserver.h>
 #include <glx/glxext.h>
-#include "wglext.h"
+#include <GL/wglext.h>
 #include <wgl_ext_api.h>
 #include "glwindows.h"
 
diff --git a/hw/xwin/glx/wgl_ext_api.h b/hw/xwin/glx/wgl_ext_api.h
index e4462ac..77efd70 100644
--- a/hw/xwin/glx/wgl_ext_api.h
+++ b/hw/xwin/glx/wgl_ext_api.h
@@ -29,7 +29,7 @@
 #ifndef wgl_ext_api_h
 #define wgl_ext_api_h
 
-#include "wglext.h"
+#include <GL/wglext.h>
 
 void wglResolveExtensionProcs(void);
 
commit a50878682cda541766c830e49ab406c78b38d903
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Apr 6 16:23:45 2011 +0100

    configure: Look for Khronos OpenGL spec files using pkg-config
    
    Look for Khronos OpenGL spec files using pkg-config, rather than downloading them
    
    Also add a --with-khronos-spec-dir=PATH configure option so XWin can be directed
    where to find these files without using the khronos-spec-files package
    
    XWin with AIGLX requires OpenGL spec files in order to generate wrapper code which:
    (1) thunks from the glapi dispatch table which uses the default cdecl calling convention
    to native GL functions using the stdcall calling convention.
    (2) performs function address lookup for OpenGL 1.2+ functions, which are treated
    as extensions and so not directly linkable.
    
    v2: KHRONOS_SPEC_DIR is only valid when XWIN_GLX_WINDOWS is defined. Avoid 'make dist'
    seeing invalid dependencies by only including rules using KHRONOS_SPEC_DIR if
    XWIN_GLX_WINDOWS is defined
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

diff --git a/configure.ac b/configure.ac
index 30701b0..df2f9b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -598,6 +598,9 @@ AC_ARG_ENABLE(glx-tls,        AS_HELP_STRING([--enable-glx-tls], [Build GLX with
                                    GLX_USE_TLS=yes
                                  fi])
 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
+AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]),
+				[KHRONOS_SPEC_DIR="${withval}"],
+				[KHRONOS_SPEC_DIR=auto])
 
 dnl Extensions.
 AC_ARG_ENABLE(registry,       AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
@@ -1854,6 +1857,16 @@ if test "x$XWIN" = xyes; then
 
 	AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
 	AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
+
+dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions
+	if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then
+           if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then
+		PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry])
+		KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir`
+           fi
+           AC_SUBST(KHRONOS_SPEC_DIR)
+	fi
+
 fi
 AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore
index e7c7617..20d1c1e 100644
--- a/hw/xwin/glx/.gitignore
+++ b/hw/xwin/glx/.gitignore
@@ -1,8 +1,4 @@
 # ignore downloaded and generated files
 generated_gl_wrappers.c
 generated_wgl_wrappers.c
-gl.spec
-gl.tm
-wgl.tm
-wglext.spec
 wglext.h
diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index 303ff53..499e3cb 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -25,36 +25,19 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             -I$(top_srcdir) \
             -I$(top_srcdir)/hw/xwin/
 
-glwrap.c: generated_gl_wrappers.c
-wgl_ext_api.c: generated_wgl_wrappers.c wglext.h
-wgl_ext_api.h: wglext.h
-indirect.c: wgl_ext_api.h
+if XWIN_GLX_WINDOWS
+generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm
+	$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
 
-SPEC_FILES = gl.spec gl.tm wglext.spec wgl.tm
-
-gl.spec:
-	wget http://www.opengl.org/registry/api/gl.spec
-
-gl.tm:
-	wget http://www.opengl.org/registry/api/gl.tm
-
-wglext.spec:
-	wget http://www.opengl.org/registry/api/wglext.spec
-
-wgl.tm:
-	wget http://www.opengl.org/registry/api/wgl.tm
-
-generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm
-	$(srcdir)/gen_gl_wrappers.py --spec=`test -e gl.spec || echo $(srcdir)/`gl.spec --typemap=`test -e gl.tm || echo $(srcdir)/`gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c
-
-generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm
-	$(srcdir)/gen_gl_wrappers.py --spec=`test -e wglext.spec || echo $(srcdir)/`wglext.spec --typemap=`test -e wgl.tm || echo $(srcdir)/`wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
+generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm
+	$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
+endif
 
 wglext.h:
 	wget http://www.opengl.org/registry/api/wglext.h
 
 BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c
 CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = $(SPEC_FILES) wglext.h
+DISTCLEANFILES = wglext.h
 
-EXTRA_DIST = gen_gl_wrappers.py $(SPEC_FILES) wglext.h
+EXTRA_DIST = gen_gl_wrappers.py wglext.h
commit c5a612fc18a7f5c542fca580494e2c66ecfc2159
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Apr 16 21:55:01 2010 +0100

    configure: Let configure --enable/disable-aiglx control building of AIGLX for all DDXs
    
    Let configure --enable/disable-aiglx control building of AIGLX for all DDXs. Currently
    we can't use --enable/disable-aiglx to control if Xwin DDX is built with AIGLX enabled,
    as at the moment it's forced off if we aren't building the X.Org DDX DRI or DRI2 loader
    
    Rearrange things a bit, introducing a new automake conditional, AIGLX_DRI_LOADER to
    specifically indicate if the X.Org DDX DRI/DRI2 loader convenience library should be
    built, and replace the previous X.Org DDX-specific uses of the AIGLX conditional with that
    
    As before, AIGLX_DRI_LOADER is only enabled if --enable-glx, --enable-aiglx and at least one
    of --enable-dri or --enable-dri2 are enabled
    
    This allows the general conditional AIGLX to control if AIGLX is built for the XWin DDX as
    well
    
    The C #define AIGLX set by AC_DEFINE(AIGLX) seems to be obsolete, I can't find anything
    which checks it
    
    Updated for ajax's "glx: Make --disable-dri not disable AIGLX" patch, which allows DRI2
    to be enabled independently of DRI1
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

diff --git a/configure.ac b/configure.ac
index 56e51a4..30701b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1008,12 +1008,14 @@ else
 fi
 AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
 
-if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a \( "x$DRI" = xyes -o "x$DRI2" = xyes \); then
+if test "x$GLX" = xno; then
+        AIGLX=no
+fi
+
+if test "x$AIGLX" = xyes -a \( "x$DRI" = xyes -o "x$DRI2" = xyes \); then
 	AC_DEFINE(AIGLX, 1, [Build AIGLX loader])
-else
-	AIGLX=no
 fi
-AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes)
+AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI" = xyes || test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes)
 
 if test "x$GLX_USE_TLS" = xyes ; then
 	GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
@@ -1857,7 +1859,7 @@ AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
 AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
-AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false])
+AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes])
 AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
diff --git a/glx/Makefile.am b/glx/Makefile.am
index ef8677a..5f74ab8 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -1,4 +1,4 @@
-if AIGLX
+if AIGLX_DRI_LOADER
 GLXDRI_LIBRARY = libglxdri.la
 endif
 
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 365f006..1a162ab 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -45,7 +45,7 @@ libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c
 libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
 
 libglx_la_LDFLAGS = -avoid-version
-if AIGLX
+if AIGLX_DRI_LOADER
 GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la
 endif
 libglx_la_LIBADD = \


More information about the Xquartz-changes mailing list