Commit graph

840 commits

Author SHA1 Message Date
Kyle Brenneman 34a0755168 Merge branch 'felixonmars-master-patch-49368' into 'master'
Correct a typo in entry_pure_c.c

See merge request glvnd/libglvnd!252
2021-09-17 14:01:47 +00:00
Felix Yan e579f218e5 Correct a typo in entry_pure_c.c 2021-09-16 22:04:51 +00:00
Kyle Brenneman 4de6e6734b CI: Test builds with TSD stubs and TLS variables
Add builds to the CI script that use the TSD dispatch stubs, but use the
TLS variable in u_current_tls.c for the dispatch table.

That's the combination you'd get with musl or other non-glibc systems.
2021-09-13 17:14:57 -06:00
Kyle Brenneman 79b012c645 meson: Add an option to use the TSD dispatch stubs.
Add a 'dispatch-tls' option. Setting the option to false will force it
to use the TSD dispatch stubs for builds that would otherwise support
the TLS stubs.

This is mostly for test coverage, to make it easier to test builds that
use the __thread variable (u_current_tls.c), but still use the TSD
dispatch stubs.
2021-09-13 17:11:59 -06:00
Kyle Brenneman 94ea1327d8 meson: Change the 'tls' option to be boolean.
Change the 'tls' option to be a boolean value instead of a feature.

This still allows manually disabling TLS in builds that would otherwise
support it, but it shouldn't be affected by meson's --auto-features
option.
2021-09-13 17:11:55 -06:00
Kyle Brenneman f3ef4d4afc Merge branch 'tls-portability' into 'master'
Use initial-exec TLS for glibc and FreeBSD only, auto-enable TLSDESC

See merge request glvnd/libglvnd!249
2021-09-13 22:38:34 +00:00
Alex Xu (Hello71) 280843d7f7 Auto-enable TLSDESC support
TLSDESC speeds up access to global-dynamic TLS. TLS asm stubs do not
support TLSDESC, but all accesses are to initial-exec symbols anyways,
so it is not necessary to handle that separately.
2021-09-13 17:24:13 -04:00
Alex Xu (Hello71) e87d51f006 Use initial-exec TLS for glibc and FreeBSD only
It is not portable to use initial-exec TLS in dlopened libraries. glibc
and FreeBSD allocate extra memory for extra initial-exec variables
specifically for libGL, but other libcs including musl do not.

Since TLS entry asm assumes IE TLS, use TSD asm in other cases. Update
autoconf to match meson logic: enable ELF TLS if it is supported,
regardless of which type of asm is being used.
2021-09-13 17:24:13 -04:00
Kyle Brenneman 0dfeb77d4f Merge branch 'master' into 'master'
Update bin/symbols-check.py from mesa main

See merge request glvnd/libglvnd!250
2021-09-13 18:16:37 +00:00
Adrian Bunk 01ef19ca78 Update bin/symbols-check.py from mesa/mesa@6f854145 2021-09-13 21:01:48 +03:00
Matt Turner dc084876b4 Bump the version number to 1.3.4. 2021-08-24 12:53:07 -07:00
Kyle Brenneman c2af54c6fd Merge branch 'update-egl-headers' into 'master'
Update the EGL headers

Closes #206

See merge request glvnd/libglvnd!248
2021-08-24 15:21:53 +00:00
Kyle Brenneman b29f99d836 Update the EGL headers.
Updated the EGL headers and XML file to the Khronos repository, from commit
745e9ad435ad10323d0f42da1f279ad3cae2dba3.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/206
2021-08-23 17:24:53 -06:00
Kyle Brenneman 1ad0ed4a66 Merge branch 'relative-path' into 'master'
EGL: Interpret relative ICD paths as relative to the JSON manifest

Closes #190

See merge request glvnd/libglvnd!247
2021-08-04 14:54:59 +00:00
Simon McVittie a22477ba28 EGL: Interpret relative ICD paths as relative to the JSON manifest
Previously, relative ICD paths were treated as being relative to the
current working directory, but this doesn't seem useful in practice:
EGL vendors cannot predict what the current working directory of EGL
applications is going to be.

Instead, interpret the path as being relative to the realpath() of the
JSON manifest describing the ICD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/190
2021-08-04 14:32:22 +01:00
Kyle Brenneman 2dbd9ff563 Merge branch 'update-egl' into 'master'
egl: sync with Khronos

See merge request glvnd/libglvnd!245
2021-07-22 15:49:04 +00:00
Simon Ser 418cbb6be3 egl: sync with Khronos
Updated the EGL headers and XML file to the Khronos repository, from commit
3dd5604d6791a0fdd102b665fe706ebf8737892b.
2021-07-22 16:35:01 +02:00
Kyle Brenneman 93efa77696 Merge branch 'libglx-cleanup-display-callbacks' into 'master'
GLX: Remove the XESetCloseDisplay callback during teardown.

See merge request glvnd/libglvnd!244
2021-06-17 19:03:54 +00:00
Kyle Brenneman 4a08df7bdc GLX: Remove the XESetCloseDisplay callback during teardown.
When libGLX.so is unloaded, call XESetCloseDisplay to remove the display close
callback for any displays that still exist.

Otherwise, if libGLX.so is loaded using dlopen, and then unloaded while a
display is still open, then XCloseDisplay would try to call the (now dangling)
callback.
2021-06-16 11:32:26 -06:00
Kyle Brenneman 2b31e3b74c tests: Work around a bug in Meson 0.58.
Meson 0.58 doesn't accept an array within an array for the environment
parameter to test(). See:
https://github.com/mesonbuild/meson/issues/8727

Work around that by using "+" to join environment lists instead.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/218
2021-05-26 12:52:25 -06:00
Kyle Brenneman 1bb30a62f4 tests/meson: Add dependencies for the dummy vendor libraries.
Added a depends parameter to the GLX and EGL unit tests to ensure that meson
builds the dummy vendor libraries before trying to run the tests.
2021-05-18 17:07:18 -06:00
Matt Turner 0f0d49f0f3 Bump the version number to 1.3.3. 2021-04-30 15:09:52 -04:00
Kyle Brenneman 7db4dc0ba6 Merge branch 'entrypoint-patch-build-option' into 'master'
GLdispatch: Add a build option to disable entrypoint patching.

Closes #217

See merge request glvnd/libglvnd!240
2021-04-27 19:19:09 +00:00
Kyle Brenneman c1c60ac80a GLdispatch: Add a build option to disable entrypoint patching.
Added a --disable-entrypoint-tracking configure option and an
'entrypoint-patching' meson option to disable libGLdispatch's entrypoint
patching at build time.

If entrypoint patching is disabled, then it #ifdef's out the mprotect call, and
acts as if mprotect had failed, which causes libGLdispatch to skip trying to
perform any patching.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/217
2021-04-21 16:22:39 -06:00
Kyle Brenneman e1a4289544 Merge branch 'glx-fix-display-close-lock-order' into 'master'
GLX: Fix a potential deadlock in OnDisplayClosed.

Closes #213

See merge request glvnd/libglvnd!236
2021-02-22 16:30:59 +00:00
Kyle Brenneman 178d57f6d9 Merge branch 'fix-glx-armv7-arm-directive' into 'master'
Add .arm directives for the GLX entrypoint stubs.

See merge request glvnd/libglvnd!233
2021-02-11 23:32:49 +00:00
Kyle Brenneman 6e049b06e7 tests: Free the thread state in EGL_dummy.
In the destructor function for EGL_dummy, free all of the DummyThreadState
objects, and delete the TSD key for them.
2020-11-19 13:57:47 -07:00
Kyle Brenneman 16d3e9d176 tests: Free the EGLDisplay list in EGL_dummy
Added a destructor function to the EGL dummy vendor library, which frees the
list of EGLDisplays.
2020-11-19 13:57:47 -07:00
Kyle Brenneman a550e49852 tests: Add a mutex for the display list in EGL_dummy.
Add a mutex to serialize access to the list of DummyEGLDisplay structs in
EGL_dummy.
2020-11-19 13:57:42 -07:00
Kyle Brenneman 266f8e0da4 tests: Close the display in testglxgetprocaddress.
Add a missing XCloseDisplay call to testglxgetprocaddress.
2020-11-19 12:46:13 -07:00
Kyle Brenneman b5f0eac1c3 tests: Fix a memory leak in testglxmakecurrent.
In testglxmakecurrent, free the thread array.
2020-11-19 12:39:30 -07:00
Kyle Brenneman 6432f0dd57 tests: Close the display in testglxmakecurrent.
In testglxmakecurrent, close the display after we're done with it.
2020-11-19 12:38:01 -07:00
Kyle Brenneman 8489d7f22c tests: Don't allocate memory in glXMakeCurrentTestResults.
Change the glXMakeCurrentTestResults function so that it returns the function
counts in a caller-allocated struct instead of calling malloc internally.

Also removed the GLmakeCurrentTestRequest enum, since there's only one request
anymore.

Aside from simplifying things, this also fixes a memory leak in
testglxmakecurrent, which wasn't freeing the buffer that
glXMakeCurrentTestResults allocated. Now, it can just use a stack-allocated
GLContextCounts struct.
2020-11-19 12:31:17 -07:00
Kyle Brenneman dd2d28a033 GLX: Fix a potential deadlock in OnDisplayClosed.
In OnDisplayClosed, unlock the __glXDisplayInfoHash lock before locking
glxContextHashLock.

In CommonMakeCurrent, it holds glxContextHashLock while it tries to take the
__glXDisplayInfoHash lock, so if CommonMakeCurrent and OnDisplayClosed run at
the same time, they could deadlock.

To avoid that, OnDisplayClosed will set a new inTeardown flag in the
__GLXdisplayInfoHash, then it will unlock the display hash before calling
__glXDisplayClosed.

After __glXDisplayClosed is finished, OnDisplayClosed will lock
__glXDisplayInfoHash again long enough to remove the display from the
hashtable.

The inTeardown flag tells __glXLookupDisplay to return NULL, since after that
point, nothing should be trying to look up the display. In principle, we could
just remove the display from the hashtable up front, but then if something did
try to look up the display, then __glXLookupDisplay would try to create a new
__GLXdisplayInfo for it.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/213
2020-11-19 11:54:50 -07:00
Kyle Brenneman 1457209a2c Merge branch 'vendordev' into 'master'
egl: use device dispatch if at least one vendor suceeds

See merge request glvnd/libglvnd!235
2020-11-18 23:04:58 +00:00
Ronan Pigott a527411da7 egl: use device dispatch if at least one vendor suceeds
Currently, in InitDeviceListInternal if any egl vendor fails to list
its devices for any reason the construction of the device list is
abandoned. That means that even if we have one vendor successfully
serving the application, the failure of another vendor library will
break any api calls related to egl devices.

Instead, if a vendor fails queryDevicesEXT the device mapping logic
should proceed as if it listed no devices. If the relevant device
belongs to the failed vendor then the dispatch will still fail with
EGL_BAD_DEVICE.
2020-11-18 15:46:53 -07:00
Kyle Brenneman acc6544548 Merge branch 'fix-configure-tls' into 'master'
Fix some duplicate code in configure.ac

See merge request glvnd/libglvnd!232
2020-08-12 13:59:15 +00:00
Kyle Brenneman 6cd95fbfe2 Add .arm directives for the GLX entrypoint stubs.
Add .arm and .thumb directives before and after the ARMv7 GLX dispatch stubs.

The function addresses that get passed around don't take Thumb into account, so
if they're compiled as Thumb, then they'd still get executed as ARM, which
would cause them to crash a SIGILL.
2020-08-11 12:37:59 -06:00
Kyle Brenneman 8af272f7c4 configure: Consolodate some duplicate code.
Combine the x86/x86-64 and stub type selection branches, since the same code
works for either of them.
2020-08-06 11:58:26 -06:00
Kyle Brenneman 3a03fdaed7 configure: Remove an unused $gldispatch_use_tls check
In configure.ac, there's a block that should have been moved to later in the
file, but got copied instead. Remove the leftover duplicate.
2020-08-06 11:58:26 -06:00
Kyle Brenneman cad3b5230d Merge branch 'sandbox/rzr/review/master' into 'master'
build: Support meson-0.49.2

See merge request glvnd/libglvnd!230
2020-07-01 15:48:00 +00:00
Philippe Coval aced60b04d build: Support meson-0.49.2
Ternary operator inside method call crashes the parser,
so it's relocated outside.

This change will help to build project under latest debian:10

Forwarded: https://gitlab.freedesktop.org/glvnd/libglvnd/-/merge_requests
Bug: https://github.com/NVIDIA/libglvnd/issues/198
Relate-to: https://github.com/mesonbuild/meson/issues/5003
Signed-off-by: Philippe Coval <rzr@users.sf.net>
Change-Id: I18b6e8eca7564a6a252fff1ec6299311a3a92669
2020-07-01 17:42:11 +02:00
Matt Turner da0edd9728 Bump the version number to 1.3.2. 2020-06-25 15:17:25 -07:00
Matt Turner 312e12231d Merge branch 'no-werror' into 'master'
Remove -Werror from default CFLAGS

See merge request glvnd/libglvnd!229
2020-06-25 19:28:39 +00:00
Matt Turner 55a9dd3160 Remove -Werror from default CFLAGS
The set of warnings emitted are dependent on compiler version,
optimization level, CPU architecture, dependency versions, etc. It's not
tractable for a code base to be warning free under all circumstances,
and it's widely agreed that -Werror should not be enabled by default.

Given that it's trivial for developers to enable -Werror for autotools
by settings CFLAGS=-Werror and for meson with -Dwerror=true we should
not enable -Werror by default and require builders to disable it.

See https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html#-werror-compiler-flag-not-removed

Reviewed-by: Eric Anholt <eric@anholt.net>
2020-06-25 11:59:51 -07:00
Matt Turner 08467b4d7d gitlab-ci: Build with -Werror
The next commit will remove -Werror from the default autotools and meson
builds, but we would like to continue treating warnings as errors in CI.
2020-06-25 11:59:38 -07:00
Matt Turner 2a1dd5e494 autotools: Add a --enable-werror option 2020-06-25 11:58:58 -07:00
Kyle Brenneman a4c332e326 Merge branch 'use-python-element-tree' into 'master'
generate: Use xml.etree.ElementTree instead of cElementTree.

Closes #204

See merge request glvnd/libglvnd!227
2020-06-10 15:08:02 +00:00
Kyle Brenneman f936adad89 generate: Use xml.etree.ElementTree instead of cElementTree.
The cElementTree module is deprecated as of 3.3, so use the normal ElementTree
module instead.

Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/204
2020-06-10 08:59:44 -06:00
Kyle Brenneman 3e8684a739 Merge branch 'meson-werror' into 'master'
meson: Treat warnings as errors.

See merge request glvnd/libglvnd!226
2020-05-20 20:38:51 +00:00