summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-06-19 23:48:39 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-06-20 00:20:10 +0200
commit76216a154ffb1dcc4e03e56e9d290c2acce84891 (patch)
treeb3897c4b66bbffd288d335994cdc6cfa666c4247
parenta128355ecb5b782a69461a04991e4cffb32249db (diff)
egl_dri2/x11: Check availability of the dri2 extensionfix
Do this before query versions, or xcb will shutdown and the connection can not be used for swrast.
-rw-r--r--src/egl/drivers/dri2/platform_x11.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 8bff294c9e..4e00c958cb 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -479,10 +479,19 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
xcb_generic_error_t *error;
xcb_screen_iterator_t s;
char *driver_name, *device_name;
+ const xcb_query_extension_reply_t *extension;
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
+ extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
+ if (!(extension && extension->present))
+ return EGL_FALSE;
+
+ extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
+ if (!(extension && extension->present))
+ return EGL_FALSE;
+
xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
XCB_XFIXES_MAJOR_VERSION,
XCB_XFIXES_MINOR_VERSION);