egl: split out a dri2_display_destroy() helper

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>
This commit is contained in:
Emil Velikov 2017-05-11 17:13:33 +01:00 committed by Emil Velikov
parent 12196d1b76
commit 3e73c0245b
2 changed files with 11 additions and 1 deletions

View 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);

View 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 */