mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
vulkan/wsi: Check that xshm can be attached
Cc: mesa-stable Co-authored-by: Carlos Lopez <clopez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35284>
This commit is contained in:
parent
a67af81944
commit
4933e60bc2
1 changed files with 2 additions and 22 deletions
|
|
@ -352,29 +352,9 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev,
|
|||
wsi_conn->is_proprietary_x11 = true;
|
||||
|
||||
wsi_conn->has_mit_shm = false;
|
||||
#ifdef HAVE_X11_DRM
|
||||
#if defined(HAVE_X11_DRM) && defined(HAVE_SYS_SHM_H)
|
||||
if (wsi_conn->has_dri3 && wsi_conn->has_present && wants_shm) {
|
||||
bool has_mit_shm = shm_reply->present != 0;
|
||||
|
||||
xcb_shm_query_version_cookie_t ver_cookie;
|
||||
xcb_shm_query_version_reply_t *ver_reply;
|
||||
|
||||
ver_cookie = xcb_shm_query_version(conn);
|
||||
ver_reply = xcb_shm_query_version_reply(conn, ver_cookie, NULL);
|
||||
|
||||
has_mit_shm = ver_reply->shared_pixmaps;
|
||||
free(ver_reply);
|
||||
xcb_void_cookie_t cookie;
|
||||
xcb_generic_error_t *error;
|
||||
|
||||
if (has_mit_shm) {
|
||||
cookie = xcb_shm_detach_checked(conn, 0);
|
||||
if ((error = xcb_request_check(conn, cookie))) {
|
||||
if (error->error_code != BadRequest)
|
||||
wsi_conn->has_mit_shm = true;
|
||||
free(error);
|
||||
}
|
||||
}
|
||||
wsi_conn->has_mit_shm = x11_xcb_display_supports_xshm(conn);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue