Commit graph

853 commits

Author SHA1 Message Date
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
Kyle Brenneman 85705b4cf2
Merge pull request #157 from bochecha/python
build: Find Python the Autotools way
2018-08-17 07:16:49 -06:00
Mathieu Bridon 90f973f74d build: Find Python the Autotools way
An added advantage to this is that it makes it really easy to build with
Python 3, the same way other Autotools projects support it:

    $ export PYTHON=/usr/bin/python3
    $ ./configure
2018-08-16 13:57:27 +02:00
Kyle Brenneman 59dbb141a6 Bump the version number to 1.1.0. 2018-07-24 11:35:26 -06:00
Kyle Brenneman 9d909106f2 Update the OpenGL XML and header files.
Update the gl.xml, GL/glext.h, and the GLES headers to commit
42f61786696df5102625d9b046976ee857645704 from the Khronos registry.
2018-06-20 15:57:00 -06:00
Kyle Brenneman 638ef33fc7 EGL: Remove a few unused functions in egldispatchstubs.c.
Remove FindProcIndex, __eglSetDispatchIndex, and
__eglDispatchFindDispatchFunction from egldispatchstubs.c.

The dispatch indices are allocated and assigned during initialization, so none
of those functions are ever called.
2018-06-06 08:42:41 -06:00
Kyle Brenneman 8709003ffd GLdispatch: Add a version script for the TSD build.
Add a separate version script export_list_tsd.ver for the TSD build of
libGLdispatch, since the two builds don't have the same set of symbols.
2018-05-24 08:42:52 -06:00
Kyle Brenneman 652909fbff Some fixes for "make dist"
Don't point nonst_HEADERS or EXTRA_DIST at entire directories. That causes
"make dist" to include files that it shouldn't, such as configured makefiles
and .pyc files.

Also added a few generated header files to noinst_HEADERS.
2018-04-13 16:15:37 -06:00
Kyle Brenneman 4914b61fa4 GLdispatch: Use --version-script instead -export-symbols.
The -export-symbols option in libtool creates a version script on Linux, but
on FreeBSD it instead uses the -retain-symbols-file option, which doesn't do
anything with the dynamic symbol table.

Instead, manually pass the --version-script option to the linker.
2018-04-11 15:14:10 -06:00
Kyle Brenneman 5baa1e5cfc Merge branch 'freebsd-fixes'
Various fixes so that libglvnd can build and run on FreeBSD.

The only change to C code is to deal with a difference in the parameters for
mincore(2).

Most of the rest is to to remove the dependency on GNU make and bash.
2018-03-27 13:20:46 -06:00
Kyle Brenneman dfaf0fd2b9 Add a (void*) cast for the last parameter when calling mincore.
The third parameter to mincore(2) can be a pointer to char or unsigned char,
depending on what system it's building on. To build in either case, just cast
that argument to a (void *).
2018-03-26 14:41:07 -06:00
Kyle Brenneman 82413e05ff Use sh instead of bash for the test scripts.
Not all systems have bash available, and in those that do, we can't assume that
it's located at /bin/bash.
2018-03-26 14:41:05 -06:00
Kyle Brenneman c413eae4f9 configure: Recognize both "x86_64" and "amd64" for host_cpu.
On FreeBSD, $host_cpu is set to "amd64" instead of "x86_64", so update the
configure script to recognize either string.
2018-03-26 14:41:03 -06:00
Kyle Brenneman 0177ade402 configure: Check if linking against libdl is necessary.
Add an AC_CHECK_FUNC call to check whether dlopen is available without any
additional libraries. Some systems provide dlopen as part of libc, in which
case we can't (and don't need to) link against libdl.so.
2018-03-26 14:41:01 -06:00
Kyle Brenneman f47132e649 GL: Expand glapi_gen_libglglxstubs in the makefile.
glapi_gen_libglglxstubs is only used once, so just expand it out instead of
using a function.
2018-03-26 14:40:59 -06:00
Kyle Brenneman adf997feb8 Move the glapi_gen_libglglxstubs function into the GL makefile.
Remove the now-empty file glvnd_gen.mk.
2018-03-26 14:40:57 -06:00
Kyle Brenneman f2b886ddea vnd-glapi: Change glapi_gen_mapi to a makefile variable.
Change glapi_gen_mapi to be a makefile variable instead of a function, so that
it still works when not using GNU make.
2018-03-26 14:40:55 -06:00
Kyle Brenneman 342cb23f22 Move the glapi_gen_mapi function into the vnd-glapi makefile.
$(glapi_gen_mapi) is only used in the vnd-glapi makefile, so define it there.
2018-03-26 14:40:52 -06:00
Kyle Brenneman 1578be92f2 generate: Remove glapi_gen_libopengl_exports.
Generating a symbol list for the entrypoint libraries used to be necessary when
we generated the same set of dispatch stubs in each library.

