Commit graph

24 commits

Author SHA1 Message Date
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
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
Ben Crocker 962fc1a161 tests: Fill in the ASM code in the template in patch_ppc64le().
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
2017-04-24 11:50:07 -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 8e6e102820 Merge branch 'x32-support'
Fixes https://github.com/NVIDIA/libglvnd/issues/115
2017-03-08 13:41:29 -07:00
Kyle Brenneman bb3d4a044c tests: Add support for x32.
Update the entrypoint patching tests to work on an x32 build. On x32, it'll use
the same patching as it would for x86-64.
2017-03-08 13:40:00 -07:00
Kyle Brenneman 8b7a44fb6d tests: Expand the unit tests for libGLdispatch.
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.
2017-02-28 16:37:36 -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 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 152ba20ff1 tests: Clean up tests makefile.
Split up the TESTS and check_PROGRAMS variable assignments, so that they're
assigned next to the commands to build each test.

In addition to better readability and making it easier to avoid merge
conflicts, this will allow making some of the tests conditional based on build
options.
2016-12-13 15:36:31 -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 260a54606c tests: Add a test for EGL_KHR_debug. 2016-11-02 17:03:33 -06:00
Kyle Brenneman 359c99d547 tests: Add a test for eglGetError.
Add a test to check libEGL's error reporting, including errors reported by a
vendor library.
2016-11-02 17:03:31 -06:00
Kyle Brenneman b892485054 tests: Add a test for eglMakeCurrent.
Add a test for switching between different contexts across multiple vendors.
The new test also checks libEGL's recovery when a vendor's eglMakeCurrent
fails.

The EGL dummy vendor will now keep track of the current context, so that we
can test whether eglMakeCurrent calls get passed through correctly.

Also added a command to force an eglMakeCurrent call to fail, and to fetch the
the current context from directly from a vendor library.
2016-11-02 17:03:29 -06:00
Kyle Brenneman cd186e8479 tests: Add a test for EGL device functions.
Added a test for EGL_EXT_device_enumeration and EGL_EXT_platform_device, plus
dispatching to an EGL extesnion function based on an EGLDeviceEXT handle.
2016-11-02 17:03:27 -06:00
Kyle Brenneman 579e0acdb0 tests: Add a test for eglGetProcAddress.
Added a test for eglGetProcAddress and dispatching for EGL and GL functions.

Added three EGL extension functions to the EGL dummy vendor, to test
dispatching extensions by display, device, and current context.

Added a simple implementation of eglCreateContext, eglDestroyContext, and
eglMakeCurrent, and glGetString.
2016-11-02 17:03:18 -06:00
Kyle Brenneman 3e7bba599f tests: Add a basic test for eglGetPlatformDisplay.
Added two dummy libraries for EGL. They both use the same code, but each one
has a name string that can be used to check which vendor something is
dispatched to.

The dummy library is still incomplete, but more functions will be add later
along with more tests.

The test just creates an EGLDisplay using a dummy platform type, and then
checks to make sure that the display dispatches to the correct vendor library.

Also added a script to set up the test environment, and a file for common
functions and variables for EGL tests.
2016-11-02 16:37:55 -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 a813b56339 tests: Add a more extensive test for entrypoint patching.
Add a new unit test, testpatchentrypoints_gldispatch. It calls into
libGLdispatch directly instead of going through GLX or EGL, and it tests
patching and unpatching between multiple vendor libraries.

Rewrote the x86-64 assembly for the entrypoint patching tests. It now uses
absolute memory addresses instead of RIP-relative, so it can work even if the
variable that it's supposed to update isn't within +-2GB of the function.
2016-10-17 11:12:21 -06:00
Kyle Brenneman dbfaa50bd8 tests: Move the entrypoint patching code into a helper library.
Moved the code for testing entrypoint patching into a helper library so that
it can be used for more than just GLX.
2016-10-17 11:12:21 -06:00
Kyle Brenneman 6bc8902de8 tests: Rename GLX_dummy directory.
Rename the GLX_dummy directory to just "dummy", since the code in it will be
used for non-GLX tests.
2016-10-17 11:12:21 -06:00