1. 25 Oct, 2016 1 commit
  2. 18 Oct, 2016 1 commit
  3. 17 Oct, 2016 4 commits
    • Kyle Brenneman's avatar
      tests: Add a more extensive test for entrypoint patching. · a813b563
      Kyle Brenneman authored
      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.
      a813b563
    • Kyle Brenneman's avatar
      tests: Move the entrypoint patching code into a helper library. · dbfaa50b
      Kyle Brenneman authored
      Moved the code for testing entrypoint patching into a helper library so that
      it can be used for more than just GLX.
      dbfaa50b
    • Kyle Brenneman's avatar
      tests: Rename GLX_dummy directory. · 6bc8902d
      Kyle Brenneman authored
      Rename the GLX_dummy directory to just "dummy", since the code in it will be
      used for non-GLX tests.
      6bc8902d
    • Kyle Brenneman's avatar
      tests: Some minor cleanup · fa6a74c0
      Kyle Brenneman authored
      Added a separate script glxenv.sh for the common environment variables used by
      the other GLX tests.
      
      Removed the testx11glvndproto and testglxnscreens tests, since both of them
      depend on the x11glvnd X extension, which is no longer used.
      
      Removed the unused GLX_dummy_copy stuff from the GLX_dummy makefile. Also
      removed the COMMON_* variables, since they're only ever used once each.
      fa6a74c0
  4. 13 Oct, 2016 1 commit
    • Kyle Brenneman's avatar
      Factor out some common extension string functions. · 1cd6a431
      Kyle Brenneman authored
      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.
      1cd6a431
  5. 07 Oct, 2016 1 commit
  6. 10 Sep, 2016 1 commit
  7. 09 Sep, 2016 2 commits
  8. 31 Aug, 2016 1 commit
    • Kyle Brenneman's avatar
      EGL: Change the vendor config search paths. · ae89ac26
      Kyle Brenneman authored
      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.
      ae89ac26
  9. 30 Aug, 2016 3 commits
  10. 22 Aug, 2016 1 commit
    • Kyle Brenneman's avatar
      EGL: Fix a few errors in EGL_KHR_debug. · 6c4f5ef9
      Kyle Brenneman authored
      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.
      6c4f5ef9
  11. 19 Aug, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Keep track of the displays passed to glXMakeCurrent. · f7fbc4bb
      Kyle Brenneman authored
      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.
      f7fbc4bb
  12. 12 Aug, 2016 1 commit
    • Kyle Brenneman's avatar
      Change the package version to 0.1.999. · bc737615
      Kyle Brenneman authored
      Change the package version to 0.1.999 to distinguish the master branch from
      any release versions.
      
      Release versions will get their own branches and tags with a specific version
      number.
      
      This is likely a temporary arrangement. For the near future, any releases will
      likely be taken from specific commits in master that have gotten adequate
      testing. This provides an easy way to tag those releases.
      
      Using a large revision number for master ensures that other autoconf (or at
      least pkg-config based) builds that expect a minimum version number will also
      work with the latest master branch.
      bc737615
  13. 01 Aug, 2016 6 commits
    • Kyle Brenneman's avatar
      EGL: Trim the dispatch stub list. · 1cdf2460
      Kyle Brenneman authored
      Reduce the dispatch stubs in EGL to only include core functions and client
      extensions. Any other functions should be provided by the vendor libraries.
      1cdf2460
    • Kyle Brenneman's avatar
      EGL: Check the version number in the JSON files. · 67dcf4a1
      Kyle Brenneman authored
      libEGL will now parse the file_format_version value in each vendor's JSON file.
      67dcf4a1
    • Kyle Brenneman's avatar
      EGL: Check for some client extensions when loading the vendors. · 4f7138cc
      Kyle Brenneman authored
      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.
      4f7138cc
    • Kyle Brenneman's avatar
      EGL: Improve eglGetDisplay platform guessing. · 93ac333b
      Kyle Brenneman authored
      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.
      93ac333b
    • Kyle Brenneman's avatar
      EGL: Fix a crash in __eglGetVendorFromDevice. · d4482320
      Kyle Brenneman authored
      Check if the __EGLdeviceInfo pointer is actually valid before trying to
      dereference it.
      d4482320
    • Kyle Brenneman's avatar
      EGL: Rework the current rendering API. · f42d89dd
      Kyle Brenneman authored
      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.
      f42d89dd
  14. 19 Jul, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Fix a deadlock in teardown · bb63d820
      Kyle Brenneman authored
      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.
      bb63d820
  15. 13 Jul, 2016 2 commits
  16. 22 Jun, 2016 6 commits
    • Kyle Brenneman's avatar
      EGL: Implement EGL_KHR_debug. · 31c5e7f6
      Kyle Brenneman authored
      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.
      31c5e7f6
    • Kyle Brenneman's avatar
      EGL: Initial implementation of libEGL. · b72018f5
      Kyle Brenneman authored
      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.
      b72018f5
    • Kyle Brenneman's avatar
      Checked in a copy of the cJSON library. · 382eb05e
      Kyle Brenneman authored
      This will be used to parse JSON config files that will describe the available
      vendor libraries for EGL.
      382eb05e
    • Kyle Brenneman's avatar
      Checked in the EGL headers. · 3c97019e
      Kyle Brenneman authored
      3c97019e
    • Kyle Brenneman's avatar
      82c37ca4
    • Kyle Brenneman's avatar
      tests: Fix testpatchentrypoints. · 73b38ce8
      Kyle Brenneman authored
      In testpatchentrypoints, remove the additional calls to glVertex3fv after
      releasing the current context.
      
      libGLdispatch doesn't unpatch entrypoints from __glDispatchLoseCurrent anymore,
      so those calls will still increment the __glXSawVertex3fv counter.
      
      This means that it no longer tests entrypoint unpatching, but fixing that would
      require multiple vendor libraries, which with GLX requires multiple screens.
      73b38ce8
  17. 14 Jun, 2016 1 commit
  18. 10 Jun, 2016 1 commit
  19. 31 May, 2016 1 commit
    • Kyle Brenneman's avatar
      GLdispatch: Don't unpatch entrypoints in __glDispatchLoseCurrent. · 1b30d153
      Kyle Brenneman authored
      
      
      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's avatarJames Jones <jajones@nvidia.com>
      1b30d153
  20. 27 May, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Fix a couple of errors. · d0ced9a2
      Kyle Brenneman authored
      Moved the unlock in __glXLookupVendorByName to after the calls to update the
      GLX entrypoints.
      
      Fixed a typo in GLXEntrypointUpdateCallback.
      d0ced9a2
  21. 20 May, 2016 3 commits