From 538539d8791e5b3b1ea2e95473b589934d94497e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 9 Feb 2010 09:49:56 -0500 Subject: egl_dri2: Fix initialization with EGL_DEFAULT_DISPLAY --- src/egl/drivers/dri2/egl_dri2.c | 12 ++++++------ 1 file 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); -- cgit v1.2.3