diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-09 09:49:56 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2010-02-09 09:51:05 -0500 |
commit | 538539d8791e5b3b1ea2e95473b589934d94497e (patch) | |
tree | 785bcd2647693d1c9142e898e85dba6c302b3a51 /src/egl | |
parent | a1a441179bacdd33e83a48651c7a7a2cc4a8a665 (diff) |
egl_dri2: Fix initialization with EGL_DEFAULT_DISPLAY
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 8b01b8453e..92378892e5 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); |