egl_dri2/wayland: Add support for EGL_DEFAULT_DISPLAY

This commit is contained in:
Benjamin Franzke
2011-06-11 22:07:02 +02:00
committed by Kristian Høgsberg
parent 9a00dd9746
commit b8325fd255
2 changed files with 23 additions and 3 deletions
+16 -2
View File
@@ -528,10 +528,24 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
if (dri2_dpy->fd)
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
if (disp->PlatformDisplay == NULL)
xcb_disconnect(dri2_dpy->conn);
case _EGL_PLATFORM_X11:
xcb_disconnect(dri2_dpy->conn);
break;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
wl_display_destroy(dri2_dpy->wl_dpy);
break;
#endif
default:
break;
}
}
free(dri2_dpy);
disp->DriverData = NULL;
+7 -1
View File
@@ -676,7 +676,13 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
memset(dri2_dpy, 0, sizeof *dri2_dpy);
disp->DriverData = (void *) dri2_dpy;
dri2_dpy->wl_dpy = disp->PlatformDisplay;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);
if (dri2_dpy->wl_dpy == NULL)
goto cleanup_dpy;
} else {
dri2_dpy->wl_dpy = disp->PlatformDisplay;
}
id = wl_display_get_global(dri2_dpy->wl_dpy, "wl_drm", 1);
if (id == 0)