Mesa (main): glx/drisw: use xcb instead of X to query connection

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 22 04:01:48 UTC 2022


Module: Mesa
Branch: main
Commit: 68e89401140d1b3a17052899c54577de3f008b67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=68e89401140d1b3a17052899c54577de3f008b67

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jun 20 17:33:21 2022 +1000

glx/drisw: use xcb instead of X to query connection

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>

---

 src/glx/drisw_glx.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 9d3bfeb31b9..bef171c1ebd 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -863,9 +863,16 @@ check_xshm(Display *dpy)
    xcb_void_cookie_t cookie;
    xcb_generic_error_t *error;
    int ret = True;
-   int ignore;
+   xcb_query_extension_cookie_t shm_cookie;
+   xcb_query_extension_reply_t *shm_reply;
+   bool has_mit_shm;
 
-   if (!XQueryExtension(dpy, "MIT-SHM", &xshm_opcode, &ignore, &ignore))
+   shm_cookie = xcb_query_extension(c, 7, "MIT-SHM");
+   shm_reply = xcb_query_extension_reply(c, shm_cookie, NULL);
+
+   has_mit_shm = shm_reply->present;
+   free(shm_reply);
+   if (!has_mit_shm)
       return False;
 
    cookie = xcb_shm_detach_checked(c, 0);



More information about the mesa-commit mailing list