Timo Aaltonen pushed to branch debian-unstable at X Strike Force / lib / libglvnd
Commits:
-
aced60b0
by Philippe Coval at 2020-07-01T17:42:11+02:00
-
cad3b523
by Kyle Brenneman at 2020-07-01T15:48:00+00:00
-
3a03fdae
by Kyle Brenneman at 2020-08-06T11:58:26-06:00
-
8af272f7
by Kyle Brenneman at 2020-08-06T11:58:26-06:00
-
6cd95fbf
by Kyle Brenneman at 2020-08-11T12:37:59-06:00
-
acc65445
by Kyle Brenneman at 2020-08-12T13:59:15+00:00
-
a527411d
by Ronan Pigott at 2020-11-18T15:46:53-07:00
-
1457209a
by Kyle Brenneman at 2020-11-18T23:04:58+00:00
-
dd2d28a0
by Kyle Brenneman at 2020-11-19T11:54:50-07:00
-
178d57f6
by Kyle Brenneman at 2021-02-11T23:32:49+00:00
-
e1a42895
by Kyle Brenneman at 2021-02-22T16:30:59+00:00
-
c1c60ac8
by Kyle Brenneman at 2021-04-21T16:22:39-06:00
-
7db4dc0b
by Kyle Brenneman at 2021-04-27T19:19:09+00:00
-
0f0d49f0
by Matt Turner at 2021-04-30T15:09:52-04:00
-
e7c758d8
by Timo Aaltonen at 2021-05-04T10:58:11+03:00
-
45a1f740
by Timo Aaltonen at 2021-05-04T11:07:35+03:00
-
bef3d80f
by Timo Aaltonen at 2021-05-04T12:14:43+03:00
12 changed files:
- configure.ac
- debian/changelog
- debian/control
- + debian/libglvnd-core-dev.install
- debian/libglvnd-dev.install
- meson.build
- meson_options.txt
- src/EGL/libeglmapping.c
- src/GLX/glvnd_genentry.c
- src/GLX/libglxmapping.c
- src/GLdispatch/vnd-glapi/entry_common.c
- tests/testgldispatch.c
Changes:
| ... | ... | @@ -2,7 +2,7 @@ dnl configure.ac |
| 2 | 2 |
dnl Process this file with autoconf to produce a configure script.
|
| 3 | 3 |
|
| 4 | 4 |
AC_PREREQ([2.63])
|
| 5 |
-AC_INIT([libglvnd], [1.3.2], [kbrenneman@nvidia.com])
|
|
| 5 |
+AC_INIT([libglvnd], [1.3.3], [kbrenneman@nvidia.com])
|
|
| 6 | 6 |
AC_CONFIG_SRCDIR([config.h.in])
|
| 7 | 7 |
AC_CONFIG_HEADERS([config.h])
|
| 8 | 8 |
|
| ... | ... | @@ -106,6 +106,16 @@ AM_CONDITIONAL([ENABLE_GLX_HEADERS], [test "x$enable_headers" = "xyes" -a "x$ena |
| 106 | 106 |
AM_CONDITIONAL([ENABLE_GLES1_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_gles1" = "xyes"])
|
| 107 | 107 |
AM_CONDITIONAL([ENABLE_GLES2_HEADERS], [test "x$enable_headers" = "xyes" -a "x$enable_gles2" = "xyes"])
|
| 108 | 108 |
|
| 109 |
+AC_ARG_ENABLE([entrypoint-patching],
|
|
| 110 |
+ [AS_HELP_STRING([--disable-entrypoint-patching],
|
|
| 111 |
+ [Disable OpenGL entrypoint patching optimization @<:@default=enabled@:>@])],
|
|
| 112 |
+ [enable_entrypoint_patching="$enableval"],
|
|
| 113 |
+ [enable_entrypoint_patching=yes]
|
|
| 114 |
+)
|
|
| 115 |
+AS_IF([test "x$enable_entrypoint_patching" = "xyes"],
|
|
| 116 |
+ [AC_DEFINE([GLDISPATCH_ENABLE_PATCHING], 1,
|
|
| 117 |
+ [Define to 1 to enable entrypoint patching in libGLdispatch.])])
|
|
| 118 |
+ |
|
| 109 | 119 |
dnl
|
| 110 | 120 |
dnl Arch/platform-specific settings. Copied from mesa
|
| 111 | 121 |
dnl
|
| ... | ... | @@ -201,10 +211,6 @@ if test "x$enable_glx" = "xyes" ; then |
| 201 | 211 |
PKG_CHECK_MODULES([GLPROTO], [glproto])
|
| 202 | 212 |
fi
|
| 203 | 213 |
|
| 204 |
-AS_IF([test "x$gldispatch_use_tls" = "xyes"],
|
|
| 205 |
- [AC_DEFINE([GLDISPATCH_USE_TLS], 1,
|
|
| 206 |
- [Define to 1 if libGLdispatch should use a TLS variable for the dispatch table.])])
|
|
| 207 |
- |
|
| 208 | 214 |
dnl Checks for typedefs, structures, and compiler characteristics.
|
| 209 | 215 |
AC_C_TYPEOF
|
| 210 | 216 |
|
| ... | ... | @@ -236,8 +242,8 @@ AC_MSG_RESULT($HAVE_INIT_TLS) |
| 236 | 242 |
|
| 237 | 243 |
AC_MSG_CHECKING([for entrypoint stub type])
|
| 238 | 244 |
case "x$asm_arch" in
|
| 239 |
-xx86 | xx86_64)
|
|
| 240 |
- # For x86 and x86-64, both the TLS and TSD stubs work.
|
|
| 245 |
+xx86 | xx86_64 | xppc64)
|
|
| 246 |
+ # For x86, x86-64, and ppc64, both the TLS and TSD stubs work.
|
|
| 241 | 247 |
if test "x$HAVE_INIT_TLS" = "xyes" ; then
|
| 242 | 248 |
gldispatch_entry_type=${asm_arch}_tls
|
| 243 | 249 |
gldispatch_use_tls=yes
|
| ... | ... | @@ -256,16 +262,6 @@ xaarch64) |
| 256 | 262 |
gldispatch_entry_type=aarch64_tsd
|
| 257 | 263 |
gldispatch_use_tls=no
|
| 258 | 264 |
;;
|
| 259 |
-xppc64)
|
|
| 260 |
- # For ppc64, allow both the TLS and TSD stubs for now.
|
|
| 261 |
- if test "x$HAVE_INIT_TLS" = "xyes" ; then
|
|
| 262 |
- gldispatch_entry_type=ppc64_tls
|
|
| 263 |
- gldispatch_use_tls=yes
|
|
| 264 |
- else
|
|
| 265 |
- gldispatch_entry_type=ppc64_tsd
|
|
| 266 |
- gldispatch_use_tls=no
|
|
| 267 |
- fi
|
|
| 268 |
- ;;
|
|
| 269 | 265 |
*)
|
| 270 | 266 |
# The C stubs will work with either TLS or TSD.
|
| 271 | 267 |
gldispatch_entry_type=pure_c
|
| 1 |
-libglvnd (1.3.2-2) UNRELEASED; urgency=medium
|
|
| 1 |
+libglvnd (1.3.3-1) UNRELEASED; urgency=medium
|
|
| 2 | 2 |
|
| 3 |
+ [ Debian Janitor ]
|
|
| 3 | 4 |
* Use secure copyright file specification URI.
|
| 4 | 5 |
* debian/copyright: use spaces rather than tabs to start continuation lines.
|
| 5 | 6 |
* Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
|
| 6 | 7 |
Repository-Browse.
|
| 7 | 8 |
|
| 9 |
+ [ Timo Aaltonen ]
|
|
| 10 |
+ * New upstream release.
|
|
| 11 |
+ * Restore libglvnd-core-dev. (Closes: #979976)
|
|
| 12 |
+ |
|
| 8 | 13 |
-- Debian Janitor <janitor@jelmer.uk> Sun, 07 Feb 2021 16:51:51 -0000
|
| 9 | 14 |
|
| 10 | 15 |
libglvnd (1.3.2-1) unstable; urgency=medium
|
| ... | ... | @@ -24,16 +24,13 @@ Section: libdevel |
| 24 | 24 |
Architecture: any
|
| 25 | 25 |
Depends:
|
| 26 | 26 |
libglvnd0 (= ${binary:Version}),
|
| 27 |
+ libglvnd-core-dev (= ${binary:Version}),
|
|
| 27 | 28 |
${misc:Depends},
|
| 28 | 29 |
libegl-dev (>= 1.3.0-1),
|
| 29 | 30 |
libgl-dev (>= 1.3.0-1),
|
| 30 | 31 |
libgles-dev (>= 1.3.0-1),
|
| 31 | 32 |
libglx-dev (>= 1.3.0-1),
|
| 32 | 33 |
libopengl-dev (>= 1.3.0-1),
|
| 33 |
-Breaks:
|
|
| 34 |
- libglvnd-core-dev (<< 1.3.0-1),
|
|
| 35 |
-Replaces:
|
|
| 36 |
- libglvnd-core-dev (<< 1.3.0-1),
|
|
| 37 | 34 |
Multi-Arch: same
|
| 38 | 35 |
Description: Vendor neutral GL dispatch library -- development files
|
| 39 | 36 |
This is an implementation of the vendor-neutral dispatch layer for
|
| ... | ... | @@ -42,14 +39,19 @@ Description: Vendor neutral GL dispatch library -- development files |
| 42 | 39 |
This package contains the development files for libglvnd.
|
| 43 | 40 |
|
| 44 | 41 |
Package: libglvnd-core-dev
|
| 45 |
-Section: oldlibs
|
|
| 42 |
+Section: libdevel
|
|
| 46 | 43 |
Architecture: any
|
| 47 | 44 |
Depends:
|
| 48 |
- libglvnd-dev,
|
|
| 49 | 45 |
${misc:Depends},
|
| 46 |
+Breaks: libglvnd-dev (<< 1.3.3-1)
|
|
| 47 |
+Replaces: libglvnd-dev (<< 1.3.3-1)
|
|
| 50 | 48 |
Multi-Arch: same
|
| 51 |
-Description: transitional dummy package
|
|
| 52 |
- This is a transitional dummy package, it can be safely removed.
|
|
| 49 |
+Description: Vendor neutral GL dispatch library -- core development files
|
|
| 50 |
+ This is an implementation of the vendor-neutral dispatch layer for
|
|
| 51 |
+ arbitrating OpenGL API calls between multiple vendors on a per-screen basis.
|
|
| 52 |
+ .
|
|
| 53 |
+ This package contains the header files for libglvnd split in a separate
|
|
| 54 |
+ package for Mesa.
|
|
| 53 | 55 |
|
| 54 | 56 |
Package: libglvnd0
|
| 55 | 57 |
Architecture: any
|
| 1 |
+usr/include/glvnd/*.h
|
|
| 2 |
+usr/lib/*/pkgconfig/libglvnd.pc
|
| 1 |
-usr/include/glvnd/*.h
|
|
| 2 | 1 |
usr/lib/*/libGLdispatch.so
|
| 3 |
-usr/lib/*/pkgconfig/libglvnd.pc
|
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 |
project(
|
| 29 | 29 |
'glvnd',
|
| 30 | 30 |
'c',
|
| 31 |
- version : '1.3.2',
|
|
| 31 |
+ version : '1.3.3',
|
|
| 32 | 32 |
meson_version : '>= 0.48',
|
| 33 | 33 |
default_options : ['c_std=gnu99']
|
| 34 | 34 |
)
|
| ... | ... | @@ -132,17 +132,18 @@ endif |
| 132 | 132 |
|
| 133 | 133 |
gl_dispatch_type = 'pure_c'
|
| 134 | 134 |
if use_asm
|
| 135 |
+ thread_type = have_tls ? 'tls' : 'tsd'
|
|
| 135 | 136 |
if host_machine.cpu_family().startswith('x86')
|
| 136 | 137 |
gl_dispatch_type = '@0@_@1@'.format(
|
| 137 | 138 |
host_machine.cpu_family(),
|
| 138 |
- have_tls ? 'tls' : 'tsd',
|
|
| 139 |
+ thread_type,
|
|
| 139 | 140 |
)
|
| 140 | 141 |
elif host_machine.cpu_family() == 'arm'
|
| 141 | 142 |
gl_dispatch_type = 'armv7_tsd'
|
| 142 | 143 |
elif host_machine.cpu_family() == 'aarch64'
|
| 143 | 144 |
gl_dispatch_type = 'aarch64_tsd'
|
| 144 | 145 |
elif host_machine.cpu_family() == 'ppc64'
|
| 145 |
- gl_dispatch_type = 'ppc64_@0@'.format(have_tls ? 'tls' : 'tsd')
|
|
| 146 |
+ gl_dispatch_type = 'ppc64_@0@'.format(thread_type)
|
|
| 146 | 147 |
endif
|
| 147 | 148 |
endif
|
| 148 | 149 |
message('Using dispatch stub type: @0@'.format(gl_dispatch_type))
|
| ... | ... | @@ -190,6 +191,10 @@ if _p != 0 |
| 190 | 191 |
add_project_arguments('-DGLDISPATCH_PAGE_SIZE=' + _p, language : ['c'])
|
| 191 | 192 |
endif
|
| 192 | 193 |
|
| 194 |
+if not get_option('entrypoint-patching').disabled()
|
|
| 195 |
+ add_project_arguments('-DGLDISPATCH_ENABLE_PATCHING', language : ['c'])
|
|
| 196 |
+endif
|
|
| 197 |
+ |
|
| 193 | 198 |
# Set EGL_NO_X11 unconditionally, Libglvnd doesn't make any assumptions about
|
| 194 | 199 |
# native display or drawable types, so we don't need X11-specific typedefs for
|
| 195 | 200 |
# them
|
| ... | ... | @@ -75,3 +75,8 @@ option( |
| 75 | 75 |
value : true,
|
| 76 | 76 |
description : 'Install headers for enabled APIs.'
|
| 77 | 77 |
)
|
| 78 |
+option(
|
|
| 79 |
+ 'entrypoint-patching',
|
|
| 80 |
+ type : 'feature',
|
|
| 81 |
+ description : 'Allow vendor libraries to patch OpenGL entrypoint functions.'
|
|
| 82 |
+)
|
| ... | ... | @@ -276,7 +276,9 @@ static EGLBoolean AddVendorDevices(__EGLvendorInfo *vendor) |
| 276 | 276 |
}
|
| 277 | 277 |
|
| 278 | 278 |
if (!vendor->staticDispatch.queryDevicesEXT(0, NULL, &count)) {
|
| 279 |
- return EGL_FALSE;
|
|
| 279 |
+ // Even if this vendor fails, we can still return the devices from any
|
|
| 280 |
+ // other vendors
|
|
| 281 |
+ return EGL_TRUE;
|
|
| 280 | 282 |
}
|
| 281 | 283 |
if (count <= 0) {
|
| 282 | 284 |
return EGL_TRUE;
|
| ... | ... | @@ -126,6 +126,10 @@ __asm__(".globl glx_entrypoint_start\n" |
| 126 | 126 |
".balign " U_STRINGIFY(STUB_SIZE) "\n" \
|
| 127 | 127 |
"glx_entrypoint_start:\n"
|
| 128 | 128 |
|
| 129 |
+#if defined(USE_ARMV7_ASM) && defined(__thumb__)
|
|
| 130 |
+ ".arm\n"
|
|
| 131 |
+#endif
|
|
| 132 |
+ |
|
| 129 | 133 |
#define GLX_STUBS_ASM
|
| 130 | 134 |
#include "g_glx_dispatch_stub_list.h"
|
| 131 | 135 |
|
| ... | ... | @@ -133,6 +137,10 @@ __asm__(".globl glx_entrypoint_start\n" |
| 133 | 137 |
".hidden glx_entrypoint_end\n"
|
| 134 | 138 |
".balign " U_STRINGIFY(STUB_SIZE) "\n" \
|
| 135 | 139 |
"glx_entrypoint_end:\n"
|
| 140 |
+ |
|
| 141 |
+#if defined(USE_ARMV7_ASM) && defined(__thumb__)
|
|
| 142 |
+ ".thumb\n"
|
|
| 143 |
+#endif
|
|
| 136 | 144 |
);
|
| 137 | 145 |
|
| 138 | 146 |
static void *DefaultDispatchFunc(void)
|
| ... | ... | @@ -95,6 +95,7 @@ static DEFINE_INITIALIZED_LKDHASH(__GLXvendorNameHash, __glXVendorNameHash); |
| 95 | 95 |
|
| 96 | 96 |
typedef struct __GLXdisplayInfoHashRec {
|
| 97 | 97 |
__GLXdisplayInfo info;
|
| 98 |
+ Bool inTeardown;
|
|
| 98 | 99 |
UT_hash_handle hh;
|
| 99 | 100 |
} __GLXdisplayInfoHash;
|
| 100 | 101 |
|
| ... | ... | @@ -697,15 +698,27 @@ static int OnDisplayClosed(Display *dpy, XExtCodes *codes) |
| 697 | 698 |
|
| 698 | 699 |
LKDHASH_WRLOCK(__glXDisplayInfoHash);
|
| 699 | 700 |
|
| 701 |
+ // Set the inTeardown flag for this display, but don't remove it from the
|
|
| 702 |
+ // hashtable yet. We shouldn't try to look up this display after this, but
|
|
| 703 |
+ // just in case something does, we don't want to try to set up a new
|
|
| 704 |
+ // __GLXdisplayInfoHash struct for it.
|
|
| 700 | 705 |
HASH_FIND_PTR(_LH(__glXDisplayInfoHash), &dpy, pEntry);
|
| 701 | 706 |
if (pEntry != NULL) {
|
| 702 |
- __glXDisplayClosed(&pEntry->info);
|
|
| 703 |
- HASH_DEL(_LH(__glXDisplayInfoHash), pEntry);
|
|
| 707 |
+ assert(!pEntry->inTeardown);
|
|
| 708 |
+ pEntry->inTeardown = True;
|
|
| 704 | 709 |
}
|
| 705 | 710 |
LKDHASH_UNLOCK(__glXDisplayInfoHash);
|
| 706 | 711 |
|
| 707 |
- CleanupDisplayInfoEntry(NULL, pEntry);
|
|
| 708 |
- free(pEntry);
|
|
| 712 |
+ if (pEntry != NULL) {
|
|
| 713 |
+ __glXDisplayClosed(&pEntry->info);
|
|
| 714 |
+ |
|
| 715 |
+ // Now, we can remove the display from the hashtable and free it.
|
|
| 716 |
+ LKDHASH_WRLOCK(__glXDisplayInfoHash);
|
|
| 717 |
+ HASH_DEL(_LH(__glXDisplayInfoHash), pEntry);
|
|
| 718 |
+ LKDHASH_UNLOCK(__glXDisplayInfoHash);
|
|
| 719 |
+ CleanupDisplayInfoEntry(NULL, pEntry);
|
|
| 720 |
+ free(pEntry);
|
|
| 721 |
+ }
|
|
| 709 | 722 |
|
| 710 | 723 |
return 0;
|
| 711 | 724 |
}
|
| ... | ... | @@ -724,6 +737,12 @@ __GLXdisplayInfo *__glXLookupDisplay(Display *dpy) |
| 724 | 737 |
LKDHASH_UNLOCK(__glXDisplayInfoHash);
|
| 725 | 738 |
|
| 726 | 739 |
if (pEntry != NULL) {
|
| 740 |
+ if (pEntry->inTeardown) {
|
|
| 741 |
+ // This shouldn't happen: If we're in the process of tearing down a
|
|
| 742 |
+ // display, then we shouldn't be trying to look up the display
|
|
| 743 |
+ // again.
|
|
| 744 |
+ return NULL;
|
|
| 745 |
+ }
|
|
| 727 | 746 |
return &pEntry->info;
|
| 728 | 747 |
}
|
| 729 | 748 |
|
| ... | ... | @@ -41,6 +41,7 @@ |
| 41 | 41 |
|
| 42 | 42 |
static int entry_patch_mprotect(int prot)
|
| 43 | 43 |
{
|
| 44 |
+#if GLDISPATCH_ENABLE_PATCHING
|
|
| 44 | 45 |
size_t size;
|
| 45 | 46 |
size_t pageSize = (size_t) sysconf(_SC_PAGESIZE);
|
| 46 | 47 |
|
| ... | ... | @@ -57,6 +58,9 @@ static int entry_patch_mprotect(int prot) |
| 57 | 58 |
return 0;
|
| 58 | 59 |
}
|
| 59 | 60 |
return 1;
|
| 61 |
+#else // GLDISPATCH_ENABLE_PATCHING
|
|
| 62 |
+ return 0;
|
|
| 63 |
+#endif
|
|
| 60 | 64 |
}
|
| 61 | 65 |
|
| 62 | 66 |
int entry_patch_start(void)
|
| ... | ... | @@ -149,6 +149,13 @@ int main(int argc, char **argv) |
| 149 | 149 |
}
|
| 150 | 150 |
#endif
|
| 151 | 151 |
|
| 152 |
+#if !defined(GLDISPATCH_ENABLE_PATCHING)
|
|
| 153 |
+ if (enablePatching)
|
|
| 154 |
+ {
|
|
| 155 |
+ return 77;
|
|
| 156 |
+ }
|
|
| 157 |
+#endif
|
|
| 158 |
+ |
|
| 152 | 159 |
__glDispatchInit();
|
| 153 | 160 |
InitDummyVendors();
|
| 154 | 161 |
|