egl: split out a dri2_display_destroy() helper
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 11 May 2017 16:13:33 +0000 (17:13 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 29 May 2017 15:49:52 +0000 (16:49 +0100)
Within dri2_display_release() we already tear down all the display
specifics. Within the platform specific dri initialize however we badly
and partially duplicate that.

Let's stop that by fleshing out the required functionality into a helper
and using it throughout the codebase.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Rob Herring <robh@kernel.org>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h

index eefe3bfc5832c74d205ef5a92510d55c517e3184..1c3d00cf8c3587a965cccc3c41b949c31f9e9bf2 100644 (file)
@@ -855,7 +855,6 @@ static void
 dri2_display_release(_EGLDisplay *disp)
 {
    struct dri2_egl_display *dri2_dpy;
-   unsigned i;
 
    if (!disp)
       return;
@@ -869,6 +868,14 @@ dri2_display_release(_EGLDisplay *disp)
       return;
 
    _eglCleanupDisplay(disp);
+   dri2_display_destroy(disp);
+}
+
+void
+dri2_display_destroy(_EGLDisplay *disp)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   unsigned i;
 
    if (dri2_dpy->own_dri_screen)
       dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
index b3d48488494e5c94b870776dd805d3500a68a07a..c9c064b23fe575b74d66c8b33ce9e7bac436890f 100644 (file)
@@ -431,4 +431,7 @@ dri2_set_WL_bind_wayland_display(_EGLDriver *drv, _EGLDisplay *disp)
 #endif
 }
 
+void
+dri2_display_destroy(_EGLDisplay *disp);
+
 #endif /* EGL_DRI2_INCLUDED */