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

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17155>
This commit is contained in:
Dave Airlie 2022-06-20 17:33:21 +10:00 committed by Marge Bot
parent d3e723fb77
commit 68e8940114

View File

@ -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);