1. 30 Mar, 2020 1 commit
  2. 23 Mar, 2020 1 commit
    • Vasily Khoruzhick's avatar
      glx: fixup symbol name for get_extensions function · b56e5010
      Vasily Khoruzhick authored
      glxProbeDriver() concatenates __DRI_DRIVER_GET_EXTENSIONS with driver name
      to get symbol name for get_extension function. Unfortunately that doesn't
      work for drivers that have hyphen in their name, e.g. sun4i-drm --
      get_extensions() for these uses underscore instead.
      
      As result dlsym() doesn't find get_extension() function and AIGLX
      initialization fails resulting in following message in Xorg.0.log:
      
      (EE) AIGLX error: sun4i-drm does not export required DRI extension
      
      Replace all non-alpha-numeric characters with underscore to fix the issue.
      Signed-off-by: Vasily Khoruzhick's avatarVasily Khoruzhick <anarsoul@gmail.com>
      b56e5010
  3. 28 Jan, 2020 1 commit
  4. 30 Oct, 2019 1 commit
    • Adam Jackson's avatar
      dix: Call SourceValidate before GetImage · 516e75db
      Adam Jackson authored
      This ensures that any prep work for the drawable we're about to read
      from is already done before we call down to GetImage. This should be no
      functional change as most of the callers with a non-trivial
      SourceValidate are already wrapping GetImage and doing the equivalent
      thing, but we'll be simplifying that shortly.
      
      More importantly this ensures that if any of that prep work would
      generate events - like automatic compositing flushing rendering to a
      parent pixmap which then triggers damage - then it happens entirely
      before we start writing the GetImage reply header.
      
      Note that we do not do the same for GetSpans, but that's okay. The only
      way to get to GetSpans is through miCopyArea or miCopyPlane - where the
      callers must already call SourceValidate - or miGetImage - which this
      commit now protects with SourceValidate.
      
      Fixes: #902Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      516e75db
  5. 09 Oct, 2019 2 commits
  6. 08 Oct, 2019 1 commit
    • Marvin Schmidt's avatar
      build: glx: Lower gl version to work with libglvnd · e6ef2b12
      Marvin Schmidt authored
      When using mesa with libglvnd support, mesa will no longer install the
      gl, glx, egl pkg-config files but instead let libglvnd provide them.
      libglvnd maintainers decided to change the versioning as it was
      mesa-specific previously. Now the libraries have versions of the API
      they expose[1].
      This causes problems when building the X server:
      
        checking for glproto >= 1.4.17 gl >= 9.2.0... no
        configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met:
      
        Requested 'gl >= 9.2.0' but version of gl is 1.2
      
      Lower the version requirement to 1.2 to allow building against libglvnd
      provided libraries
      
      [1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba
      e6ef2b12
  7. 26 Aug, 2019 1 commit
    • Adam Jackson's avatar
      glx: Disable GLX_EXT_import_context if !enableIndirectGLX · f8c85961
      Adam Jackson authored
      GLX_EXT_import_context allows multiple clients to share the same
      indirect context. If you can't create an indirect context, you're
      certainly not going to be able to share one. Hide the extension from the
      server string if we've disabled indirect contexts.
      
      This turns piglit's tests from fail to skip when indirect contexts are
      disabled. Since GLX_EXT_import_context has been supported in
      xfree86-derived servers since day 1 (it was included in the initial GLX
      code drop from SGI), this is now also a hint to the client that indirect
      contexts are unlikely to work at all.
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel@daenzer.net>
      f8c85961
  8. 20 Aug, 2019 1 commit
    • Adam Jackson's avatar
      glx: Fix previous context validation in xorgGlxMakeCurrent · 95dcc81c
      Adam Jackson authored
      vnd has already verified that the context tag is valid before this gets
      called, and we only set the context tag private data to non-null for
      indirect clients. Mesa happens to be buggy and doesn't send MakeCurrent
      requests nearly as much as it should for direct contexts, but if you fix
      that, then unbinding a direct context would fail here with
      GLXBadContextTag.
      
      Sadly Mesa will still need to carry a workaround here for broken
      servers, but we should still fix the server.
      95dcc81c
  9. 21 May, 2019 1 commit
  10. 17 May, 2019 3 commits
  11. 14 May, 2019 1 commit
    • Adam Jackson's avatar
      glx: Fix potential crashes in glXWait{GL,X} · 2aec5c3c
      Adam Jackson authored
      glxc->drawPriv will be NULL if the context is direct, or if it is
      current but without a bound drawable. Mesa's libGL won't normally emit
      protocol for direct contexts for these calls, but a malign client could
      still crash the server.
      2aec5c3c
  12. 01 May, 2019 1 commit
  13. 30 Apr, 2019 1 commit
  14. 16 Jan, 2019 1 commit
  15. 10 Sep, 2018 1 commit
    • Olivier Fourdan's avatar
      glx: check for indirect context in CreateContextAttribsARB() · 75448671
      Olivier Fourdan authored
      Commit 99f0365b "Add a command line argument for disabling indirect GLX"
      added a test to check if indirect context are enabled in
      `DoCreateContext()` but `__glXDisp_CreateContextAttribsARB()` doesn't
      use `DoCreateContext()` and doesn't check if indirect context is
      enabled.
      
      As a result, clients can still manage to create indirect contexts using
      `glXCreateContextAttribsARB()` even if indirect contexts are disabled,
      which can possibly crash Xservers such as Xwayland or Xephyr when the
      context is destroyed.
      
      To avoid the issue, check for `enableIndirectGLX` in
      `__glXDisp_CreateContextAttribsARB()` as well.
      
      Fixes: 99f0365b "Add a command line argument for disabling indirect GLX"
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107508Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      75448671
  16. 21 Jun, 2018 1 commit
  17. 08 May, 2018 1 commit
  18. 24 Apr, 2018 2 commits
  19. 19 Apr, 2018 1 commit
  20. 10 Apr, 2018 1 commit
  21. 09 Apr, 2018 1 commit
    • Kyle Brenneman's avatar
      GLX: Fix a use after free error with the GLVND vendor handle. · e0a137ce
      Kyle Brenneman authored
      The GLVND layer will destroy all of the vendor handles at the end of each
      server generation, but the GLX module then tries to re-use the same (now-freed)
      handle in xorgGlxServerInit at the start of the next generation.
      
      In xorgGlxCloseExtension, explicitly destroy the vendor handle and set it to
      NULL so that the next call to xorgGlxServerInit will recreate it.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      e0a137ce
  22. 02 Apr, 2018 1 commit
  23. 28 Mar, 2018 1 commit
    • Kyle Brenneman's avatar
      Don't delete GLX's extensionInitCallback list during a reset. · 16639ab7
      Kyle Brenneman authored
      When a callback list is initialized using CreateCallbackList via AddCallback,
      the list gets added to the listsToCleanup array, and as a result the list gets
      deleted at the end of the server generation.
      
      But, vendor libraries add themselves to that callback list only once, not once
      per generation, so if you delete the list, then no vendor will register itself
      on the next generation, and GLX breaks.
      
      Instead, use a static CallbackListRec for the extensionInitCallback list. That
      way, it doesn't get added to listsToCleanup, and doesn't get deleted during a
      reset.
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      16639ab7
  24. 21 Mar, 2018 1 commit
  25. 28 Feb, 2018 1 commit
  26. 26 Feb, 2018 3 commits
  27. 21 Feb, 2018 4 commits
  28. 14 Feb, 2018 4 commits
    • Adam Jackson's avatar
      dri2: warning fix · 9bcddaf9
      Adam Jackson authored
      /home/ajax/git/xserver/at/../glx/glxdri2.c: In function ‘create_driver_context’:
      /home/ajax/git/xserver/at/../glx/glxdri2.c:444:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
           const __DRIconfig *driConfig = config ? config->driConfig : NULL;
      
      I don't know why autotools has decided not to be C99 but at least it's
      trivial to fix.
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      9bcddaf9
    • Adam Jackson's avatar
      glx: Large commands are context state, not client state · 133bd444
      Adam Jackson authored
      There's no reason a multithreaded client shouldn't be allowed to
      interleave other requests (for other contexts) with a RenderLarge. Move
      the check into __glXForceCurrent, and store the state in the context not
      the client.
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      133bd444
    • 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>
      d8ec33fe
    • Kyle Brenneman's avatar
      glx: Import glxvnd server module (v2) · 8753218b
      Kyle Brenneman authored
      This is based on an out-of-tree module written by Kyle:
      
      https://github.com/kbrenneman/libglvnd/tree/server-libglx
      
      I (ajax) did a bunch of cosmetic fixes, ported it off xfree86 API,
      added request length checks, and fixed a minor bug or two.
      
      v2: Use separate functions to set/get a context tag's private data, and
      call the backend's MakeCurrent when a client disconnects to unbind the
      context. (Kyle Brenneman)
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      8753218b