Mesa (master): glx: Simplify error handling in glXImportContextEXT

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 2 16:23:42 UTC 2020


Module: Mesa
Branch: master
Commit: 97858f3c9c15882da5c2cbd4d8a2dbc63d1d0b1a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=97858f3c9c15882da5c2cbd4d8a2dbc63d1d0b1a

Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Dec  1 10:49:03 2020 -0500

glx: Simplify error handling in glXImportContextEXT

The GLXIsDirect request will throw GLXBadContext for us if it needs to,
so we can avoid synthesizing an error on the client side.

Acked-by: Michel Dänzer <mdaenzer at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7859>

---

 src/glx/glxcmds.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 4b96b38c28f..cf546cc86dd 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1421,15 +1421,9 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID)
     *     context then no error is generated but glXImportContextEXT returns
     *     NULL."
     *
-    * If contextID is None, generate BadContext on the client-side.  Other
-    * sorts of invalid contexts will be detected by the server in the
-    * __glXIsDirect call.
+    * We can handle both conditions with the __glXIsDirect call, because
+    * passing None to a GLXIsDirect request will throw GLXBadContext.
     */
-   if (contextID == None) {
-      __glXSendError(dpy, GLXBadContext, contextID, X_GLXIsDirect, false);
-      return NULL;
-   }
-
    if (__glXIsDirect(dpy, contextID, NULL))
       return NULL;
 



More information about the mesa-commit mailing list