Blame SOURCES/0027-glx-Set-ContextTag-for-all-contexts.patch

d05f4b
From 1607ac6870f7cf67c30b96529ea5ca389c771a3d Mon Sep 17 00:00:00 2001
d05f4b
From: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Date: Thu, 3 Jun 2021 17:51:01 +0200
d05f4b
Subject: [PATCH xserver 27/27] glx: Set ContextTag for all contexts
d05f4b
d05f4b
Currently, xorgGlxMakeCurrent() would set the context tag only for
d05f4b
indirect GLX contexts.
d05f4b
d05f4b
However, several other places expect to find a context for the tag or
d05f4b
they would raise a GLXBadContextTag error, such as WaitGL() or WaitX().
d05f4b
d05f4b
Set the context tag for direct contexts as well, to avoid raising an
d05f4b
error and possibly killing the client and set currentClient.
d05f4b
d05f4b
Thanks to Erik Kurzinger <ekurzinger@nvidia.com> for spotting the issue.
d05f4b
d05f4b
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
d05f4b
Reviewed-by: Adam Jackson <ajax@redhat.com>
d05f4b
(cherry picked from commit c468d34c7208c9041f9c077b54a00ae9cccad6a3)
d05f4b
(cherry picked from commit aad61e8e03311eb8bae4f7db59e65634733eadc2)
d05f4b
---
d05f4b
 glx/glxcmds.c | 5 +++--
d05f4b
 1 file changed, 3 insertions(+), 2 deletions(-)
d05f4b
d05f4b
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
d05f4b
index 1b9ad6d14..8b2170306 100644
d05f4b
--- a/glx/glxcmds.c
d05f4b
+++ b/glx/glxcmds.c
d05f4b
@@ -662,10 +662,11 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId,
d05f4b
             glxc->readPriv = NULL;
d05f4b
             return __glXError(GLXBadContext);
d05f4b
         }
d05f4b
+    }
d05f4b
 
d05f4b
+    glxServer.setContextTagPrivate(client, newContextTag, glxc);
d05f4b
+    if (glxc)
d05f4b
         glxc->currentClient = client;
d05f4b
-        glxServer.setContextTagPrivate(client, newContextTag, glxc);
d05f4b
-    }
d05f4b
 
d05f4b
     if (prevglxc) {
d05f4b
         prevglxc->currentClient = NULL;
d05f4b
-- 
d05f4b
2.31.1
d05f4b