[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libglvnd: Changes to 'debian-unstable'



 .gitignore                                       |   43 
 Makefile.am                                      |    8 
 README.md                                        |    5 
 autogen.sh                                       | 1582 -------------
 bin/.gitignore                                   |    8 
 configure.ac                                     |   97 
 debian/changelog                                 |    2 
 debian/control                                   |   46 
 debian/libglx-dummy-dev.install                  |    2 
 debian/libglx-dummy0.install                     |    1 
 debian/libx11glvnd-dev.install                   |    1 
 debian/libx11glvnd0.install                      |    1 
 debian/rules                                     |    5 
 include/GL/gl_mangle.h                           | 2311 -------------------
 include/GL/glx_mangle.h                          |   82 
 include/GL/glxmd.h                               |   54 
 include/GL/glxproto.h                            | 2722 -----------------------
 include/GL/internal/dri_interface.h              | 1187 ----------
 include/GL/internal/sarea.h                      |   92 
 include/GL/osmesa.h                              |  283 --
 include/GL/wglext.h                              |  901 -------
 include/GL/wmesa.h                               |  140 -
 include/Makefile.am                              |    7 
 include/glvnd/GLdispatchABI.h                    |  120 +
 include/glvnd/libglxabi.h                        |  445 +++
 include/lkdhash.h                                |   41 
 include/main/glheader.h                          |    1 
 libglvnd.pc.in                                   |    8 
 m4/.gitignore                                    |    5 
 src/GL/.gitignore                                |    2 
 src/GL/Makefile.am                               |   10 
 src/GLESv1/.gitignore                            |    2 
 src/GLESv2/.gitignore                            |    2 
 src/GLX/.gitignore                               |    1 
 src/GLX/Makefile.am                              |   15 
 src/GLX/libglx.c                                 |  662 +++--
 src/GLX/libglxabi.h                              |  334 --
 src/GLX/libglxabipriv.h                          |    2 
 src/GLX/libglxcurrent.h                          |   62 
 src/GLX/libglxmapping.c                          |  607 ++---
 src/GLX/libglxmapping.h                          |   40 
 src/GLX/libglxproto.c                            |  173 +
 src/GLX/libglxproto.h                            |   71 
 src/GLX/libglxthread.h                           |    4 
 src/GLdispatch/GLdispatch.c                      |  122 -
 src/GLdispatch/GLdispatch.h                      |  179 +
 src/GLdispatch/GLdispatchABI.h                   |  147 -
 src/GLdispatch/GLdispatchPrivate.h               |   19 
 src/GLdispatch/Makefile.am                       |    9 
 src/GLdispatch/export_list.sym                   |    2 
 src/GLdispatch/vnd-glapi/.gitignore              |    3 
 src/GLdispatch/vnd-glapi/mapi/entry.h            |   10 
 src/GLdispatch/vnd-glapi/mapi/entry_armv7_tsd.c  |    5 
 src/GLdispatch/vnd-glapi/mapi/entry_pure_c.c     |    3 
 src/GLdispatch/vnd-glapi/mapi/entry_x86_64_tls.c |    5 
 src/GLdispatch/vnd-glapi/mapi/entry_x86_64_tsd.c |   21 
 src/GLdispatch/vnd-glapi/mapi/entry_x86_tsd.c    |    5 
 src/GLdispatch/vnd-glapi/mapi/table.c            |   11 
 src/GLdispatch/vnd-glapi/mapi/u_current_tls.c    |    1 
 src/GLdispatch/vnd-glapi/mapi/u_current_tsd.c    |   13 
 src/GLdispatch/vnd-glapi/mapi/u_execmem.c        |    8 
 src/GLdispatch/vnd-glapi/mapi/u_thread.h         |   72 
 src/Makefile.am                                  |    4 
 src/OpenGL/.gitignore                            |    2 
 src/OpenGL/entrypoint_common.mk                  |    9 
 src/arch/sparc/norm.S                            |  605 -----
 src/arch/sparc/sparc.c                           |  142 -
 src/arch/sparc/sparc.h                           |   36 
 src/arch/sparc/sparc_clip.S                      |  233 -
 src/arch/sparc/sparc_matrix.h                    |  170 -
 src/arch/sparc/xform.S                           | 1392 -----------
 src/arch/x86-64/Makefile.am                      |   40 
 src/arch/x86-64/calling_convention.txt           |   50 
 src/arch/x86-64/x86-64.c                         |  119 -
 src/arch/x86-64/x86-64.h                         |   31 
 src/arch/x86-64/xform4.S                         |  483 ----
 src/arch/x86/3dnow.c                             |   91 
 src/arch/x86/3dnow.h                             |   36 
 src/arch/x86/3dnow_normal.S                      |  852 -------
 src/arch/x86/3dnow_xform1.S                      |  437 ---
 src/arch/x86/3dnow_xform2.S                      |  477 ----
 src/arch/x86/3dnow_xform3.S                      |  561 ----
 src/arch/x86/3dnow_xform4.S                      |  570 ----
 src/arch/x86/Makefile.am                         |   40 
 src/arch/x86/assyntax.h                          | 1747 --------------
 src/arch/x86/clip_args.h                         |   59 
 src/arch/x86/common_x86.c                        |  336 --
 src/arch/x86/common_x86_asm.S                    |  220 -
 src/arch/x86/common_x86_asm.h                    |   53 
 src/arch/x86/common_x86_features.h               |   67 
 src/arch/x86/gen_matypes.c                       |  240 --
 src/arch/x86/mmx.h                               |   59 
 src/arch/x86/mmx_blend.S                         |  402 ---
 src/arch/x86/mmx_blendtmp.h                      |  114 
 src/arch/x86/norm_args.h                         |   57 
 src/arch/x86/read_rgba_span_x86.S                |  686 -----
 src/arch/x86/read_rgba_span_x86.h                |   56 
 src/arch/x86/rtasm/x86sse.c                      | 1203 ----------
 src/arch/x86/rtasm/x86sse.h                      |  256 --
 src/arch/x86/sse.c                               |  123 -
 src/arch/x86/sse.h                               |   36 
 src/arch/x86/sse_normal.S                        |  261 --
 src/arch/x86/sse_xform1.S                        |  446 ---
 src/arch/x86/sse_xform2.S                        |  466 ---
 src/arch/x86/sse_xform3.S                        |  512 ----
 src/arch/x86/sse_xform4.S                        |  235 -
 src/arch/x86/x86_cliptest.S                      |  407 ---
 src/arch/x86/x86_xform.c                         |  126 -
 src/arch/x86/x86_xform.h                         |  106 
 src/arch/x86/x86_xform2.S                        |  574 ----
 src/arch/x86/x86_xform3.S                        |  644 -----
 src/arch/x86/x86_xform4.S                        |  677 -----
 src/arch/x86/xform_args.h                        |   51 
 src/generate/gl_inittable.py                     |    2 
 src/generate/glvnd_gen.mk                        |   10 
 src/util/Makefile.am                             |    9 
 src/util/app_error_check.c                       |   81 
 src/util/app_error_check.h                       |   79 
 src/util/glvnd_pthread.c                         |  465 +++
 src/util/glvnd_pthread.h                         |  160 +
 src/util/glvnd_pthread/Makefile.am               |   37 
 src/util/glvnd_pthread/glvnd_pthread.c           |  458 ---
 src/util/glvnd_pthread/glvnd_pthread.h           |  157 -
 src/x11glvnd/Makefile.am                         |   59 
 src/x11glvnd/x11glvnd.h                          |   95 
 src/x11glvnd/x11glvndclient.c                    |  263 --
 src/x11glvnd/x11glvndproto.h                     |  136 -
 src/x11glvnd/x11glvndserver.c                    |  552 ----
 src/x11glvnd/x11glvndserver.h                    |   55 
 tests/.gitignore                                 |    8 
 tests/GLX_dummy/GLX_dummy.c                      |   99 
 tests/Makefile.am                                |   44 
 tests/testglxmakecurrent.c                       |   10 
 tests/testglxnscreens.c                          |   10 
 134 files changed, 2754 insertions(+), 29456 deletions(-)

New commits:
commit c8607b52ea62b1b14487247ba1167e1369283a12
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Apr 1 01:15:31 2016 +0300

    purge libglx-dummy* libx11glvnd*, obsolete

diff --git a/debian/control b/debian/control
index 206cc38..cd6d9ea 100644
--- a/debian/control
+++ b/debian/control
@@ -62,29 +62,6 @@ Description: Vendor neutral GL dispatch library -- libGLX
  .
  This package contains the libGLX shared library.
 
-Package: libglx-dummy-dev
-Section: libdevel
-Architecture: any
-Depends: ${misc:Depends},
- libglx-dummy0 (= ${binary:Version}),
-Description: Vendor neutral GL dispatch library -- libGLX-dummy development files
- This is an implementation of the vendor-neutral dispatch layer for
- arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
- .
- This package contains the development files for libGLX-dummy.
-
-Package: libglx-dummy0
-Section: libs
-Architecture: any
-Pre-Depends: ${misc:Pre-Depends},
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Multi-Arch: same
-Description: Vendor neutral GL dispatch library -- libGLX-dummy
- This is an implementation of the vendor-neutral dispatch layer for
- arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
- .
- This package contains the libGLX-dummy shared library.
-
 Package: libgldispatch-dev
 Section: libdevel
 Architecture: any
@@ -130,26 +107,3 @@ Description: Vendor neutral GL dispatch library -- libOpenGL
  arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
  .
  This package contains the libOpenGL shared library.
-
-Package: libx11glvnd-dev
-Section: libdevel
-Architecture: any
-Depends: ${misc:Depends},
- libx11glvnd0 (= ${binary:Version}),
-Description: Vendor neutral GL dispatch library -- libx11glvnd development files
- This is an implementation of the vendor-neutral dispatch layer for
- arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
- .
- This package contains the development files for libx11glvnd.
-
-Package: libx11glvnd0
-Section: libs
-Architecture: any
-Pre-Depends: ${misc:Pre-Depends},
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Multi-Arch: same
-Description: Vendor neutral GL dispatch library -- libx11glvnd
- This is an implementation of the vendor-neutral dispatch layer for
- arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
- .
- This package contains the libx11glvnd shared library.
diff --git a/debian/libglx-dummy-dev.install b/debian/libglx-dummy-dev.install
deleted file mode 100644
index 02565c4..0000000
--- a/debian/libglx-dummy-dev.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/*/libGLX_dummy.a
-usr/lib/*/libGLX_dummy.so
diff --git a/debian/libglx-dummy0.install b/debian/libglx-dummy0.install
deleted file mode 100644
index d09cf2b..0000000
--- a/debian/libglx-dummy0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/libGLX_dummy.so.*
diff --git a/debian/libx11glvnd-dev.install b/debian/libx11glvnd-dev.install
deleted file mode 100644
index 1f710ed..0000000
--- a/debian/libx11glvnd-dev.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/libx11glvnd.so
diff --git a/debian/libx11glvnd0.install b/debian/libx11glvnd0.install
deleted file mode 100644
index 705c679..0000000
--- a/debian/libx11glvnd0.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/libx11glvnd.so.*

commit d6c9567d370c1b48a39244006d3cbe07ea537514
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Apr 1 01:13:56 2016 +0300

    disable tests, need X

diff --git a/debian/rules b/debian/rules
index 0c41198..e50c073 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,5 +7,8 @@ override_dh_install:
 	find debian/tmp -name '*.la' -delete
 	dh_install --fail-missing
 
+# needs X
+override_dh_auto_test:
+
 %:
 	dh $@ --parallel --with autoreconf,xsf --builddirectory=build/

commit 438c21f0989005d1c47ff7b901d2cbea5bfa00a1
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Apr 1 01:13:32 2016 +0300

    enable parallel builds

diff --git a/debian/rules b/debian/rules
index e69b6c0..0c41198 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,4 +8,4 @@ override_dh_install:
 	dh_install --fail-missing
 
 %:
-	dh $@ --with autoreconf,xsf --builddirectory=build/
+	dh $@ --parallel --with autoreconf,xsf --builddirectory=build/

commit e93c91c273b375f33ffc89f71c2e2e7516c947fa
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Fri Apr 1 01:13:14 2016 +0300

    bump version

diff --git a/debian/changelog b/debian/changelog
index f4537fb..419efb6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libglvnd (0.0.0-1) unstable; urgency=low
+libglvnd (0.1.0~git20160330-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #nnnn)
 

commit c5bcda3b848fe52d6ae6ef25c917431c06d62d27
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Wed Mar 30 16:39:13 2016 -0600

    GLX: Fix the version number macros.
    
    Fix the reversed GLX_VENDOR_ABI_GET_MAJOR_VERSION and
    GLX_VENDOR_ABI_GET_MINOR_VERSION macros.
    
    Add individual #defines for libglvnd's major and minor version for better
    readability.

diff --git a/include/glvnd/libglxabi.h b/include/glvnd/libglxabi.h
index b664e76..c718c5d 100644
--- a/include/glvnd/libglxabi.h
+++ b/include/glvnd/libglxabi.h
@@ -99,9 +99,17 @@ extern "C" {
  * number is incremented when there's a change but existing vendor libraries
  * will still work.
  */
-#define GLX_VENDOR_ABI_VERSION ((1 << 16) | 0)
-#define GLX_VENDOR_ABI_GET_MAJOR_VERSION(version) ((version) & 0xFFFF)
-#define GLX_VENDOR_ABI_GET_MINOR_VERSION(version) ((version) >> 16)
+#define GLX_VENDOR_ABI_MAJOR_VERSION ((uint32_t) 1)
+#define GLX_VENDOR_ABI_MINOR_VERSION ((uint32_t) 0)
+#define GLX_VENDOR_ABI_VERSION ((GLX_VENDOR_ABI_MAJOR_VERSION << 16) | GLX_VENDOR_ABI_MINOR_VERSION)
+static inline uint32_t GLX_VENDOR_ABI_GET_MAJOR_VERSION(uint32_t version)
+{
+    return version >> 16;
+}
+static inline uint32_t GLX_VENDOR_ABI_GET_MINOR_VERSION(uint32_t version)
+{
+    return version & 0xFFFF;
+}
 
 
 /*!
diff --git a/tests/GLX_dummy/GLX_dummy.c b/tests/GLX_dummy/GLX_dummy.c
index 29465c9..c11a563 100644
--- a/tests/GLX_dummy/GLX_dummy.c
+++ b/tests/GLX_dummy/GLX_dummy.c
@@ -672,9 +672,9 @@ PUBLIC Bool __glx_Main(uint32_t version,
                                   __GLXapiImports *imports)
 {
     if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version)
-            == GLX_VENDOR_ABI_GET_MAJOR_VERSION(GLX_VENDOR_ABI_VERSION)) {
+            == GLX_VENDOR_ABI_MAJOR_VERSION) {
         if (GLX_VENDOR_ABI_GET_MINOR_VERSION(version)
-                >= GLX_VENDOR_ABI_GET_MINOR_VERSION(GLX_VENDOR_ABI_VERSION)) {
+                >= GLX_VENDOR_ABI_MINOR_VERSION) {
             apiExports = exports;
 
             imports->isScreenSupported = dummyCheckSupportsScreen;

commit e2d44985d82380fa27f1910ed59a609bb9a1a160
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Tue Mar 22 10:42:19 2016 -0600

    Add support for reporting application errors.
    
    The libglvnd libraries will now check for a new environment variable,
    __GLVND_APP_ERROR_CHECKING. If it's set to a non-zero value, then libglvnd will
    check for and report some application errors.
    
    Many non-libglvnd implementations of libGL.so have been fairly tolerant of
    certain application bugs. Libglvnd has to be similarly tolerant to support
    existing apps that the developers can't or won't fix.
    
    The new __GLVND_APP_ERROR_CHECKING provides a way to check for some of those
    errors, so that hopefully there will be fewer broken apps in the future.
    
    In addition to the setting itself, this updates the no-op stubs in
    libGLdispatch to report an error when the app tries to call an OpenGL function
    without a current context. Later changes will likely add other error checks.

diff --git a/src/GLdispatch/GLdispatch.c b/src/GLdispatch/GLdispatch.c
index aa0b64d..be2f61a 100644
--- a/src/GLdispatch/GLdispatch.c
+++ b/src/GLdispatch/GLdispatch.c
@@ -37,6 +37,7 @@
 #include "GLdispatchPrivate.h"
 #include "stub.h"
 #include "glvnd_pthread.h"
+#include "app_error_check.h"
 
 /*
  * Global current dispatch table list. We need this to fix up all current
@@ -193,6 +194,7 @@ void _init(void)
     // Here, we only initialize the pthreads imports. Everything else we'll
     // deal with in __glDispatchInit.
     glvndSetupPthreads();
+    glvndAppErrorCheckInit();
 }
 
 void __glDispatchInit(void)
@@ -414,6 +416,11 @@ static inline int PatchingIsDisabledByEnvVar(void)
         char *disallowPatchStr = getenv("__GLVND_DISALLOW_PATCHING");
         if (disallowPatchStr) {
             disallowPatch = atoi(disallowPatchStr);
+        } else if (glvndAppErrorCheckGetEnabled()) {
+            // Entrypoint rewriting means skipping the dispatch table in
+            // libGLdispatch, which would disable checking for calling OpenGL
+            // functions without a context.
+            disallowPatch = GL_TRUE;
         }
         inited = GL_TRUE;
     }
diff --git a/src/GLdispatch/Makefile.am b/src/GLdispatch/Makefile.am
index 9109d35..b26769d 100644
--- a/src/GLdispatch/Makefile.am
+++ b/src/GLdispatch/Makefile.am
@@ -47,6 +47,7 @@ libGLdispatch_la_LDFLAGS += \
 
 libGLdispatch_la_SOURCES = \
 	$(top_srcdir)/src/util/glvnd_pthread.c \
+	$(top_srcdir)/src/util/app_error_check.c \
 	GLdispatch.c
 
 libGLdispatch_la_LIBADD = vnd-glapi/libglapi.la
diff --git a/src/GLdispatch/vnd-glapi/mapi/table.c b/src/GLdispatch/vnd-glapi/mapi/table.c
index 0d28666..3c7d926 100644
--- a/src/GLdispatch/vnd-glapi/mapi/table.c
+++ b/src/GLdispatch/vnd-glapi/mapi/table.c
@@ -29,23 +29,18 @@
 #include <stdio.h>
 
 #include "table.h"
+#include "app_error_check.h"
 
 static void
 noop_warn(const char *name)
 {
-   static int debug = -1;
-   
-   if (debug < 0)
-      debug = (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG"));
-
-   if (debug)
-      fprintf(stderr, "%s is no-op\n", name);
+    glvndAppErrorCheckReportError("%s called without a current context\n", name);
 }
 
 static int
 noop_generic(void)
 {
-   noop_warn("function");
+   noop_warn("OpenGL function");
    return 0;
 }
 
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index bb814f5..d4a5432 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -2,6 +2,7 @@ SUBDIRS = trace
 noinst_HEADERS = \
 	glvnd_genentry.h \
 	utils_misc.h \
-	glvnd_pthread.h
+	glvnd_pthread.h \
+	app_error_check.h
 
 EXTRA_DIST = uthash
diff --git a/src/util/app_error_check.c b/src/util/app_error_check.c
new file mode 100644
index 0000000..53318cd
--- /dev/null
+++ b/src/util/app_error_check.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * unaltered in all copies or substantial portions of the Materials.
+ * Any additions, deletions, or changes to the original source files
+ * must be clearly indicated in accompanying documentation.
+ *
+ * If only executable code is distributed, then the accompanying
+ * documentation must state that "this software is based in part on the
+ * work of the Khronos Group."
+ *
+ * THE MATERIALS ARE 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
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ */
+
+#include "app_error_check.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int errorCheckingEnabled = 0;
+static int reportAppErrorsEnabled = 0;
+static int abortOnAppError = 0;
+
+void glvndAppErrorCheckInit(void)
+{
+    const char *env;
+
+    env = getenv("__GLVND_APP_ERROR_CHECKING");
+    if (env != NULL) {
+        errorCheckingEnabled = (atoi(env) != 0 ? 1 : 0);
+        if (errorCheckingEnabled) {
+            reportAppErrorsEnabled = 1;
+            abortOnAppError = 1;
+        }
+    }
+
+    env = getenv("__GLVND_ABORT_ON_APP_ERROR");
+    if (env != NULL) {
+        abortOnAppError = (atoi(env) != 0 ? 1 : 0);
+        if (abortOnAppError) {
+            reportAppErrorsEnabled = 1;
+        }
+    }
+}
+
+void glvndAppErrorCheckReportError(const char *format, ...)
+{
+    if (reportAppErrorsEnabled) {
+        va_list args;
+        va_start(args, format);
+        vfprintf(stderr, format, args);
+        va_end(args);
+        fflush(stderr);
+
+        if (abortOnAppError) {
+            abort();
+        }
+    }
+}
+
+int glvndAppErrorCheckGetEnabled(void)
+{
+    return errorCheckingEnabled;
+}
+
diff --git a/src/util/app_error_check.h b/src/util/app_error_check.h
new file mode 100644
index 0000000..cb75b3e
--- /dev/null
+++ b/src/util/app_error_check.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * unaltered in all copies or substantial portions of the Materials.
+ * Any additions, deletions, or changes to the original source files
+ * must be clearly indicated in accompanying documentation.
+ *
+ * If only executable code is distributed, then the accompanying
+ * documentation must state that "this software is based in part on the
+ * work of the Khronos Group."
+ *
+ * THE MATERIALS ARE 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
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ */
+
+#ifndef __APP_ERROR_CHECK_H
+#define __APP_ERROR_CHECK_H
+
+#include "compiler.h"
+
+/**
+ * \file
+ *
+ * Functions for reporting application errors.
+ *
+ * These functions are used for reporting application errors that might
+ * otherwise go unnoticed, not for debugging libglvnd itself. For example,
+ * they're used for reporting when an application tries to call an OpenGL
+ * function without a current context.
+ *
+ * There are two environment variables to control this:
+ *
+ * __GLVND_APP_ERROR_CHECKING: This flag will enable whatever application error
+ * checks are available in each component. In the future, there may be other
+ * flags to enable and disable other error checks. If that happens, then the
+ * __GLVND_APP_ERROR_CHECKING flag will still enable all available checks by
+ * default.
+ *
+ * __GLVND_ABORT_ON_APP_ERROR: If set to 1, then libglvnd will call \c abort(3)
+ * when it detects an application error. This is enabled by default if
+ * __GLVND_APP_ERROR_CHECKING is enabled, but the user can manually disable it.
+ */
+
+/**
+ * Initializes the debug output state. This will handle things like reading the
+ * environment variables.
+ */
+void glvndAppErrorCheckInit(void);
+
+/**
+ * Reports an application error.
+ *
+ * If __GLVND_ABORT_ON_APP_ERROR is enabled, then this will also cause the
+ * process to abort, so it should only be used for clear errors.
+ *
+ * \param format A printf-style format string.
+ */
+void glvndAppErrorCheckReportError(const char *format, ...) PRINTFLIKE(1, 2);
+
+/**
+ * Returns non-zero if error checking is enabled.
+ */
+int glvndAppErrorCheckGetEnabled(void);
+
+#endif // __APP_ERROR_CHECK_H

commit 86585e3bb0781ad1ef925e6fd81888190c12b1a5
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Mon Mar 28 17:26:32 2016 -0600

    GLX: A few more ABI fixes.
    
    Fix the return type in the __GLX_MAIN_PROTO macro.
    
    In GLX_dummy.c, check the major and minor version numbers like a real vendor
    library might. In addition, GLX_dummy.c now keeps a pointer to the
    __GLXapiExports struct instead of a copy of it.

diff --git a/include/glvnd/libglxabi.h b/include/glvnd/libglxabi.h
index 13189b9..b664e76 100644
--- a/include/glvnd/libglxabi.h
+++ b/include/glvnd/libglxabi.h
@@ -387,11 +387,11 @@ typedef struct __GLXapiImportsRec {
 /*****************************************************************************/
 
 #define __GLX_MAIN_PROTO_NAME "__glx_Main"
-#define __GLX_MAIN_PROTO(version, exports, vendor, imports)                \
-    __GLXapiImports *__glx_Main(uint32_t version,               \
-                                      const __GLXapiExports *exports, \
-                                      __GLXvendorInfo *vendor, \
-                                      __GLXapiImports *imports)
+#define __GLX_MAIN_PROTO(version, exports, vendor, imports) \
+    Bool __glx_Main(uint32_t version, \
+                    const __GLXapiExports *exports, \
+                    __GLXvendorInfo *vendor, \
+                    __GLXapiImports *imports)
 
 typedef Bool (*__PFNGLXMAINPROC)
     (uint32_t version, const __GLXapiExports *exports, __GLXvendorInfo *vendor, __GLXapiImports *imports);
diff --git a/tests/GLX_dummy/GLX_dummy.c b/tests/GLX_dummy/GLX_dummy.c
index cb493eb..29465c9 100644
--- a/tests/GLX_dummy/GLX_dummy.c
+++ b/tests/GLX_dummy/GLX_dummy.c
@@ -42,7 +42,7 @@
 #include "compiler.h"
 
 
-static __GLXapiExports apiExports;
+static const __GLXapiExports *apiExports = NULL;
 
 /*
  * Dummy context structure.
@@ -329,7 +329,7 @@ static void          dummySelectEvent           (Display *dpy,
  */
 static void dummy_glBegin (void)
 {
-    GLXContext ctx = apiExports.getCurrentContext();
+    GLXContext ctx = apiExports->getCurrentContext();
     assert(ctx);
 
     ctx->beginHit++;
@@ -337,7 +337,7 @@ static void dummy_glBegin (void)
 
 static void dummy_glVertex3fv(GLfloat *v)
 {
-    GLXContext ctx = apiExports.getCurrentContext();
+    GLXContext ctx = apiExports->getCurrentContext();
     assert(ctx);
 
     ctx->vertex3fvHit++;
@@ -345,7 +345,7 @@ static void dummy_glVertex3fv(GLfloat *v)
 
 static void dummy_glEnd (void)
 {
-    GLXContext ctx = apiExports.getCurrentContext();
+    GLXContext ctx = apiExports->getCurrentContext();
     assert(ctx);
 
     ctx->endHit++;
@@ -355,7 +355,7 @@ static void dummy_glMakeCurrentTestResults(GLint req,
                                         GLboolean *saw,
                                         void **ret)
 {
-    GLXContext ctx = apiExports.getCurrentContext();
+    GLXContext ctx = apiExports->getCurrentContext();
     assert(ctx);
 
     *saw = GL_TRUE;
@@ -405,13 +405,13 @@ static void dispatch_glXExampleExtensionFunction(Display *dpy,
     ExampleExtensionFunctionPtr func;
     const int index = dummyExampleExtensionFunctionIndex;
 
-    dynDispatch = apiExports.getDynDispatch(dpy, screen);
+    dynDispatch = apiExports->getDynDispatch(dpy, screen);
     if (!dynDispatch) {
         return;
     }
 
     func = (ExampleExtensionFunctionPtr)
-        apiExports.fetchDispatchEntry(dynDispatch, index);
+        apiExports->fetchDispatchEntry(dynDispatch, index);
     if (func) {
         func(dpy, screen, retval);
     }
@@ -671,20 +671,23 @@ PUBLIC Bool __glx_Main(uint32_t version,
                                   __GLXvendorInfo *vendor,
                                   __GLXapiImports *imports)
 {
-    if (version <= GLX_VENDOR_ABI_VERSION) {
-        memcpy(&apiExports, exports, sizeof(*exports));
+    if (GLX_VENDOR_ABI_GET_MAJOR_VERSION(version)
+            == GLX_VENDOR_ABI_GET_MAJOR_VERSION(GLX_VENDOR_ABI_VERSION)) {
+        if (GLX_VENDOR_ABI_GET_MINOR_VERSION(version)
+                >= GLX_VENDOR_ABI_GET_MINOR_VERSION(GLX_VENDOR_ABI_VERSION)) {
+            apiExports = exports;
 
-        imports->isScreenSupported = dummyCheckSupportsScreen;
-        imports->getProcAddress = dummyGetProcAddress;
-        imports->getDispatchAddress = dummyGetDispatchAddress;
-        imports->setDispatchIndex = dummySetDispatchIndex;
+            imports->isScreenSupported = dummyCheckSupportsScreen;
+            imports->getProcAddress = dummyGetProcAddress;
+            imports->getDispatchAddress = dummyGetDispatchAddress;
+            imports->setDispatchIndex = dummySetDispatchIndex;
 #if defined(PATCH_ENTRYPOINTS)
-        imports->isPatchSupported = dummyCheckPatchSupported;
-        imports->initiatePatch = dummyInitiatePatch;
+            imports->isPatchSupported = dummyCheckPatchSupported;
+            imports->initiatePatch = dummyInitiatePatch;
 #endif
 
-        return True;
-    } else {
-        return False;
+            return True;
+        }
     }
+    return False;
 }

commit 1d7ab91b76d0fbefaff4f4b8c7d019cbd18c9ff9
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Mon Mar 14 15:26:01 2016 -0600

    Remove the x11glvnd extension.
    
    Delete the x11glvnd directory.
    
    Commented out the two tests that depend on it, testx11glvndproto and
    testglxnscreens. Eventually, they should be rewritten to use the
    GLX_EXT_libglvnd extension instead.

diff --git a/configure.ac b/configure.ac
index b2ba9f8..932901f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,7 +240,6 @@ AC_CONFIG_FILES([Makefile
                  src/GLESv1/Makefile
                  src/GLESv2/Makefile
                  src/GLX/Makefile
-                 src/x11glvnd/Makefile
                  src/GLdispatch/Makefile
                  src/GLdispatch/vnd-glapi/Makefile
                  src/util/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 01c6e4c..b57606a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,5 @@
 SUBDIRS = util \
 	GLdispatch \
-	x11glvnd \
 	GLX \
 	OpenGL \
 	GLESv1 \
diff --git a/src/x11glvnd/Makefile.am b/src/x11glvnd/Makefile.am
deleted file mode 100644
index a907718..0000000
--- a/src/x11glvnd/Makefile.am
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2013, NVIDIA CORPORATION.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and/or associated documentation files (the
-# "Materials"), to deal in the Materials without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Materials, and to
-# permit persons to whom the Materials are furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# unaltered in all copies or substantial portions of the Materials.
-# Any additions, deletions, or changes to the original source files
-# must be clearly indicated in accompanying documentation.
-#
-# If only executable code is distributed, then the accompanying
-# documentation must state that "this software is based in part on the
-# work of the Khronos Group."
-#
-# THE MATERIALS ARE 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
-# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-
-noinst_HEADERS = \
-	x11glvnd.h \
-	x11glvndproto.h \
-	x11glvndserver.h
-
-noinst_LTLIBRARIES = libx11glvnd_client.la
-
-INCLUDES = \
-	-I$(top_srcdir)/include \
-	-I$(srcdir)/../util/uthash/src
-
-libx11glvnd_client_la_CFLAGS = $(X11_CFLAGS) $(INCLUDES)
-
-libx11glvnd_client_la_LIBADD = $(XEXT_LIBS)
-
-libx11glvnd_client_la_SOURCES = \
-	x11glvndclient.c
-
-x11glvnd_LTLIBRARIES = x11glvnd.la
-
-x11glvnddir = $(libdir)/xorg/modules/extensions
-
-x11glvnd_la_CFLAGS = \
-	$(XORG_CFLAGS)          \
-	$(X11_CFLAGS)           \
-	$(INCLUDES)
-
-x11glvnd_la_LDFLAGS = \
-	-module -avoid-version
-
-x11glvnd_la_SOURCES = \
-	x11glvndserver.c
diff --git a/src/x11glvnd/x11glvnd.h b/src/x11glvnd/x11glvnd.h
deleted file mode 100644
index e9d5aa1..0000000
--- a/src/x11glvnd/x11glvnd.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE 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
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#ifndef __X11GLVND_H__
-#define __X11GLVND_H__
-
-#include <X11/Xlib.h>
-
-/*
- * Describes the client-side functions implemented by the x11glvnd extension.
- * This is a simple extension to query the X server for XID -> screen and screen
- * -> vendor mappings, used by libGLX. This may eventually be replaced by a
- *  server-side GLX extension which does the same thing.
- */
-
-#define XGLV_EXTENSION_NAME "x11glvnd"
-
-/*!
- * Determines if the x11glvnd extension is supported.
- *
- * \param[out] event_base_return Returns the base event code.
- * \param[out] error_base_return Returns the base error code.
- * \return True if the extension is available, or False if it is not.
- */
-Bool XGLVQueryExtension(Display *dpy, int *event_base_return, int *error_base_return);
-
-/*!
- * Returns the version of the x11glvnd extension supported by the server.
- *
- * \param[out] major Returns the major version number.
- * \param[out] minor Returns the minor version number.
- * \return nonzero if the server supports a compatible version of x11glvnd.
- */
-Bool XGLVQueryVersion(Display *dpy, int *major, int *minor);
-
-/*!
- * Returns the screen associated with this XID, or -1 if there was an error.
- */
-int XGLVQueryXIDScreenMapping(
-    Display *dpy,
-    XID xid
-);
-
-/*!
- * Returns the vendor associated with this screen, or NULL if there was an
- * error.
- *
- * The caller must free the string with XFree.
- */
-char *XGLVQueryScreenVendorMapping(
-    Display *dpy,
-    int screen
-);
-
-#endif // __X11GLVND_H__
diff --git a/src/x11glvnd/x11glvndclient.c b/src/x11glvnd/x11glvndclient.c
deleted file mode 100644
index d01ccab..0000000
--- a/src/x11glvnd/x11glvndclient.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 2013, NVIDIA CORPORATION.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * unaltered in all copies or substantial portions of the Materials.
- * Any additions, deletions, or changes to the original source files
- * must be clearly indicated in accompanying documentation.
- *
- * If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the
- * work of the Khronos Group."
- *
- * THE MATERIALS ARE 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
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
- */
-
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include <assert.h>
-
-#include "glvnd_list.h"
-#include "x11glvnd.h"
-#include "x11glvndproto.h"
-
-const char *xglv_ext_name = XGLV_EXTENSION_NAME;
-static XExtensionInfo *xglv_ext_info = NULL;
-
-static /* const */ XExtensionHooks xglv_ext_hooks = {
-    NULL,                               /* create_gc */
-    NULL,                               /* copy_gc */
-    NULL,                               /* flush_gc */
-    NULL,                               /* free_gc */
-    NULL,                               /* create_font */


Reply to: