Commit graph

840 commits

Author SHA1 Message Date
Kyle Brenneman 33e1fffbca tests: Check for assembly support in testgldispatch.
In testgldispatch, if it's testing generating or patching entrypoints, then
check if assembly support is enabled, and skip the test if it's not.
2019-11-14 08:34:47 -07:00
Kyle Brenneman fc2ab74c84 Add a USE_DISPATCH_ASM macro to config.h.
Define a new USE_DISPATCH_ASM macro in config.h if assembly dispatch stubs are
enabled. Update the GLX entrypoint generation to use that macro instead of
checking all of the USE_*_ASM macros.

This is less likely to break if we add assembly support for another
architecture. In addition, it'll make it easier to skip any unit tests
that depend on being able to generate new dispatch stubs.
2019-11-14 08:34:46 -07:00
Kyle Brenneman 2a8e4011d6 Merge branch 'add-gitlab-ci' into 'master'
Add GitLab CI configuration

See merge request glvnd/libglvnd!198
2019-11-14 15:14:46 +00:00
Kyle Brenneman b581ecfa9b Merge branch 'gl3ext.h' into 'master'
Provide an empty GLES3/gl3ext.h header

Closes #195

See merge request glvnd/libglvnd!200
2019-11-07 14:39:59 +00:00
Matt Turner f466835326 Provide an empty GLES3/gl3ext.h header
The one in Mesa is empty but appears to come from some Khronos
repository, but gl3ext.h has never existed in the OpenGL-Registry
repository on github. Provide it for backwards compatibility.

Closes: https://gitlab.freedesktop.org/glvnd/libglvnd/issues/195
2019-11-06 17:41:08 -08:00
Kyle Brenneman 931791bf0b Add GitLab CI configuration.
Add a .gitlab-ci.yml file to run libglvnd's unit tests.

The "build-distcheck" target will simply run "make distcheck". That should also
cover running the unit tests for the x86-64 TLS build.

The "build-i386", "build-i386-tsd", and "build-x86-64-tsd" targets will build
and test the x86 TLS and TSD builds and the x86-64 TSD build.

The pure C stubs aren't covered yet, but they'll be easy to add once the unit
tests are fixed for them.

ARM and PPC builds also aren't covered yet.
2019-10-28 16:01:45 -06:00
Kyle Brenneman 58f1c0db95 Merge branch 'copy-mesa-gl-h' into 'master'
Update GL/gl.h to match Mesa.

Closes #194

See merge request glvnd/libglvnd!195
2019-10-28 19:55:32 +00:00
Lepton Wu 1dea90a97c GLdispatch: Improve the x86 TLS stubs performance.
This save one call frame and a similar change for mesa shows that
glGetString performance increased from 118M/s to 128M/s on my desktop.
2019-10-25 19:13:11 -07:00
Lepton Wu 6e310f7256 GLdispatch: Improve the x86 tsd stubs performance.
This skips touching %ebx most times and the same change for mesa shows that
glGetString performance increased from 114M/s to 120M/s on my desktop.
2019-10-24 14:57:46 -07:00
Kyle Brenneman 5dfdc5a6dc Update GL/gl.h to match Mesa.
Updated GL/gl.h to match the copy from Mesa at commit
a0829cf23b307ca44ab8c4505974fb7c8d71a35a.
2019-10-22 16:48:29 -06:00
Kyle Brenneman a1a73db6b4 Merge branch 'egl-registry-sync' into 'master'
egl: Sync with Khronos

Update egl.h and egl.xml to upstream commit de3a5e867d906a04a5c37ee0d89e7f01d3598eb9.

Closes #193

See merge request glvnd/libglvnd!192
2019-10-18 15:17:32 +00:00
Adam Jackson 51233cc52c egl: Sync with Khronos
commit de3a5e867d906a04a5c37ee0d89e7f01d3598eb9
    Author: Ken Russell <kbrussel@alum.mit.edu>
    Date:   Sat Oct 12 05:44:43 2019 -0700

        Reserve enums 0x34A0..0x34AF for ANGLE project. (#93)

Closes: https://gitlab.freedesktop.org/glvnd/libglvnd/issues/193
2019-10-17 11:53:50 -04:00
Kyle Brenneman 6fc91b93ee Merge branch 'gles-enable-fix' into 'master'
Add a configure option to disable glesv1 or glesv2

See merge request glvnd/libglvnd!191
2019-10-08 16:34:16 +00:00
Laurent Carlier 3a1fb32c3b Add a configure option to disable glesv1 or glesv2
Because mesa can be built without glesv1 so it breaks autodetection.

Fixes: https://bugs.archlinux.org/task/64032 ('mesa-demos doesn't build, unable to find GLES/gl.h')
2019-10-08 16:34:16 +00:00
Kyle Brenneman 879a453d35 Merge branch 'headers-fix-typo' into 'master'
include: install GL headers when GL is enabled

See merge request glvnd/libglvnd!190
2019-09-30 21:35:25 +00:00
Eric Engestrom 6f52473dac include: install GL headers when GL is enabled
A typo made it depend on EGL instead.

Fixes: ab9b5fcc3b ("Install the GL/GLES/GLX/EGL header files.")
2019-09-30 16:08:37 +01:00
Kyle Brenneman 062a42ea55 Bump the version number to 1.2.0. 2019-09-25 09:48:46 -06:00
Kyle Brenneman 8dc483cafe
Merge pull request #185 from kbrenneman/recognize-arm8vl
configure: Recognize the host_cpu value "armv8l"
2019-09-25 09:39:28 -06:00
Kyle Brenneman 8debb10fe9
Merge pull request #189 from kbrenneman/configure-page-size
configure: Allow specifying the page size.

Fixes https://github.com/NVIDIA/libglvnd/issues/132
2019-09-23 09:15:03 -06:00
Kyle Brenneman be09e1e31f
Merge pull request #188 from smcv/document-search-paths
Document EGL vendor ICD search paths
2019-09-20 10:57:42 -06:00
Simon McVittie 58e0fda487 Document EGL vendor ICD search paths
The behaviour of a relative `library_path` is deliberately left
unspecified here. As an implementation detail, it's currently
passed directly to `dlopen()`, so in practice it will be interpreted as
relative to the process's current working directory, but that doesn't
seem practically useful. Vulkan treats relative paths as being relative
to the JSON file in which they were found, which seems more likely to
be a helpful behaviour.

Otherwise this documents the current behaviour, without any of the
possible changes suggested on #187. If any of those changes are made,
then this document should be updated at the same time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-09-19 18:06:57 +01:00
Kyle Brenneman 8c4b386d5e configure: Allow specifying the page size.
The configure script now checks the environment variable GLDISPATCH_PAGE_SIZE.
If it's set, then it overrides the GLDISPATCH_PAGE_SIZE macro used in
libGLdispatch to align the assembly dispatch stubs.

This is mainly useful on ppc64le and aarch64 builds, where the page size can
vary.
2019-09-17 16:16:17 -06:00
Kyle Brenneman 69b8c323d0 EGL: Use EGL_FALSE instead of False.
Fix InternalMakeCurrentDispatch to use the constant EGL_FALSE instead of the
Xlib-specific False.
2019-09-13 15:31:45 -06:00
Kyle Brenneman c6e6b831d6 configure: Recognize the host_cpu value "armv8l".
If $host_cpu is "armv8l", then that means the 32-bit compatibility mode on an
aarch64 system. Treat that the same as armv7.
2019-09-12 14:11:59 -06:00
Kyle Brenneman f7186d1fb1
Merge pull request #184 from kbrenneman/make-x11-optional
Make x11 optional

Fixes https://github.com/NVIDIA/libglvnd/issues/183
2019-09-12 13:25:06 -06:00
Kyle Brenneman 68066ebc8e tests: Fix building the GLX tests.
Defining a target-specific CFLAGS variable overrides AM_CFLAGS, so add the same
include paths for the GLX tests that we used to add using AM_CFLAGS.

Also remove the -Wno-error flags, since they aren't needed anymore.
2019-09-12 12:19:32 -06:00
Kyle Brenneman e49caa311f Use the pkg-config variables for X11 and Xext.
In the makefiles, use the CFLAGS and LIBS variables set by the
PKG_CHECK_MODULES macros for X11 and Xext.
2019-09-12 10:15:33 -06:00
Kyle Brenneman a5a74957d8 Make X11 support optional.
Add a new configure option, --disable-x11. That option will disable GLX, and
will #ifdef out the X11 platform detection in EGL, but also remove the
dependency on the X11 libraries and headers.

In addition, only check for the xext and glproto packages if GLX is enabled,
since that's the only component that needs them.
2019-09-12 10:02:37 -06:00
Kyle Brenneman 396433be5b
Merge pull request #179 from kbrenneman/add-pkg-config
Add pkgconfig data
2019-09-04 14:18:41 -06:00
Kyle Brenneman 6b8d76bf4e Add a configure option for whether to install the GL headers.
Add a --disable-headers option, which tells it not to install the
GL/GLES/GLX/EGL header files.
2019-09-04 14:15:00 -06:00
Kyle Brenneman ab9b5fcc3b Install the GL/GLES/GLX/EGL header files.
Since we've got pkg-config files for the various libraries, we should also
install the corresponding header files so that the include directory matches
up.
2019-09-04 14:15:09 -06:00
Kyle Brenneman e5a4edcf17 Add the missing GL and GLES headers.
Add copies of glcorearb.h, and of the GLES2 and GLES3 headers.
2019-09-04 14:15:00 -06:00
Kyle Brenneman 6476491d4d Update the EGL headers.
Updated the EGL headers and XML file to the Khronos repository, from commit
598f20e3b7b7eec3e8d8a83e64b9592a21c55bb6.
2019-09-04 14:15:00 -06:00
Kyle Brenneman e67d3241c3 Update GL and GLX header and XML files.
Updated the OpenGL and GLX header and XML files to the Khronos repository, from
commit 08749e62826f34ba2e6e3733af545895f23e784b.
2019-09-03 09:22:52 -06:00
Kyle Brenneman 0dfaea2bcb Add pkg-config files for EGL, GL, GLES, and GLX.
This preserves the names from Mesa's gl, glesv1_cm, glesv2, and egl pkgconfig
data, and for compatibility with that, gl.pc gives you libGL.

Also added glx.pc and opengl.pc for libglvnd's libGLX and libOpenGL libraries.
If newer applications want to explicitly depend on libGLX and the appropriate
rendering API they can ask for the new pkgconfig names.

Note that the version numbers in each file are the API versions that each
library exposes, not the libglvnd package version.
2019-09-03 09:22:52 -06:00
Kyle Brenneman c805774da2 tests: Add utils_misc to tests that need it.
src/util/trace.c calls glvnd_vasprintf, which is defined in
src/util/utils_misc.c, so any tests that use trace.c also need to
use utils_misc.c.
2019-07-31 09:54:00 -06:00
Kyle Brenneman 58c8c4a402 Check if dirent.d_type is available in the configure script.
Add a check in the configure script to check if the dirent struct has a d_type
member, since that's not available on all systems.
2019-04-26 11:10:14 -06:00
Kyle Brenneman 0e0060fba5 Use glvnd_vasprintf instead of vasprintf in trace.c.
vasprintf isn't available on all systems, so use the local implementation
instead.
2019-04-26 11:02:30 -06:00
Kyle Brenneman bc9990b7be Bump the version number to 1.1.1. 2019-03-13 08:58:44 -06:00
Kyle Brenneman f92208be88
Merge pull request #171 from skirank/master
AARCH64 : Fix address passed to clear cache
2019-02-13 10:04:47 -07:00
Sai Kiran Korwar 9948df6367 AARCH64 : Fix address passed to clear cache
The entrypointExec address is modified before being passed to
clear_cache function. We do a small add/subtract for ARMv7 in
order to enable Thumb mode. This is not required for Aarch64 as
it does not support Thumb mode. Since we were not adding anything,
do not subtract as well before passing the address to clear_cache.

This was causing a crash while calling glXGetProcAddress.
2019-02-13 10:52:01 +05:30
Kyle Brenneman 72bb963ff7
Merge pull request #169 from kbrenneman/fix-ppc64le-tsd-toc-v2
GLdispatch: Fix the TOC save in the PPC64LE TSD stubs (v2)
2018-11-26 11:09:12 -07:00
Kyle Brenneman c501991842 GLdispatch: Don't save r12 in the PPC64LE TSD stubs.
We don't need to save and restore r12 across the call to _glapi_get_current.
It's only used for function linkage, and the dispatch stub overwrites the value
a few instructions later anyway.
2018-11-01 11:41:35 -07:00
Kyle Brenneman 884c5075d8 GLdispatch: Fix the PPC stubs for slots >= 4096.
We can't use a simple ld instruction for a slot greater than or equal to 4096,
because the offset no longer fits in the signed 16-bit offset field.

Instead, use an addis instruction to deal with the high-order bits in the
offset.
2018-11-01 10:07:37 -07:00
Kyle Brenneman d153b06d05 GLdispatch: Fix the TOC save in the PPC64LE TSD stubs
Call _glapi_get_current through the PLT call stub. The PLT call stub takes care
of saving the TOC pointer.

Also rearranged the assembly code to remove the need for a backwards jump after
calling _glapi_get_current.
2018-11-01 10:04:31 -07:00
Kyle Brenneman 012fe39e79 Remove a couple of duplicate typedefs.
In GL/gl.h, remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC, and the
GL_OES_EGL_image section.

PFNGLBLENDCOLORPROC and PFNGLBLENDEQUATIONPROC are defined in GL/glext.h in the
GL_VERSION_1_4 section.

GL_OES_EGL_image is defined in GLES/glext.h and GLES2/gl2ext.h, and the
GLeglImageOES typedef is also defined in GL/glext.h under
GL_EXT_EGL_image_storage.
2018-10-04 09:53:25 -06:00
Kyle Brenneman bed48a107c tests: Add tests for the multithreaded path in libGLdispatch
This is important for testing the TSD stubs, which have a separate fast path
for single-threaded programs.

The TSD stubs start with a simple global variable to hold the dispatch table
so that a single-threaded program doesn't have to deal with the overhead of
calling pthread_getspecific. When a second thread comes along, it sets that
variable to NULL, which makes the stubs call pthread_getspecific instead.

This change adds a flag to the testgldispatch test program that tells it to
call into libGLdispatch from two threads to force it into its multi-threaded
mode.

It also adds three new test scripts, which are the same testgldispatch tests
but for the multithreaded path.
2018-09-20 10:22:19 -06:00
Kyle Brenneman ff9246a97f GLdispatch: Keep the mutex when calling the vendor's threadAttach callback
In __glDispatchCheckMultithreaded, don't unlock the mutex until after calling
stubCurrentPatchCb->threadAttach.

Without that lock, another thread could come along and change
stubCurrentPatchCb out from under it.
2018-09-19 15:23:49 -06:00
Kyle Brenneman 55fad54ac7 Make Python optional when building from the make dist tarball.
When you run "make dist", the resulting tarball includes all of the generated
files. When building from that, we don't need to generate anything.
2018-08-17 07:17:56 -06:00
Kyle Brenneman 56450264b8 EGL: Fix typo in the makefile.
The $(VM_V_GEN) variable should be $(AM_V_GEN).
2018-08-17 07:17:53 -06:00