Since then, we only generate the stubs that each library is going to export, so
we don't need a separate export list anymore.
2018-03-26 14:40:50 -06:00
Kyle Brenneman 1e8ea3fe10 GL: Don't generate g_glapi_mapi_gl_tmp.h
Don't generate g_glapi_mapi_gl_tmp.h in the libGL makefile. That's not needed
anymore, because all of the GLDispatch stuff is built separately under
src/GLdispatch/vnd-glapi.

Likewise, remove the STATIC_DISPATCH_ONLY define from the compiler flags.
2018-03-26 14:40:48 -06:00
Kyle Brenneman f6d236e8dc
Merge pull request #150 from aaronp24/work-around-xorgproto-api-break
GLX: Work around 'X_GLXCreateContextAtrribsARB' typo fix API break
2018-03-08 09:40:32 -07:00
Kyle Brenneman 8cb4a2f8b7
Merge pull request #153 from RAOF/fix-egl-platform-detection-crash
Handle dlsym succeeding with info.dli_sname == NULL.
2018-03-05 12:38:46 -07:00
Christopher James Halse Rogers 45d92a4b6d
Handle dlsym succeeding with info.dli_sname == NULL.
When dlsym is handed an address in a shared object that doesn't match a symbol
in that shared object (such as a C++ vtable) it returns success but sets
dli_sname to null.

Handle this case rather than crashing.
2018-03-05 10:15:02 +01:00
Kyle Brenneman b029c24a63
Merge pull request #152 from kbrenneman/fix-eglMakeCurrent-bad-display
Always return an error from eglMakeCurrent if the EGLDispaly is invalid
2018-02-26 08:27:15 -07:00
Kyle Brenneman 28e05b9349 Always return an error from eglMakeCurrent if the EGLDispaly is invalid
In eglMakeCurrent, check to make sure the EGLDisplay is valid, even if the
context is NULL.

Fixes https://github.com/NVIDIA/libglvnd/issues/151
2018-02-22 11:33:43 -07:00
Aaron Plattner 627cc6634c GLX: Work around 'X_GLXCreateContextAtrribsARB' typo fix API break
Older versions of glxproto.h contained a typo where "Attribs" was misspelled.
The typo was fixed in the xorgproto version of glxproto.h, breaking the API.

Fixes #149.
2018-02-12 09:45:39 -08:00
Kyle Brenneman 212861e5e7
Merge pull request #148 from kbrenneman/bump-library-versions
Bump the version numbers in the library filenames
2018-01-31 10:20:55 -07:00
Kyle Brenneman 1b74e819e1 Bump the version numbers in the library filenames.
If libglvnd is installed onto a system that already has non-libglvnd versions
of any of the OpenGL libraries installed, then ldconfig can get confused about
which files to create symlinks to. At worst, you could end up with a mix of the
libglvnd libraries and leftover non-libglvnd libraries.

