[Mesa-dev] [PATCH 05/13] egl: split out a dri2_display_destroy() helper
Gurchetan Singh
gurchetansingh at chromium.org
Thu May 11 21:14:59 UTC 2017
Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>
On Thu, May 11, 2017 at 11:57 AM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> 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 at collabora.com>
> ---
> src/egl/drivers/dri2/egl_dri2.c | 9 ++++++++-
> src/egl/drivers/dri2/egl_dri2.h | 3 +++
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_
> dri2.c
> index 405db61d185..d543881d28c 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -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);
> diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_
> dri2.h
> index b1e224248cc..4fbba8f6069 100644
> --- a/src/egl/drivers/dri2/egl_dri2.h
> +++ b/src/egl/drivers/dri2/egl_dri2.h
> @@ -427,4 +427,7 @@ dri2_set_WL_bind_wayland_display(_EGLDriver *drv,
> _EGLDisplay *disp)
> #endif
> }
>
> +void
> +dri2_display_destroy(_EGLDisplay *disp);
> +
> #endif /* EGL_DRI2_INCLUDED */
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170511/b9b183e3/attachment.html>
More information about the mesa-dev
mailing list