xcb_screen_iterator_t s;
xcb_generic_error_t *error;
xcb_drawable_t drawable;
+ xcb_screen_t *screen;
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_surface));
drawable = (uintptr_t) native_surface;
dri2_surf->region = XCB_NONE;
if (type == EGL_PBUFFER_BIT) {
+ screen = get_xcb_screen(s, dri2_dpy->screen);
+ if (!screen) {
+ _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
+ goto cleanup_surf;
+ }
+
dri2_surf->drawable = xcb_generate_id(dri2_dpy->conn);
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
xcb_create_pixmap(dri2_dpy->conn, conf->BufferSize,
- dri2_surf->drawable,
- get_xcb_screen(s, dri2_dpy->screen)->root,
+ dri2_surf->drawable, screen->root,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
dri2_surf->drawable = drawable;
xcb_dri2_connect_cookie_t connect_cookie;
xcb_generic_error_t *error;
xcb_screen_iterator_t s;
+ xcb_screen_t *screen;
char *driver_name, *device_name;
const xcb_query_extension_reply_t *extension;
XCB_DRI2_MINOR_VERSION);
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
- connect_cookie = xcb_dri2_connect_unchecked(dri2_dpy->conn,
- get_xcb_screen(s, dri2_dpy->screen)->root,
+ screen = get_xcb_screen(s, dri2_dpy->screen);
+ if (!screen) {
+ _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_x11_connect");
+ return EGL_FALSE;
+ }
+ connect_cookie = xcb_dri2_connect_unchecked(dri2_dpy->conn, screen->root,
XCB_DRI2_DRIVER_TYPE_DRI);
xfixes_query =
xcb_dri2_authenticate_reply_t *authenticate;
xcb_dri2_authenticate_cookie_t authenticate_cookie;
xcb_screen_iterator_t s;
+ xcb_screen_t *screen;
int ret = 0;
s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
+
+ screen = get_xcb_screen(s, dri2_dpy->screen);
+ if (!screen) {
+ _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_x11_authenticate");
+ return -1;
+ }
+
authenticate_cookie =
- xcb_dri2_authenticate_unchecked(dri2_dpy->conn,
- get_xcb_screen(s, dri2_dpy->screen)->root, id);
+ xcb_dri2_authenticate_unchecked(dri2_dpy->conn, screen->root, id);
authenticate =
xcb_dri2_authenticate_reply(dri2_dpy->conn, authenticate_cookie, NULL);