1. 23 Aug, 2022 1 commit
  2. 07 Jun, 2022 3 commits
  3. 02 Jun, 2022 1 commit
  4. 01 Jun, 2022 3 commits
  5. 17 May, 2022 2 commits
    • Kyle Brenneman's avatar
      Fix a memory leak in libGLdispatch · 70e6a300
      Kyle Brenneman authored
      In __glDispatchMakeCurrent, it allocates a
      __GLdispatchThreadStatePrivate struct, which would normally get freed in
      __glDispatchLoseCurrent.
      
      However, if the library gets unloaded while another thread still has a
      current context, then __glDispatchLoseCurrent never gets called, and so
      that memory leaks.
      
      Add the __GLdispatchThreadStatePrivate to a linked list so that it can
      free any remaining structs in __glDispatchFini.
      
      Fixes glvnd/libglvnd#230.
      70e6a300
    • Kyle Brenneman's avatar
      Add a unit test for cleaning up EGL thread state. · c1fde198
      Kyle Brenneman authored
      Added a new test program, eglcurrentcleanup, which tests thread and
      process termination while a thread still has a current context.
      c1fde198
  6. 08 Apr, 2022 2 commits
  7. 21 Mar, 2022 1 commit
  8. 15 Mar, 2022 1 commit
  9. 14 Mar, 2022 2 commits
    • Aidan Foster's avatar
      Update src/EGL/libeglcurrent.c · 1f2bfbb6
      Aidan Foster authored
      1f2bfbb6
    • Aidan Foster's avatar
      Set current thread state to NULL in teardown · 4834bd26
      Aidan Foster authored
      In the EGL destructor, DestroyThreadState gets called by
      __eglCurrentTeardown to free the threadState, but the threadState does
      not get changed to NULL when this happens.
      
      The function eglReleaseThread calls __eglDestroyCurrentThreadAPIState,
      which does set the threadState to NULL, right before calling
      DestroyThreadState. Both eglReleaseThread and
      __eglDestroyCurrentThreadAPIState check to make sure the threadState is
      NULL before continuing.
      
      If eglReleaseThread gets externally called after destruction, the
      threadState is not NULL, so DestroyThreadState will be called to free
      the threadState that was already freed by the destructor, causing a
      double free.
      
      This change is to add the same setting threadState to NULL in
      __eglCurrentTeardown as which already __eglDestroyCurrentThreadAPIState,
      to prevent this double free situation.
      4834bd26
  10. 24 Feb, 2022 2 commits
  11. 07 Feb, 2022 1 commit
  12. 06 Feb, 2022 1 commit
  13. 17 Dec, 2021 2 commits
  14. 07 Dec, 2021 1 commit
  15. 06 Dec, 2021 1 commit
    • Dylan Baker's avatar
      meson: use required : feature option correclty · 9d09a1a2
      Dylan Baker authored
      The code here is a complicated way to write exactly the same thing. If
      `get_option('x11')` returns `disabled`, ie `-Dx11=disabled` then
      `dependency()` short circuits and returns a not found object (just like
      `dependency('', required : false)`, but with the correct name for error
      messages).
      9d09a1a2
  16. 29 Nov, 2021 1 commit
    • Kyle Brenneman's avatar
      EGL: Add support for eglQueryDisplayAttribKHR and NV. · db5ca337
      Kyle Brenneman authored
      There are KHR, EXT, and NV versions of eglQueryDisplayAttrib, so add
      support for all of them.
      
      Define separate eglQueryDisplayAttribEXT, eglQueryDisplayAttribKHR, and
      eglQueryDisplayAttribNV functions. They all call into the same common
      function, with the only difference being the name passed to an error
      callback.
      
      When loading a vendor library, check for the vendor's
      eglQueryDisplayAttrib using all three suffixes, and use whichever one is
      available.
      db5ca337
  17. 26 Nov, 2021 1 commit
  18. 25 Nov, 2021 8 commits
    • Kyle Brenneman's avatar
      tests: Add unit test for eglQueryDisplayAttribEXT. · 288eb48c
      Kyle Brenneman authored
      Extended testegldeviceadd to be able to test calling eglQueryDisplayAttribEXT
      to return a new EGLDeviceEXT handle.
      288eb48c
    • Kyle Brenneman's avatar
      tests: Implement EGL_EXT_device_query in the dummy vendor. · a5688ef2
      Kyle Brenneman authored
      Added implementations for eglQueryDisplayAttribEXT, eglQueryDeviceAttribEXT,
      and eglQueryDeviceStringEXT.
      
      Defined a new EGL_DEVICE_INDEX attribute for eglGetPlatformDisplay that uses
      a device based on its index. This will allow us to test the case where
      eglQueryDisplayAttribEXT returns an EGLDeviceEXT handle that libglvnd hasn't
      seen before.
      a5688ef2
    • Kyle Brenneman's avatar
      tests: Added unit tests for adding new EGLDisplayEXT handles. · af3f7e9c
      Kyle Brenneman authored
      Added a new test program, testegldeviceadd, which tests a vendor library adding
      a new EGLDeviceEXT handle after the application calls eglQueryDevicesEXT.
      
      It's got two subtests right now. "querydevices" will test returning the new
      device through a second eglQueryDevicesEXT call. "returndevice" tests returning
      the new device through a vendor-provided dispatch stub.
      af3f7e9c
    • Kyle Brenneman's avatar
      tests: Update EGL test helpers to match the new EGL dummy vendor functions. · 01316ea9
      Kyle Brenneman authored
      Updated egl_test_utils.c/h to include the new eglTestReturnDevice function.
      
      Added functions to egl_test_utils.c/h to load each vendor's DummySetDeviceCount
      function using dlopen+dlsym.
      01316ea9
    • Kyle Brenneman's avatar
      tests: Add initial support for adding new devices to EGL_dummy. · 6d43e9ba
      Kyle Brenneman authored
      Added a new function to the EGL dummy vendor called DummySetDeviceCount, which
      will change the number of devices that it hands back for eglQueryDevicesEXT.
      
      Also added a new dummy extension function, eglTestReturnDevice, which will
      dispatch based on an EGLDisplay and return an EGLDeviceEXT handle. This is
      used to test the new __EGLapiExports::setVendorForDevice function.
      6d43e9ba
    • Kyle Brenneman's avatar
      EGL: Add a dispatch stub for eglQueryDisplayAttribEXT. · eaffa7bc
      Kyle Brenneman authored
      Add a dispatch stub for eglQueryDisplayAttribEXT, which updates the device
      hashtable if the application queries EGL_DEVICE_EXT.
      
      It's possible that eglQueryDisplayAttribEXT could return an EGLDeviceEXT handle
      that wasn't returned by eglQueryDevicesEXT, so the dispatch stub needs to add
      the handle to the device hashtable.
      eaffa7bc
    • Kyle Brenneman's avatar
      EGL: Allow vendor's dispatch stubs to update the EGL device map. · 26d15a9f
      Kyle Brenneman authored
      Export a new __EGLapiExports::setVendorForDevice function, which allows
      dispatch stubs to update the device hashtable when something returns an
      EGLDeviceEXT handle.
      
      Bumped the ABI version number to 1.2.
      26d15a9f
    • Kyle Brenneman's avatar
      EGL: Allow adding EGLDeviceEXT handles · 2747fcd3
      Kyle Brenneman authored
      It's possible for new devices to become available while a program is running,
      so eglQueryDevicesEXT might need to return a different list.
      
      Change the EGLDeviceEXT hashtable so that each entry is allocated and added
      separately, rathat than allocating every entry in a single malloc.
      
      Added a new __eglAddDevice function, which adds an entry to the device
      hashtable.
      
      When the application calls eglQueryDevicesEXT, always call through to each
      vendor library, and add (or update) each EGLDeviceEXT to the hashtable.
      
      There's still no provision for removing an entry from the device hashtable. The
      semantics of hot-unplugging a device aren't defined yet, and there's no way to
      ensure that libglvnd's mapping will get updated if a device disappears
      asynchonously, so it's up to the vendor library to deal with the old handle.
      2747fcd3
  19. 28 Oct, 2021 2 commits
  20. 27 Oct, 2021 4 commits