From 68e89401140d1b3a17052899c54577de3f008b67 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 Jun 2022 17:33:21 +1000 Subject: [PATCH] glx/drisw: use xcb instead of X to query connection Reviewed-by: Adam Jackson Part-of: --- 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);