Commit graph

537 commits

Author SHA1 Message Date
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
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 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 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 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
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 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 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 60331f22d2 Add support for GLX_EXT_no_config_context.
Added a dispatch handler for glXCreateContextAttribsARB. It'll look for a
GLX_SCREEN attribute first if the caller provides one, and then the GLXFBConfig
handle if the caller doesn't.
2017-12-06 12:43:39 -07:00
Gabríel Arthúr Pétursson e3ab0a24cf Cleanup winsys dispatch index list on EGL mapping teardown
This fixes a memory leak reported by both Valgrind and LeakSanitizer
when libEGL is dlopen()-ed and dlclose()-ed afterwards.
2017-10-07 01:15:20 +00:00
Gabríel Arthúr Pétursson c2f81ca7ce Fix memory leak in LoadVendorsFromConfigDir
The individual entries allocated by scandir need to be freed too.
2017-10-06 22:39:20 +00:00
Aaron Plattner 6198bd6ef6 Update cJSON to version 1.5.9
Downloaded from https://github.com/DaveGamble/cJSON/releases/tag/v1.5.9
2017-09-13 12:56:57 -07:00
Aaron Plattner 75d2385205 Remove the cJSON README and tests
These aren't used by the build system, so there's no reason to include them in
the repository.

Leave the LICENSE file, to indicate the license as it appeared in the snapshot
from https://github.com/DaveGamble/cJSON/
2017-09-13 12:54:17 -07:00
Aaron Plattner cf6bcb36ab Remove -Wno-misleading-indentation
This option is not recognized by clang, so it produces an error when configured
with

  CC=clang ./configure

  error: unknown warning option '-Wno-misleading-indentation'; did you mean '-Wno-missing-declarations'? [-Werror,-Wunknown-warning-option]

This flag is only needed for cJSON.c. Deobfuscate that file just enough to
eliminate the misleading indentation warnings, then remove the warning flag from
Makefile.am.
2017-09-13 12:35:55 -07:00
Aaron Plattner b0f7755142 Don't #define USE_ASM (defined(USE_X86_ASM) || ... )
This produces a warning when built with clang:

 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:46:26: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
 #if defined(__GNUC__) && USE_ASM
                          ^
 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:40:18: note: expanded from macro 'USE_ASM'
 #define USE_ASM (defined(USE_X86_ASM) ||    \

Instead, use the defined(...) conditions to conditionally define USE_ASM to 1 or
0 explicitly.
2017-09-13 12:24:25 -07:00
Kyle Brenneman 5ff90a1568 Merge pull request #125 from kbrenneman/ppc64le-convert-lq-stq
Convert lq/stq instructions
2017-08-30 09:45:18 -06:00
Ben Crocker 345b4c54b5 Convert lq/stq instructions
The Power8 spec allows for implementations to implement the 128-bit
lq/stq instructions in ways that perform much slower than the
equivalent pairs of ld/std instructions; So, convert lq/stq
to their equivalent ld/std pairs.

From section 3.3.4 in the PowerISA v.30B spec:

The lq and stq instructions exist primarily to permit software to access
quadwords in storage "atomically"; see Section 1.4 of Book II. Because GPRs
are 64 bits long, the Fixed-Point Facility on many designs is optimized for
storage accesses of at most eight bytes. On such designs, the quadword
atomicity required for lq and stq makes these instructions complex to
implement, with the result that the instructions may perform less well on these
designs than the corresponding two Load Doubleword or Store Doubleword
instructions.

Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-08-30 09:42:40 -06:00
Kyle Brenneman 8d4d03f77d Merge branch 'fix-aarch64-page-size'
Change the dispatch stubs on aarch64 to be aligned to a 64K boundary, since
some aarch64 systems use a 64K page size.
2017-08-18 12:58:33 -06:00
Michal Srb 37fc6caa4b Fix typo in _LIBRARY_FEATURE_NAMES.
The missing comma caused the "GL_ES_VERSION_3_1" and "GL_ES_VERSION_3_2" to
concatenate into non-existing feature name. Symbols from gles 3.1 and 3.2 were
then missing in the generated files.
2017-08-14 15:28:41 +02:00
Kyle Brenneman cfce0c8704 GLdispatch aarch64: Align the dispatch stubs to a 64K page size.
On aarch64, the page size can be as large as 64K, so align the dispatch stubs
to a 64K boundary instead of 4K.
2017-08-04 11:16:39 -06:00
Kyle Brenneman aca30d2c06 GLdispatch: Clean up the assembly dispatch code.
Made the names for macros and common variables more consistent.

Added a GLDISPATCH_PAGE_SIZE macro to specify the page size that it uses to
align the dispatch stubs. This value can be overridden at configure time, so a
later change could allow the configure script to figure out the page size on
architectures where it could vary.

