1. 14 Feb, 2018 1 commit
    • Adam Jackson's avatar
      glx: Use vnd layer for dispatch (v4) · d8ec33fe
      Adam Jackson authored
      The big change here is MakeCurrent and context tag tracking. We now
      delegate context tags entirely to the vnd layer, and simply store a
      pointer to the context state as the tag data. If a context is deleted
      while it's current, we allocate a fake ID for the context and move the
      context state there, so the tag data still points to a real context. As
      a result we can stop trying so hard to detach the client from contexts
      at disconnect time and just let resource destruction handle it.
      Since vnd handles all the MakeCurrent protocol now, our request handlers
      for it can just be return BadImplementation. We also remove a bunch of
      LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already
      allocated its tracking resource on that XID.
      v2: Update to match v2 of the vnd import, and remove more redundant work
      like request length checks.
      v3: Add/remove the XID map from the vendor private thunk, not the
      backend. (Kyle Brenneman)
      v4: Fix deletion of ghost contexts (Kyle Brenneman)
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
  2. 20 Sep, 2017 1 commit
  3. 21 Aug, 2017 1 commit
  4. 20 Jun, 2017 2 commits
  5. 10 Apr, 2017 1 commit
  6. 21 Jun, 2016 1 commit
  7. 20 Jun, 2016 1 commit
    • Guilherme Quentel Melo's avatar
      glx: avoid memory leak when using indirect rendering · a134d1e7
      Guilherme Quentel Melo authored
      When multiple processes are using GL with indirect rendering a race
      condition can make drawables refcount never drop to zero.
      This situation could happen when there are many X clients using indirect
      1 - client1: calls glXMakeCurrent
      2 - client2: calls glXMakeCurrent
      This is the first context switch for this client. So old_context_tag=0
      3 - client1: calls glXRender
      For the client, its context is already current.
      For the server side lastGLContext points to client2's context.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: default avatarGuilherme Quentel Melo <gqmelo@gmail.com>
  8. 11 May, 2016 1 commit
    • Adam Jackson's avatar
      glx: Stop tracking hasUnflushedCommands · 3f569435
      Adam Jackson authored
      This is only meaningful for indirect contexts, and all it does is
      (maybe) prevent a flush when switching away from an indirect context.
      Indirect contexts aren't worth optimizing for, and Mesa tracks whether
      a flush is needed anyway.
      Careful readers will note that ReadPixels would reset the flag even
      though it doesn't imply a flush!
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
  9. 30 Mar, 2016 1 commit
  10. 05 Dec, 2014 2 commits
    • Jon Turney's avatar
      glx: Fix crash when a client exits without deleting GL contexts · bc71081f
      Jon Turney authored
      With the previous patches applied, we now have crash due to use-after-free when
      a client exits without deleting all it's GL contexts
      On client exit, CloseDownClient first calls glxClientCallback() with
      ClientStateGone, which calls __glXFreeContext() directly.
      Subsequently CloseDownClient() frees all the clients resources, which leads to
      ContextGone() being called for a context resource where the context has already
      been freed.
      Fix this by modifiying glxClientCallback() to free the context resource.
      Also make __glXFreeContext() static, as calling it directly leads to this
      problem, instead the context resource should be released.
      With the previous patches applied, this can be demonstrated with e.g. glxinfo,
      which doesn't delete it's context before exit.
      Signed-off-by: Jon Turney's avatarJon TURNEY <jon.turney@dronecode.org.uk>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    • Jon Turney's avatar
      glx: Flush context which is being made non-current due to drawable going away · 5c606c0a
      Jon Turney authored
      Some sequences of glean tests fail with GLXBadCurrentWindow when using indirect
      rendering, e.g. glean -t 'fpexceptions getString'.
      Flush a context which is being made non-current due to the drawable on which is
      it is current going away.  Waiting until another context is made current is too
      late, as the drawable no longer exists.
      v2: Rewrite for direct GL dispatch
      v3: Inline FlushContext(), doesn't need to be a separate function
      e.g. LIBGL_ALWAYS_INDIRECT=1  ./glean -r results -o --quick -t "fpexceptions
      getString" fails with a BadContextTag error.
      Signed-off-by: Jon Turney's avatarJon TURNEY <jon.turney@dronecode.org.uk>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
  11. 23 May, 2014 1 commit
    • Adam Jackson's avatar
      glx: Require at least one True/DirectColor visual · db2e708f
      Adam Jackson authored
      Mesa no longer supports rendering to anything less.  GLX 1.2 requires
      that the server advertise at least one GLX visual.  GLX 1.3 and 1.4 are
      more subtle: they require at least one fbconfig capable of window
      rendering, and _also_ require that window-capable fbconfigs have a
      non-zero value for the GLX_VISUAL_ID.  In either case we should refuse
      to init GLX if there's not at least one GL-capable visual on at least
      one screen.
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
  12. 23 Apr, 2014 3 commits
  13. 08 Feb, 2014 1 commit
  14. 12 Jan, 2014 1 commit
  15. 13 Dec, 2013 1 commit
  16. 10 Dec, 2013 1 commit
  17. 05 Dec, 2013 1 commit
  18. 29 Oct, 2013 3 commits
    • Adam Jackson's avatar
      glx: convert to direct GL dispatch (v2) · be668096
      Adam Jackson authored
      We now expect to be linked against something that provides the GL API,
      instead of manually grubbing about in the DRI driver's dispatch table.
      Since the GLX we expose calls GL functions that are meant to be looked
      up dynamically, also add a way to thunk through to GetProcAddress.
      This includes a refresh of the generated sources, which requires a
      correspondingly new Mesa.
      The GetProcAddress stubs are at the moment merely enough to make this
      link against Mesa 9.2, but should really be provided for everything not
      in the OpenGL 1.2 ABI.
      v2: Explicitly hide the GetProcAddress stubs so we can't conflict with
      libGL symbols; fix leading tab/space issues [anholt]
      Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    • Adam Jackson's avatar
      glx: Fix a corner case in DrawableGone · 53653f48
      Adam Jackson authored
      Losing the drawable does not change our notion of current client.  Since
      the GL under us doesn't understand having a current context without
      current drawables (sigh), we do still need to loseCurrent so that we
      re-bind the context on the next request.
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65030Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    • Adam Jackson's avatar
      glx: Fix memory leak in context garbage collection (v2) · 276d8057
      Adam Jackson authored
      I broke this, back in:
          commit a48dadc9
          Author: Adam Jackson <ajax@redhat.com>
          Date:   Mon Mar 21 11:59:29 2011 -0400
      	glx: Reimplement context tags
      In that, I changed the glx client state to not explicitly track the list
      of current contexts for the client (since that was what we were deriving
      tags from).  The bug was that I removed the code for same from
      glxClientCallback without noticing that it had the side effect of
      effectively de-currenting those contexts, so that ContextGone could free
      them.  So, if you had a client exit with a context still current, the
      context's memory would leak.  Not a huge deal for direct clients, but
      viciously bad for indirect, since the swrast context state at the bottom
      of Mesa is like 15M.
      Fix this by promoting Bool isCurrent to ClientPtr currentClient, so that
      we have a back-pointer to chase when walking the list of contexts when
      ClientStateGone happens.
      v2: Explicitly call __glXFreeContext on the ClientStateGone path.  Our
      current context might be one we got from EXT_import_context and whose
      creating client has since died.  Without the explicit call, the creating
      client's FreeClientResources would not free the context because it's
      still current, and the using client's FreeClientResources would not free
      the context because it's not an XID it created.  This matches the logic
      from a48dadc9.
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
  19. 11 Sep, 2013 1 commit
  20. 26 Jul, 2012 1 commit
  21. 12 Jul, 2012 1 commit
  22. 10 Jul, 2012 2 commits
  23. 23 May, 2012 2 commits
  24. 21 Mar, 2012 1 commit
    • Keith Packard's avatar
      Introduce a consistent coding style · 9838b703
      Keith Packard authored
      This is strictly the application of the script 'x-indent-all.sh'
      from util/modular. Compared to the patch that Daniel posted in
      January, I've added a few indent flags:
      	-T PrivatePtr
      	-T pmWait
      	-T _X_EXPORT
      The typedefs were needed to make the output of sdksyms.sh match the
      previous output, otherwise, the code is formatted badly enough that
      sdksyms.sh generates incorrect output.
      The generated code was compared with the previous version and found to
      be essentially identical -- "assert" line numbers and BUILD_TIME were
      the only differences found.
      The comparison was done with this script:
      for dir in $dir1 $dir2; do
      	(cd $dir && find . -name '*.o' | while read file; do
      		dir=`dirname $file`
      		base=`basename $file .o`
      		objdump -d $file > $dump
      find $dir1 -name '*.dump' | while read dump; do
      	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
      	diff -u $dump $otherdump
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Acked-by: Daniel Stone's avatarDaniel Stone <daniel@fooishbar.org>
      Acked-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
  25. 15 Apr, 2011 1 commit
  26. 28 Mar, 2011 4 commits
  27. 30 Nov, 2010 1 commit
  28. 28 Sep, 2010 1 commit
  29. 06 Jun, 2010 1 commit