diff options
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 8b01b8453e7..92378892e5b 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -404,13 +404,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, return _eglError(EGL_BAD_ALLOC, "eglInitialize"); disp->DriverData = (void *) dri2_dpy; - dri2_dpy->conn = XGetXCBConnection(disp->NativeDisplay); - if (!dri2_dpy->conn) { + if (disp->NativeDisplay != NULL) + dri2_dpy->conn = XGetXCBConnection(disp->NativeDisplay); + else dri2_dpy->conn = xcb_connect(0, 0); - if (!dri2_dpy->conn) { - _eglLog(_EGL_WARNING, "DRI2: xcb_connect failed"); - goto cleanup_dpy; - } + if (!dri2_dpy->conn) { + _eglLog(_EGL_WARNING, "DRI2: xcb_connect failed"); + goto cleanup_dpy; } xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id); |