1. 18 May, 2016 4 commits
    • Kyle Brenneman's avatar
      GLX: Generate some of the GLX functions. · eac99fe8
      Kyle Brenneman authored
      Use the gen_glx_dispatch.py script to generate some of the GLX entrypoints for
      libGLX.
      eac99fe8
    • Kyle Brenneman's avatar
      src/vendor: Rework the function arrays. · 9dec3e6b
      Kyle Brenneman authored
      Use a binary search to look up a function index by name.
      
      Add a dummy element to the __glXDispatchFuncIndices, __GLX_DISPATCH_FUNC_NAMES,
      and __GLX_DISPATCH_FUNCS arrays. This allows us to remove the (index >= 0)
      checks.
      
      Both changes are based on equivalent changes from Mesa.
      9dec3e6b
    • Kyle Brenneman's avatar
      Add a script to generate GLX dispatch stubs. · c81a4544
      Kyle Brenneman authored
      Added a script, gen_glx_dispatch.py, which can generate the GLX dispatch stubs
      that a vendor library provides.
      c81a4544
    • Kyle Brenneman's avatar
      Merge branch 'libglx-glXGetProcAddress-fixes' · a82982d9
      Kyle Brenneman authored
      
      
      Various cleanup and fixes for glXGetProcAddress and the GLX dispatch tables.
      
      Simplified the code paths behind glXGetProcAddress.
      
      Moved the GLX dispatch table handling to a new file under src/util, so that it
      will be usable for EGL.
      
      libGLX will now provide a dispatch index for every GLX function (including core
      functions) to every vendor library. This is useful for functions like
      glXCreateContextAttribsARB, where it allows the GLX dispatch stub to destroy
      the context if the call to addVendorContextMapping fails.
      Reviewed-by: default avatarAndy Ritger <aritger@nvidia.com>
      a82982d9
  2. 17 May, 2016 8 commits
    • Kyle Brenneman's avatar
      GLX: Some additional cleanup for the GLX dispatch table. · 17f55660
      Kyle Brenneman authored
      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.
      17f55660
    • Kyle Brenneman's avatar
      GLX: Move the vendor GLX dispatch table to winsys_dispatch.c. · 968349de
      Kyle Brenneman authored
      Remove the __GLXvendorInfo::dynDispatchHash hashtable, and replace it with a
      dispatch table from winsys_dispatch.
      968349de
    • Kyle Brenneman's avatar
      Add functions to keep track of a vendor library's GLX functions. · edd36498
      Kyle Brenneman authored
      Added functions to create and manage a per-vendor dispatch table for
      window-system functions.
      
      These will replace the __GLXdispatchFuncHash hashtable in GLX.
      edd36498
    • Kyle Brenneman's avatar
      GLX: Clean up __glXFetchDispatchEntry. · 39070d4e
      Kyle Brenneman authored
      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.
      39070d4e
    • Kyle Brenneman's avatar
      GLX: Fix a race condition in the glXGetProcAddress cache. · b6a1d5a5
      Kyle Brenneman authored
      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.
      b6a1d5a5
    • Kyle Brenneman's avatar
      GLX: Assign indices to the GLX dispatch functions defined in libGLX. · 774c9b25
      Kyle Brenneman authored
      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.
      774c9b25
    • Kyle Brenneman's avatar
      GLX: Use winsys_dispatch to keep track of GLX dispatch stubs. · 8167e35e
      Kyle Brenneman authored
      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.
      8167e35e
    • Kyle Brenneman's avatar
      Add helper functions for keeping track of the window-system dispatch stubs. · 4d20b182
      Kyle Brenneman authored
      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.
      4d20b182
  3. 11 May, 2016 2 commits
    • Kyle Brenneman's avatar
      Remove the reference to glx.h from libopengl.c. · 509de0db
      Kyle Brenneman authored
      libOpenGL doesn't contain anything GLX-specific, so it doesn't need anything
      defined in glx.h.
      509de0db
    • Kyle Brenneman's avatar
      Merge pull request #84 from kbrenneman/fix-automake-warnings · d4154859
      Kyle Brenneman authored
      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.
      d4154859
  4. 04 May, 2016 3 commits
  5. 26 Apr, 2016 1 commit
  6. 24 Apr, 2016 1 commit
    • Thomas Andersen's avatar
      GLX: fix a read after free · b0b4e351
      Thomas Andersen authored
      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.
      b0b4e351
  7. 23 Apr, 2016 1 commit
  8. 19 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      Move vnd-glapi/mapi/* to vnd-glapi. · fa2add82
      Kyle Brenneman authored
      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.
      fa2add82
  9. 07 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      GLESv1: Statically export glPointSizePointerOES. · 65440c05
      Kyle Brenneman authored
      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.
      65440c05
  10. 06 Apr, 2016 6 commits
  11. 05 Apr, 2016 1 commit
  12. 04 Apr, 2016 1 commit
  13. 03 Apr, 2016 1 commit
  14. 01 Apr, 2016 1 commit
    • Kyle Brenneman's avatar
      GLX: Don't call into the vendor library from __glXFini. · b7d75429
      Kyle Brenneman authored
      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.
      b7d75429
  15. 30 Mar, 2016 3 commits
  16. 29 Mar, 2016 1 commit
    • Kyle Brenneman's avatar
      Add support for reporting application errors. · e2d44985
      Kyle Brenneman authored
      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.
      e2d44985
  17. 28 Mar, 2016 3 commits
  18. 24 Mar, 2016 1 commit
    • Kyle Brenneman's avatar
      Remove the x11glvnd extension. · 1d7ab91b
      Kyle Brenneman authored
      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.
      1d7ab91b