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

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