To avoid that, bump the version numbers in these filenames:
- libGL.so.1.0.0 -> libGL.so.1.7.0
- libGLESv1_CM.so.1.0.0 -> libGLESv1_CM.so.1.2.0
- libGLESv2.so.2.0.0 -> libGLESv2.so.2.1.0
- libEGL.so.1.0.0 -> libEGL.so.1.1.0

Fixes https://github.com/NVIDIA/libglvnd/issues/147
2018-01-30 11:04:18 -07:00
Kyle Brenneman 398e80757f
Merge pull request #143 from kbrenneman/gldispatch-fix-execmem
Fix executable memory allocation ifdefs and size
2018-01-17 09:34:53 -07:00
Kyle Brenneman fa8cea5bce GLdispatch: Fix the allocation size for the dynamic stubs.
In u_execmem.c, use entry_stub_size and MAPI_TABLE_NUM_DYNAMIC to determine how
much executable memory to allocate, instead of just hard-coding 256KB.

The stubs on some architectures are larger than 64 bytes, so 256KB isn't always
going to be large enough, and it's wasteful on architectures with stubs that
are smaller than 64 bytes.
2018-01-16 11:34:41 -07:00
Kyle Brenneman 294ccb2f49 GLdispatch: Remove obsolete #ifdefs from u_execmem.c.
Remove the #ifdefs and the Win32 and malloc-based code from u_execmem.c. It's
not needed or used anymore, and even if it was, the allocation code is in
src/utils/utils_misc.c now.
2018-01-16 11:26:50 -07:00
Kyle Brenneman e4a1393ffe
Merge pull request #140 from kbrenneman/add-GLX_EXT_no_config_context
Add support for GLX_EXT_no_config_context
2017-12-27 13:32:54 -07:00
Kyle Brenneman 55b962809b tests: Only use glXCreateContext in testglxmakecurrent.
In testglxmakecurrent, remove the paths to test using glXCreateNewContext and
glXCreateContextAttribsARB.

The testglxcreatecontext test now tests the various context creation functions,
so we don't need to shoehorn them into testglxmakecurrent.
2017-12-06 13:35:11 -07:00
Kyle Brenneman f34d06facf tests: Add a test for creating GLX contexts.
Add a new test, testglxcreatecontext to test the various functions for creating
GLX contexts.

It tests the core GLX functions, the GLX_ARB_create_context and
GLX_EXT_no_config_context extensions, and using a vendor-provided extension
function.

The new test is much simpler than trying to use testglxmakecurrent to test both
context creation and MakeCurrent, especially for trying to test multiple
context creation functions.
2017-12-06 13:33:42 -07:00
Kyle Brenneman 151c595ed1 tests/GLX_dummy: Add a vendor-provided create context function
Added a glXCreateContextVendorDUMMY extension function to GLX_dummy to test
using a vendor-provided extension function to create a context. We can't use
glXCreateContextAttribsARB for that now, because it has a dispatch stub in
libGLX itself.

glXCreateContextVendorDUMMY takes the same arguments as
glXCreateContextAttribsARB, so it can also serve as an example for implementing
a dispatch stub for glXCreateContextAttribsARB in a real vendor library.
2017-12-06 13:29:59 -07:00
Kyle Brenneman 26bdafb0a0 tests: Add a dummy attribute for glXQueryContext.
Defined a dummy attribute that a test program can use with glXQueryContext to
test dispatching by GLXContext.
2017-12-06 13:25:06 -07:00
Kyle Brenneman e0d43b79f7 tests: Add support for GLX_EXT_no_context_config to GLX_dummy
The implementation of glXCreateContextAttribARB in GLX_dummy will now handle
a screen number attribute or a GLXFBConfig.
2017-12-06 13:23:01 -07:00
Kyle Brenneman 82125032e8 tests: Remove the vendor dispatch stub for glXCreateContextAttribsARB.
glXCreateContextAttribsARB now has a dispatch stub in libGLX.so, so the dummy
vendor doesn't need to provide one.
2017-12-06 13:17:06 -07:00