This is all formatting changes, so there should be no functional difference.
2017-08-04 11:16:32 -06:00
Kyle Brenneman a14972089e EGL: Fix handling a malloc failure in eglQueryString.
In GetClientExtensionString, if it runs into a malloc failure, then return NULL
instead of trying to dereference the result.
2017-07-25 08:50:10 -06:00
Kyle Brenneman 75c77c4f9e GLX: Fix an error in handling GLX dispatch stubs.
In __glXGetGLXDispatchAddress, add a missing call to
__GLXapiImports::getProcAddress.
2017-07-25 08:46:47 -06:00
Kyle Brenneman d850cdde46 GL: Use a table to look up core GLX functions. (#127)
libGL.so now looks up the GLX core functions using a simple table, so that it
doesn't have the overhead of looking them up by name every time it's loaded.

Removed the (mutex != NULL) checks from __glXGLLoadGLXFunction, since it's no
longer called without a mutex.

Removed __glXWrapperInit, since it doesn't do anything anymore. Also removed the header file libgl.h, which only contained the declaration for __glXWrapperInit.
2017-06-20 12:53:54 -06:00
Kyle Brenneman 71226b013c EGL: Allow vendor libraries to identify platforms for eglGetDisplay. (#124)
EGL: Allow vendor libraries to identify platforms for eglGetDisplay.

Add a new optional function __EGLapiImports::findNativeDisplayPlatform. Vendor
libraries can provide that function to identify the platform for the native
display passed to eglGetDisplay.

Reviewed-by: Emil Velikov emil.velikov@collabora.com
2017-06-20 12:50:40 -06:00
Kyle Brenneman 8b4f6aeb7a PPC64LE: Fix the cache clear instructions.
Change the cache clear instructions for generated PPC64LE code so that it uses
an input variable instead of an output variable.

With an output variable, it doesn't use the correct address for the dcbst and
icbi instructions, possibly causing it to crash.
2017-06-13 11:53:51 -06:00
Emil Velikov 94691a3ee2 EGL: honour eglGetPlatformDisplay's attrib_list
Currently we simply drop them on the floor.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-07 17:43:56 +01:00
Emil Velikov f6c14fabfa EGL: alias "drm" to gbm when using EGL_PLATFORM
Since the inseption of EGL/GBM the unofficial way to force
the platform was via EGL_PLATFORM="drm".

Strictly speaking one could remove the gbm one, but it should have no
side effects. Plus it's more consistent with other platforms.

In either case, one should not be using eglGetDisplay but the Platform
version of the API.

Signed-off-by: Emil Velikov <emil.velikov@gmail.com>
2017-06-07 17:43:56 +01:00
Emil Velikov a6120e6ec5 EGL: add platform gbm detection in eglGetDisplay
Without it any applications that depend on the platform will fail to
run.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-07 17:43:56 +01:00
Emil Velikov b559273fbd EGL: detect platform gbm vendor capability
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-07 17:43:56 +01:00
Kyle Brenneman 6bcecd8f33 Merge pull request #120 from kbrenneman/ppc64le-support-v3
Add support for PPC64LE
2017-04-27 12:13:35 -06:00
Kyle Brenneman cd502b4c1a GLdispatch: Rename entry_x86_64_common.c to entry_simple_asm.c.
Rename the file entry_x86_64_common.c to entry_simple_asm.c, since it's used
for more than just x86 systems.

In addition, it's now used for aarch64 as well.
2017-04-26 15:48:47 -06:00
Ben Crocker f5f6cd79ef GLX: Add cache-flushing sequence to the generated GLX stubs.
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-26 09:11:33 -06:00
Ben Crocker 7caaabcd9c GLX: Implement GLX dispatch stubs for PPC64LE.
Fill in PPC64LE STUB_TEMPLATE, changing type from unsigned char[] to
uint32_t[]. Set DISPATCH_FUNC_OFFSET accordingly for PPC64LE.

Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-24 11:49:58 -06:00
Ben Crocker 290594c3e7 GLdispatch: Implement the TLS dispatch stubs for PPC64LE.
Fill in STUB_ASM_CODE macro and ENTRY_TEMPLATE[] array, changing type of the
latter to uint32_t[].

Define TEMPLATE_OFFSET_TLS_ADDR and TEMPLATE_OFFSET_SLOT relative to end of
ENTRY_TEMPLATE[] array.

Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-24 11:49:52 -06:00
Ben Crocker 1c40432132 GLdispatch: Implement the TSD dispatch stubs for PPC64LE.
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-24 11:49:49 -06:00
Kyle Brenneman e77d29a67c Makefile and structural changes for ppc64le support.
Added the files and makefile changes needed for adding support for ppc64le
dispatch stubs.

The actual assembly code still needs to be written, along with any other
arch-specific requirements for self-modifying code.

The new entry_ppc64le_*.c files are mostly based on the x86-64 files.

It still needs:
- Assembly code for OpenGL dispatch stubs in entry_ppc64le_tls.c,
  entry_ppc64le_tsd.c, or both.
- Assembly code for GLX dispatch stubs in glvnd_genentry.c.
- Assembly code for the entrypoint patching tests in patchentrypoints.c.
2017-04-24 11:49:02 -06:00
Kyle Brenneman f82f76c242 Merge branch 'armv7-textrel-fix'
Fixes https://github.com/NVIDIA/libglvnd/issues/116
2017-04-14 10:28:32 -06:00
Sai Kiran Korwar ef7a88b490 GLdispatch: Improve the documentation in entry_arm7_tsd.c. 2017-04-14 10:28:20 -06:00
Sai Kiran K 88cf38856f GLdispatch: Fix TEXTREL in the ARMv7 TSD stubs.
Rewrite the ARMv7 TSD dispatch stubs so that they'll go through the GOT and PLT
tables to look up _glapi_Current nd _glapi_get_current.
2017-04-14 10:28:13 -06:00
Kyle Brenneman 83b17fde1a GLdispatch: Remove the ".syntax divided" directive for ARMv7.
The ".syntax divided" directive causes build errors some compilers.

The error is because the compiler apparently generates unified syntax by
default and expects inline assembly to use unified syntax, and so just
generates a single ".syntax unified" directive at the top.  The ".syntax
divided" directive then causes problems, because the compiler still generates
unified syntax for the rest of the C code in the file.

As far as I can tell, newer versions of gcc will expect inline assembly to use
divided syntax, and they generate the necessary .syntax directives to cope with
switching to unified syntax in inline assembly.
2017-04-10 13:29:56 -06:00
Kyle Brenneman 7112ec663d GLX: Fix GLX entrypoint generation for x32.
This is a minor tweak to the x86-64 GLX entrypoint generation. On an x32 build,
it'll use the same stubs as for x86-64, but when it patches in the address to
the vendor library's dispatch function it has to expand the address to 64 bits.

The GLX dispatch stubs for x86-64 work by loading the address of the vendor
library's dispatch function as a 64-bit immediate value for a movabs
instruction. It loads the address into the RAX register, which is safe to
overwrite in either ABI, so the same code works for both.
2017-03-08 13:39:56 -07:00
Kyle Brenneman fa35a8383e Shorten the generated x86-64 TLS stubs.
Change the generated dispatch stubs for x86-64 TLS to match what Mesa
generates. The new stubs are shorter but functionally equivalent.
2017-03-08 13:39:21 -07:00
Kyle Brenneman 3d0ee810f1 GLdispatch: Add support for x32.
Implement TLS dispatch stubs for x32. The new x32 stubs are based on Mesa's
implementation, from Mesa commit 89458366585c34879b70110758bb4fd3acb62ce0.
2017-03-08 13:39:07 -07:00
Kyle Brenneman 4e637b074f GLdispatch: Minor cleanup of the x86-64 TLS stubs. 2017-03-08 13:37:40 -07:00
Kyle Brenneman 4ba5345742 Merge pull request #113 from nwnk/armv7hl
Fixes for armv7.

Fix build failures for the ARMv7 stubs that show up on some compiler versions.
2017-02-09 10:46:23 -07:00
Rob Clark b34d795f70 armv7: make sure asm is compiled in unified syntax mode
The individual stub functions already have .thumb_func but if syntax is
divided the assembler will reject the STUB_ASM_CODE.
2016-12-14 10:53:38 -05:00
Rob Clark 73320e7174 Fix compile errors 2016-12-14 10:53:33 -05:00
Kyle Brenneman ca0de36630 Add configure options for the EGL, GLX, and GLES libraries.
Added three new configure options to disable building the EGL, GLX, GLES
libraries.

In the tests makefile, move the list of test scripts to separate unconditional
variables, and add those to EXTRA_DIST. Just conditionally adding variables to
TESTS isn't enough to include the test scripts in the dist package.
2016-12-13 15:45:26 -07:00
Kyle Brenneman 480046fa04 Merge pull request #111 from kbrenneman/libegl-platform-detection
Better X11 and Wayland platform detection
2016-12-13 11:42:38 -07:00
Kyle Brenneman 2febabe709 GLdispatch: Remove the __GLdispatchProcEntry list.
Remove the __GLdispatchProcEntry struct and list, and remove the generation
counter for the dispatch tables and stubs.

Generated stubs are just added to the end of the table, so instead of a
generation counter, it's sufficient to just keep track of the number of entries
that we've populated in each table.

FixupDispatchTable now just populates any new table entries, starting after
whatever the last populated index was. It also now fetches the function names
from GLAPI instead of using its own list.

Removed CreateGLAPITable. FixupDispatchTable will allocate the table if
necessary. Since it doesn't need to treat static and dynamic stubs differently,
initializing a new empty table is no different than updating an existing table.

Also added a check for a calloc failure in __glDispatchCreateTable and
FixupDispatchTable, which will now propogate that error up to the caller.
2016-12-09 09:57:28 -07:00
Kyle Brenneman 839c97a410 GLdispatch: Remove _glapi_init_table_from_callback.
Removed _glapi_init_table_from_callback, and the script that generates it.
Instead, libGLdispatch.so just iterates over the stub list to find the name for
each function.

Also removed the struct definition for _glapi_table, since it's only used in
_glapi_init_table_from_callback. Everything else just treats it as an array
of pointers.

Changed the public_stubs array so that it includes the full name of each
function, including the "gl" prefix, so that it can pass that name to the
vendor's getProcAddress callback.

Changed stub_find_by_slot to use an array lookup instead of a linear search.
2016-12-09 09:57:28 -07:00
Kyle Brenneman f544e43468 GLdispatch: Remove public_string_pool.
The mapi_stub struct now just keeps a pointer to the name of the stub, for both
static and dynamic stubs.

Removed the public_string_pool variable. Instead, the public_stubs array
has the function names inline.
2016-12-09 09:57:28 -07:00
Kyle Brenneman 9a17198be3 GLdispatch: Fix TEXTREL in the x86 TSD stubs.
Rewrite the x86 TSD dispatch stubs so that they go through the GOT and PLT
tables to look up _glapi_Current and _glapi_get_current, instead of using
absolute addresses for them.

Fixes https://github.com/NVIDIA/libglvnd/issues/108
2016-12-01 12:41:54 -07:00
Kyle Brenneman f9117614be GLdispatch: Fix the x86 TLS stubs.
Fix the generated code for the x86 TLS dispatch stubs.

Update the x86 TLS stubs to use the same common code as the rest of the x86 and
x86-64 entrypoints.

Fixes https://github.com/NVIDIA/libglvnd/issues/18
2016-12-01 12:18:47 -07:00
Kyle Brenneman 522c601799 Add support for aarch64.
Add assembly code and stub generation for TSD stubs on aarch64.
2016-11-15 08:36:51 -07:00
Kyle Brenneman 839a33ef43 Merge pull request #110 from kbrenneman/fix-issue-103-eglfini
Remove the remaining calls to the vendor library from __eglFini and __glXFini.
2016-11-09 10:51:45 -07:00
Kyle Brenneman 7fb2537acf EGL: Fix the python command line.
Fix the python command lines so that they use the correct variable name for the
python executable.
2016-10-31 14:56:58 -06:00
Kyle Brenneman 0cea17eb04 Merge pull request #97 from aaronp24/master
Fix genCommon.py with Python 3
2016-10-31 14:42:32 -06:00
Kyle Brenneman c9378ea943 EGL: Fix an unitialized variable in IsX11Display. 2016-10-27 13:43:39 -06:00
Kyle Brenneman 470fc824a3 Merge branch 'tests-glx-genentry'
Expand the unit tests to test the generated GLX entrypoints.
2016-10-27 13:07:58 -06:00
Kyle Brenneman 31d0c31610 EGL: Add display detection for X11.
In eglGetDisplay, try to identify an X11 display based on a known function
pointer.

This is based on a patch by ajax@redhat.com:
https://github.com/NVIDIA/libglvnd/pull/102
2016-10-26 18:07:28 -06:00
Adam Jackson 10a4095b33 EGL: Better wayland detection in eglGetDisplay
The problem with using dlsym to look for wl_display_interface is that
variables by that name are emitted into other client libraries besides
libwayland-client. libSDL2 has this property, at least. Instead of that,
use dladdr() to look up the name of the symbol pointed to, and accept
any symbol with the right name as being wayland enough.

Signed-off-by: Adam Jackson <ajax@redhat.com>

v2: Minor formatting change.
2016-10-26 18:07:00 -06:00
Kyle Brenneman 8146a979d8 EGL: Don't call into the vendor library from __eglFini.
In __eglFini, check for a fork, but don't call __glDispatchCheckMultithreaded.

If a vendor has patched the OpenGL entrypoints, then
__glDispatchCheckMultithreaded will try to call the vendor's thread attach
callback, but the vendor library may have already been unloaded.

Fixes https://github.com/NVIDIA/libglvnd/issues/103
2016-10-25 17:40:53 -06:00
Kyle Brenneman 758b525463 GLdispatch: Don't call into the vendor from __glDispatchForceUnpatch.
In __glDispatchForceUnpatch, don't call the vendor's releasePatch callback,
because the vendor library might have already been unloaded by that point.
2016-10-25 17:32:47 -06:00
Aaron Plattner 996db4f2c2 chmod -x files that aren't scripts
These two files have mode 755, but aren't scripts that should be executed.
Remove their execute bits.
2016-10-25 16:08:35 -07:00
Kyle Brenneman 61bd107cc6 Fix a crash in process termination when EGL and GLX are both loaded.
Added a new function to libGLdispatch, __glDispatchForceUnpatch, which forces
it to unpatch the OpenGL entrypoints before libEGL or libGLX can unload the
vendor library that patched them.

If a vendor patches the OpenGL entrypoints, libGLdispatch doesn't unpatch them
when that vendor's context is no longer current, because that adds too much
overhead to repeated MakeCurrent+LoseCurrent calls. But, that also means that
the patch callbacks end up being dangling pointers after the vendor library is
unloaded.

This mainly shows up at process termination when a process loads both libEGL
and libGLX, because __glxFini and __eglFini will both call the vendor's
threadAttach callback.

Fixes https://github.com/NVIDIA/libglvnd/issues/103
2016-10-24 14:52:27 -06:00
Kyle Brenneman f556baa293 Change the assembly templates for ARMv7 to use uint16_t.
Change the assembly template arrays for ARMv7 to use arrays of 16-bit integers
instead of 8-bit.

This removes the need to byte swap them on little-endian systems.
2016-10-18 15:25:21 -06:00
Kyle Brenneman a77ce91f37 GLX: Add an environment variable to specify a vendor for a single screen.
When libGLX.so selects a vendor libray for an X screen, it will look for an
environment variable __GLX_FORCE_VENDOR_LIBRARY_<N>, where <N> is the screen
number.

This is mainly for testing and debugging. It allows unit tests to force
different vendors on different screens, and it allows tests to avoid preloading
the dummy vendor library.
2016-10-18 13:46:15 -06:00
Kyle Brenneman 1cd6a43122 Factor out some common extension string functions.
Moved the UnionExtensionStrings and IntersectionExtensionStrings functions from
EGL to utils_misc.c.

Changed libGLX to use the common UnionExtensionStrings and IsTokenInString
functions instead of its own versions of them.

Moved ParseClientVersionString to libglx.c near where it's used, and deleted
libglxstring.c and libglxstring.h.
2016-10-13 13:22:13 -06:00
Kyle Brenneman 295e5e5769 EGL: Fix an uninitialized variable.
In __eglGetEGLDispatchAddress, initialize the addr variable to NULL. Otherwise,
it could end up being uninitialized if there are no vendor libraries loaded.

Fixes https://github.com/NVIDIA/libglvnd/issues/96
2016-10-07 11:08:02 -06:00
Aaron Plattner aa7c576c66 Don't use 'xrange' because Python 3 doesn't have it.
Apparently 'xrange' isn't a thing in Python 3. 'range' does the same thing and
works for both, so use that.
2016-10-06 13:57:42 -07:00
Kyle Brenneman 0292f76a1f Merge pull request #92 from kbrenneman/add-libegl
Add an interface for EGL.
2016-09-09 17:06:10 -06:00
Kyle Brenneman 1220e8294a EGL: Fix a couple of typos.
In egldispatchstubs.c, __eglDispatchFetchByDevice will report an
EGL_BAD_DEVICE_EXT error for an invalid device instead of EGL_BAD_DISPLAY.

In LoadVendorsFromConfigDir, fix a typo in the path separator handling.
2016-09-09 11:15:40 -06:00
Kyle Brenneman ae89ac2619 EGL: Change the vendor config search paths.
Changed the default vendor config paths to be based on the directory options
for configure. libEGL will now look under the sysconfigdir and datadir paths,
in a "glvnd/egl_vendor.d" subdirectory.

Added the "datadir" variable to the pkg-config file, so that other packages can
find the expected location of the JSON files.
2016-08-31 12:01:00 -06:00
Kyle Brenneman 5e7b46e880 utils: Add cJSON.h to noinst_HEADERS. 2016-08-30 14:08:57 -06:00
Kyle Brenneman af24248798 EGL: Add -Wno-misleading-indentation for cJSON.
Add the flag -Wno-misleading-indentation to the cJSON source file, to avoid a
compiler warning (and resulting error) on more recent versions of GCC.
2016-08-30 13:31:58 -06:00
Kyle Brenneman 3053b22f3e EGL: Change __EGLapiImports to use (void *) for function pointers.
Trying to cast between __eglMustCastToProperFunctionPointerType and other
function pointer types causes strict aliasing warnings on some compilers.

Instead, just use a simple (void *) type for retrieving function pointers from
a vendor library, like libGLX does.
2016-08-30 13:22:59 -06:00
Kyle Brenneman 6c4f5ef9f7 EGL: Fix a few errors in EGL_KHR_debug.
Fix the message types in the _eglReportError and _eglReportCritical macros.

In eglDebugMessageControlKHR, check if the attribute list is valid even if the
callback is NULL.

In eglDebugMessageControlKHR, set the callback pointer whether or not the
attribute list is NULL.

In eglLabelObjectKHR, if the vendor library returns an error for an object type
other than EGL_OBJECT_THREAD_KHR, then return that error to the caller.

Fix the error handling and return value in eglBindAPI if the API isn't one of
GL or GLES.

Add a missing error callback in eglMakeCurrent.
2016-08-22 12:53:36 -06:00
Kyle Brenneman f7fbc4bb8b GLX: Keep track of the displays passed to glXMakeCurrent.
In glXMakeCurrent, make sure to add the new display to libGLX's tracking, so
that it gets a callback if the display is closed.

This fixes a dangling pointer to the display in the __GLXThreadState struct if
the application closes the display while it's still current.
2016-08-19 12:50:05 -06:00
Kyle Brenneman 1cdf246082 EGL: Trim the dispatch stub list.
Reduce the dispatch stubs in EGL to only include core functions and client
extensions. Any other functions should be provided by the vendor libraries.
2016-08-01 13:06:18 -06:00
Kyle Brenneman 67dcf4a14f EGL: Check the version number in the JSON files.
libEGL will now parse the file_format_version value in each vendor's JSON file.
2016-08-01 13:06:17 -06:00
Kyle Brenneman 4f7138cc31 EGL: Check for some client extensions when loading the vendors.
libEGL will now check the client extension strings of each vendor when the
vendor is loaded, and record whether a vendor supports
EGL_EXT_device_base/EGL_EXT_device_enumeration, and the device, Wayland, and
X11 platform extensions.

eglGetDisplay will now check for whether any vendor supports Wayland before it
tries to guess whether the native display pointer is a Wayland display.

When enumerating the device handles for each vendor, libEGL will check for
either EGL_EXT_device_base or EGL_EXT_device_enumeration, instead of just
EGL_EXT_device_base.
2016-08-01 13:06:15 -06:00
Kyle Brenneman 93ac333b93 EGL: Improve eglGetDisplay platform guessing.
eglGetDisplay will now check for EGL_PLATFORM_DEVICE_EXT and
EGL_PLATFORM_WAYLAND_KHR.

For EGL_PLATFORM_DEVICE_EXT, it will just check if the native display is a
valid EGLDeviceEXT handle.

For EGL_PLATFORM_WAYLAND_KHR, it will check the actual pointer, using similar
logic to Mesa.
2016-08-01 13:06:13 -06:00
Kyle Brenneman d448232036 EGL: Fix a crash in __eglGetVendorFromDevice.
Check if the __EGLdeviceInfo pointer is actually valid before trying to
dereference it.
2016-08-01 13:06:12 -06:00
Kyle Brenneman f42d89dd99 EGL: Rework the current rendering API.
libEGL will now forward calls to eglBindAPI to the vendor libraries.

Defined as part of the interface that libEGL only supports OpenGL and GLES.

This should simplify the task of porting a driver to EGL, since the eglBindAPI
behavior is closer to a non-glvnd driver.
2016-08-01 13:06:10 -06:00
Kyle Brenneman bb63d820df GLX: Fix a deadlock in teardown
In __glXAPITeardown, use pthread_mutex_trylock to take the context hash mutex,
and just skip freeing the context data if the mutex isn't available.

In some cases, such as a multi-threaded program that hits an X11 I/O error,
another thread could be blocked in a glXMakeCurrent call, and so trying to take
the context list mutex would deadlock.

In addition, fix the current context bookkeeping in fork recovery. After a
fork, the contexts should still exist, but none of them will be current
anymore.
2016-07-19 11:57:02 -06:00
Kyle Brenneman 7dabba8940 util: Add trylock functions to glnvd_pthread.
Add pointers for pthread_mutex_trylock, pthread_rwlock_tryrdlock, and
pthread_rwlock_trywrlock to the GLVNDPthreadFuncs table.
2016-07-13 09:57:16 -06:00
Kyle Brenneman 013285314c GLdispatch: Remove an incorrect assert.
In __glDispatchFini, remove the assert that the current context list is empty.
Even though libGLX/libEGL will clear out the current context for the current
thread, another thread may still have a current context.
2016-07-13 09:30:57 -06:00
Kyle Brenneman 31c5e7f602 EGL: Implement EGL_KHR_debug.
Implemented the EGL_KHR_debug extension in libEGL.

Updated the error reporting throughout libEGL to call the debug callback.

This requires that all vendor libraries also support EGL_KHR_debug. The reason
is that the debug callback has to be called every time an EGL error is
generated, and vendor libraries are still responsible for keeping track of EGL
errors on their own.

libEGL should be able to cope with a vendor library that doens't support
EGL_KHR_debug, but if that vendor library is used, then the extension won't
work correctly.
2016-06-22 16:15:32 -06:00
Kyle Brenneman b72018f59a EGL: Initial implementation of libEGL.
The implementation is mostly based off of libGLX.

Unlike GLX, libEGL will load all vendor libraries up front. This is necessary
for dealing with eglGetPlatformDisplay, as well as many client extensions.

Dispatching EGL functions is generally simpler than GLX. All display extension
functions by definition can be dispatched based on an EGLDisplay handle, so
it doesn't need to provide lookup functions for contexts or surfaces, and
vendor libraries don't have to add any EGL objects to tracking.

Only OpenGL and OpenGL ES and a handful of client extensions are supported so
far.
2016-06-22 16:14:16 -06:00
Kyle Brenneman 382eb05efa Checked in a copy of the cJSON library.
This will be used to parse JSON config files that will describe the available
vendor libraries for EGL.
2016-06-22 16:13:35 -06:00
Kyle Brenneman 82c37ca46b util: Add functions for splitting a string into tokens. 2016-06-22 16:13:20 -06:00
Kyle Brenneman fc61f5488f util: Add a local implementation of vsprintf(3). 2016-06-14 15:39:11 -06:00
Kyle Brenneman 1b30d15333 GLdispatch: Don't unpatch entrypoints in __glDispatchLoseCurrent.
In __glDispatchLoseCurrent, don't try to restore the default entrypoints.
Instead, __glDispatchMakeCurrent will check if it's using a different vendor
library, and if so, it will unpatch and repatch the entrypoints then. If it's
using the same vendor library (which will usually be the case), then it can
leave them patched and skip the patch overhead.

Some applications will call glXMakeCurrent to release and bind the same context
every frame, sometimes multiples times. Each patch and unpatch sequnce can chew
up 1-2 milliseconds. That's enough to significantly reduce the framerate of
some applications.

Reviewed-by: James Jones <jajones@nvidia.com>
2016-05-31 14:49:16 -06:00
Kyle Brenneman d0ced9a2e3 GLX: Fix a couple of errors.
Moved the unlock in __glXLookupVendorByName to after the calls to update the
GLX entrypoints.

Fixed a typo in GLXEntrypointUpdateCallback.
2016-05-27 13:05:40 -06:00
Kyle Brenneman 17f5566087 GLX: Some additional cleanup for the GLX dispatch table.
Added a license+copyright comment to winsys_dispatch.[ch].

Renamed __GLVNDwinsysDispatchIndexHash to __GLVNDwinsysDispatchIndexEntry,
since it's not a hashtable anymore.

In __glXLookupVendorByName, only call __glvndWinsysDispatchGetCount once
instead of on every loop iteration.

Removed the locks for the GLX dispatch index list and the generated GLX
dispatch stubs. Instead, the vendor hashtable's lock is used for all three.

There's enough overlap between when the three locks are taken that using
separte locks has very little benefit and increases the risk of deadlocks.
2016-05-17 10:32:41 -06:00
Kyle Brenneman 968349de93 GLX: Move the vendor GLX dispatch table to winsys_dispatch.c.
Remove the __GLXvendorInfo::dynDispatchHash hashtable, and replace it with a
dispatch table from winsys_dispatch.
2016-05-17 10:32:41 -06:00
Kyle Brenneman edd36498c5 Add functions to keep track of a vendor library's GLX functions.
Added functions to create and manage a per-vendor dispatch table for
window-system functions.

These will replace the __GLXdispatchFuncHash hashtable in GLX.
2016-05-17 10:32:41 -06:00
Kyle Brenneman 39070d4e59 GLX: Clean up __glXFetchDispatchEntry.
Some minor cleanup of __glXFetchDispatchEntry.

Handle the various failure cases more directly: If we can't find a name, or if
the vendor library doesn't support a function, then return early.

If we can't allocate a cache entry for the function, then return the dispatch
stub anyway. It can try to store the stub again next time.
2016-05-17 10:32:41 -06:00
Kyle Brenneman b6a1d5a5b5 GLX: Fix a race condition in the glXGetProcAddress cache.
In cacheProcAddress, check if the function is already in the hashtable before
trying to add it. It's possible that another thread might have already called
glXGetProcAddress for the same function.

In addition, allocate each cache entry with a single malloc instead of a malloc
and a strdup.
2016-05-17 10:32:41 -06:00
Kyle Brenneman 774c9b25cb GLX: Assign indices to the GLX dispatch functions defined in libGLX.
The dispatch functions in libGLX are now added to the GLX dispatch list just
like vendor-provided dispatch functions would be.

The function name cache in glXGetProcAddress is no longer required for
correctness, because it can look up a locally-defined dispatch stub in the same
list as the vendor-provided stubs.

In addition to simplifying glXGetProcAddress, this allows vendor libraries to
look up all GLX functions by index. In particular, this would allow a vendor
to look up glXDestroyContext, which would let it recover properly if it fails
to add a new context to the context-to-vendor mapping.
2016-05-17 10:32:40 -06:00
Kyle Brenneman 8167e35e53 GLX: Use winsys_dispatch to keep track of GLX dispatch stubs.
Remove the __GLXdispatchIndexHash table, and use the list in winsys_dispatch.c
to keep track of the function indices, names, and dispatch stubs.

If libGLX generates a GLX dispatch stub, then it will now assign an index to it
when it generates the stub, not when it fills in the stub. That lets it treat
generated stubs the same way regardless of whether they've been filled in or
not.

When assigning an index, it will now call the setDispatchIndex callback for
every vendor library, not just the vendor that provided the dispatch stub.

When loading a vendor library, it will call the new vendor's setDispatchIndex
callback for every existing GLX dispatch function.
2016-05-17 10:32:40 -06:00
Kyle Brenneman 4d20b1826b Add helper functions for keeping track of the window-system dispatch stubs.
Added a new file, winsys_dispatch.c, with functions for keeping track of the
indices, names, and dispatch stubs for window-system functions.

This will replace the __GLXdispatchIndexHash hashtable in GLX.

It's independant of the window system, so it should be usable for EGL as well.
2016-05-17 10:32:34 -06:00
Kyle Brenneman 509de0dbc8 Remove the reference to glx.h from libopengl.c.
libOpenGL doesn't contain anything GLX-specific, so it doesn't need anything
defined in glx.h.
2016-05-11 13:37:58 -06:00
Kyle Brenneman d41548599e Merge pull request #84 from kbrenneman/fix-automake-warnings
Fix the warnings that autogen.sh spits out.

Added libtool convenience libraries for the source files in src/util instead of
including them directly in other makefiles. This avoids a bunch of
subdir-objects warnings.

Added libtool convenience libraries for each of the glapi builds.

Flattened the vnd-glapi directory. In theory, just setting the subdir-objects
flag should be enough, but that causes failures where "make distcheck" doesn't
build all of the source files.
2016-05-11 11:16:57 -06:00
Kyle Brenneman 2f27586a4e Remove unused file src/OpenGL/entrypoint_common.mk. 2016-05-04 12:11:30 -06:00
Kyle Brenneman a635c722a5 GLX: Remove __glXDispatchNoopPtr.
Removed the header file and the script to generate the __glXDispatchNoopPtr
table.

Also removed the dependency on Perl from configure.ac, since the rest of the
scripts are in Python.

Reviewed-by: aplattner@nvidia.com
2016-05-04 11:43:24 -06:00
Kyle Brenneman 26cfae955b GLX: Remove references to __glXDispatchNoopPtr.
Removed the functions __glXGetCurrentDispatch and __glXGetStaticDispatch.
Everything that used either one now looks up the __GLXvendorInfo pointer
instead.

Also removed __glXGetGLDispatch, since it's not used anywhere.

Reviewed-by: aplattner@nvidia.com
2016-05-04 11:43:04 -06:00
Thomas Hindoe Paaboel Andersen b0b4e351b3 GLX: fix a read after free
In MergeExtensionStrings currentString was read after it was realloc'ed
to make space for the extra extensions.

This patch makes the function read the realloc'ed memory instead. To
allow that to work 'buf' has to be null terminated on after every
extra extension is written.
2016-04-24 22:50:40 +02:00
Thomas Hindoe Paaboel Andersen ca02a90f22 GLdispatch: trivial indentation fix 2016-04-23 20:45:57 +02:00
Kyle Brenneman fa2add82a0 Move vnd-glapi/mapi/* to vnd-glapi.
Moved everything under src/GLdispatch/vnd-glapi/mapi/ to
src/GLdispatch/vnd-glapi.

Removed the subdir-objects flag.

Using subdir-objects causes errors when you do a make followed by a
"make distcheck", because for some reason the distcheck doesn't build all of
the source files.
2016-04-19 12:48:47 -06:00
Kyle Brenneman 65440c051e GLESv1: Statically export glPointSizePointerOES.
Add GL_OES_point_size_array to the set of features and extensions that are
exported from libGLESv1_CM.so.

According to the OpenGL ES 1.1 spec, all required extensions are supposed to be
statically exported from the library. GL_OES_point_size_array is the only
required extension that defines any functions.
2016-04-07 13:08:34 -06:00
Kyle Brenneman 87ce484d49 Move trace.[ch] into the src/utils directory.
Move trace.c and trace.h into the src/utils directory instead of a
subdirectory.
2016-04-06 11:00:32 -06:00
Kyle Brenneman 56cb81e164 Fix the remaining subdir-objects warnings.
Added the subdir-objects option to the vnd-glapi makefile. Changed all of the
_SOURCES variables in that makefile to use relative paths.
2016-04-06 10:57:23 -06:00
Kyle Brenneman 8ade0512f7 Remove the MAPI_PREFIX variable from configure.ac.
Moved the MAPI_PREFIX variable from configure.ac to the vnd-glapi makefile.

Removed the MAPI_MESA_PREFIX variable entirely.
2016-04-06 10:57:23 -06:00
Kyle Brenneman 79e5a1cef8 Move the vnd-glapi builds into the vnd-glapi Makefile.
Move the various vnd-glapi builds into individual .la files in the vnd-glapi
makefile, instead of defining them in the OpenGL, GL, GLESv1, and GLESv2
makefiles.
2016-04-06 10:57:23 -06:00
Kyle Brenneman d79a1484ac Fix some autoconf warnings.
Fixed a few order and variable name warnings.

Defined convenience libraries for the source files under src/util, to avoid the
subdir-objects warning from them.
2016-04-06 10:57:23 -06:00
Kyle Brenneman 5a69af6f77 GLX: Ignore passing NULL to glXDestroyContext
If glXDestroyContext is called with NULL for the GLXContext, then it will now
report an error using glvndAppErrorCheckReportError but it won't generate a
GLXBadContext error.

Some existing drivers (NVIDIA, Mesa, and possibly others) will just silently
return in that case, and some applications depend on that behavior.
2016-04-06 10:49:47 -06:00
Kyle Brenneman cc0892bb1c GLX: Add app_error_check.c to libGLX.
Added app_error_check.c to libGLX, and initialize it from __glxInit.
2016-04-05 12:58:17 -06:00
Eric Engestrom 3c87d939aa Fix spelling mistakes 2016-04-03 16:14:15 +01:00
Kyle Brenneman b7d7542967 GLX: Don't call into the vendor library from __glXFini.
By the time __glXFini is called, the destructors in the vendor libraries may
have already been called, so it's not safe to call any functions in the vendor
library.

__glXFini will now check for a fork and go through fork recovery, but it won't
call __glDispatchCheckMultithreaded. If there was a current context, then
__glDispatchCheckMultithreaded might call the vendor's thread attach callback.
2016-04-01 09:18:33 -06:00
Kyle Brenneman 3402e11588 Merge pull request #80 from kbrenneman/app-error-check-setting
Add support for reporting application errors.
2016-03-30 12:49:35 -06:00
Kyle Brenneman c4d3d7ee15 Merge pull request #77 from nwnk/public_entry_visibility
GLdispatch: Emit public_entry_{start,end} as hidden symbols
2016-03-30 12:47:25 -06:00
Kyle Brenneman e2d44985d8 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.
2016-03-29 10:18:02 -06:00
Kyle Brenneman d7f4370dde Merge pull request #79 from kbrenneman/replace-x11glvnd-v2.
Replace x11glvnd with GLX_EXT_libglvnd extension.
2016-03-28 17:44:05 -06:00
Kyle Brenneman 95a5bfcdfb Merge pull request #74 from kbrenneman/libglx-abi-version-1.
Updates to libGLX vendor library interface.
2016-03-28 17:40:51 -06:00
Kyle Brenneman 1d7ab91b76 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.
2016-03-24 12:46:41 -06:00
Kyle Brenneman 547daaf228 GLX: Use GLX_EXT_libglvnd instead of x11glvnd.
Reworked libGLX.so to use the GLX_EXT_libglvnd extension instead of x11glvnd.

In __glXLookupVendorByScreen, use __glXQueryServerString to look up the vendor
name string, and then split it up with strtok_r.
2016-03-24 12:46:41 -06:00
Kyle Brenneman 4c7a1b18e6 GLX: Add functions for the GLX_EXT_libglvnd extension.
Add some functions to handle requests for looking up vendor names and screen
numbers using the GLX_EXT_libglvnd extension.
2016-03-24 12:44:25 -06:00
Kyle Brenneman 3f2f59cb0e GLX: Move the display pointer to __GLXdisplayInfo.
Move the display pointer from __GLXdisplayInfoHash to __GLXdisplayInfo, so that
we don't have to pass around both the Display and __GLXdisplayInfo pointers to
a function that needs both of them.
2016-03-24 12:44:25 -06:00
Kyle Brenneman 3c6d7d753c GLX: Remove __glXFreeDisplay.
__glXFreeDisplay is defined but not used anywhere.
2016-03-24 12:44:25 -06:00
Kyle Brenneman 3f4674f8f6 GLX: Use XESetCloseDisplay for the close display callback.
libGLX will now use XAddExtension and XESetCloseDisplay to register a callback
when a display is closed.

Removed XGLVRegisterCloseDisplayCallback and
XGLVUnregisterCloseDisplayCallbacks from the x11glvnd client library.

This is in preparation for removing the x11glvnd extension.
2016-03-24 12:44:25 -06:00
Kyle Brenneman 5c8e632906 GLdispatch: Rename the API state structures.
Rename __GLdispatchAPIState to __GLdispatchThreadState, to make it clearer that
the structure contains thread-specific data.

Updated some out-of-date comments.
2016-03-24 11:22:33 -06:00
Kyle Brenneman af2aeb0b42 Merge pull request #71 from evelikov/use-glproto
build: use system glproto headers
2016-03-21 14:47:05 -06:00