diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2014-01-28 18:53:56 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2014-03-17 15:39:22 -0700 |
commit | f506ef6784e79aeebd50184c034fc9723d6894db (patch) | |
tree | 348f5c2017130bad0e139623e7615a38b7834b6e /src/egl/drivers/dri2/platform_wayland.c | |
parent | 31cd0fee317c8532ac93f6de13c7955511f738a0 (diff) | |
download | external_mesa3d-f506ef6784e79aeebd50184c034fc9723d6894db.zip external_mesa3d-f506ef6784e79aeebd50184c034fc9723d6894db.tar.gz external_mesa3d-f506ef6784e79aeebd50184c034fc9723d6894db.tar.bz2 |
egl/dri2: Consolidate eglTerminate
egl_dri2.c:dri2_terminate() handled terminating X11 and DRM displays.
The Wayland platform implemented its own dri2_wl_terminate(), which was
nearly a copy of the common one.
To implement the EGL platform extensions, we either need to dispatch
eglTerminate per display or define a common implementation for all
platforms. This patch chooses consolidation. It removes
dri2_wl_terminate() by folding it into the common dri2_terminate().
It was necessary to invert the `if (disp->PlatformDisplay == NULL)` and
the switch statement because, unlike DRM and X11, Wayland's terminator
performed action even when EGL didn't own the native display. In the
inversion, I replaced `disp->PlatformDisplay == NULL` with
`dri2_dpy->own_device` because the two expressions are synonymous, but
the latter's meaning is clearer.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_wayland.c')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 9110750..c6031f0 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -781,31 +781,6 @@ dri2_wl_authenticate(_EGLDisplay *disp, uint32_t id) return ret; } -/** - * Called via eglTerminate(), drv->API.Terminate(). - */ -static EGLBoolean -dri2_wl_terminate(_EGLDriver *drv, _EGLDisplay *disp) -{ - struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - - _eglReleaseDisplayResources(drv, disp); - _eglCleanupDisplay(disp); - - dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); - close(dri2_dpy->fd); - dlclose(dri2_dpy->driver); - free(dri2_dpy->driver_name); - free(dri2_dpy->device_name); - wl_drm_destroy(dri2_dpy->wl_drm); - if (dri2_dpy->own_device) - wl_display_disconnect(dri2_dpy->wl_dpy); - free(dri2_dpy); - disp->DriverData = NULL; - - return EGL_TRUE; -} - static void drm_handle_device(void *data, struct wl_drm *drm, const char *device) { @@ -986,8 +961,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) loader_set_logger(_eglLog); - drv->API.Terminate = dri2_wl_terminate; - drv->API.CreateWaylandBufferFromImageWL = dri2_wl_create_wayland_buffer_from_image_wl; |