summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Franzke <[email protected]>2011-06-27 10:23:34 +0200
committerBenjamin Franzke <[email protected]>2011-06-27 10:25:12 +0200
commit992680c8b46d72cbc61888b8439d815bff42986c (patch)
tree4599d74c05f969ad7367c822c70063f9b5f588b9
parent3a07d9594a60dd84464b30b2d9ffdfc4f219bc5b (diff)
egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c8
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h1
-rw-r--r--src/gallium/state_trackers/egl/drm/native_drm.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index f9a5eb108e5..5680c360f1d 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -506,6 +506,8 @@ dri2_create_screen(_EGLDisplay *disp)
return EGL_FALSE;
}
+ dri2_dpy->own_dri_screen = 1;
+
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
if (dri2_dpy->dri2) {
@@ -576,10 +578,12 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
- dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
+ if (dri2_dpy->own_dri_screen)
+ dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
if (dri2_dpy->fd)
close(dri2_dpy->fd);
- dlclose(dri2_dpy->driver);
+ if (dri2_dpy->driver)
+ dlclose(dri2_dpy->driver);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index cd52d421ddf..83ea21e5dc8 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -71,6 +71,7 @@ struct dri2_egl_display
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
+ int own_dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c b/src/gallium/state_trackers/egl/drm/native_drm.c
index de4eb852eb7..47910de8d3c 100644
--- a/src/gallium/state_trackers/egl/drm/native_drm.c
+++ b/src/gallium/state_trackers/egl/drm/native_drm.c
@@ -127,6 +127,8 @@ drm_display_destroy(struct native_display *ndpy)
drm_display_fini_modeset(&drmdpy->base);
+ /* gbm owns screen */
+ ndpy->screen = NULL;
ndpy_uninit(ndpy);
if (drmdpy->device_name)