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.
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/
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.
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.
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>
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.
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.
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.
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
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.
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>
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.
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>
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>
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.
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.
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.
Replaced testpatchentrypoints_gldispatch with three new unit tests.
testgldispatch_static and testgldispatch_generated test dispatching to multiple
vendor libraries through static and generated dispatch stubs, respectively.
testgldispatch_generated tests entrypoint patching and unpatching. This adds
coverage for patching generated stubs in addition to the static ones.
The entrypoint patching functions in tests/dummy/patchentrypoints.c now take
the name of the function to patch, instead of hard-coding it to only patch
glVertex3fv.