<div dir="ltr">Reviewed-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 11, 2017 at 11:57 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
<br>
Within dri2_display_release() we already tear down all the display<br>
specifics. Within the platform specific dri initialize however we badly<br>
and partially duplicate that.<br>
<br>
Let's stop that by fleshing out the required functionality into a helper<br>
and using it throughout the codebase.<br>
<br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
---<br>
 src/egl/drivers/dri2/egl_dri2.<wbr>c | 9 ++++++++-<br>
 src/egl/drivers/dri2/egl_dri2.<wbr>h | 3 +++<br>
 2 files changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/egl/drivers/dri2/egl_<wbr>dri2.c b/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
index 405db61d185..d543881d28c 100644<br>
--- a/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
+++ b/src/egl/drivers/dri2/egl_<wbr>dri2.c<br>
@@ -855,7 +855,6 @@ static void<br>
 dri2_display_release(_<wbr>EGLDisplay *disp)<br>
 {<br>
    struct dri2_egl_display *dri2_dpy;<br>
-   unsigned i;<br>
<br>
    if (!disp)<br>
       return;<br>
@@ -869,6 +868,14 @@ dri2_display_release(_<wbr>EGLDisplay *disp)<br>
       return;<br>
<br>
    _eglCleanupDisplay(disp);<br>
+   dri2_display_destroy(disp);<br>
+}<br>
+<br>
+void<br>
+dri2_display_destroy(_<wbr>EGLDisplay *disp)<br>
+{<br>
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>
+   unsigned i;<br>
<br>
    if (dri2_dpy->own_dri_screen)<br>
       dri2_dpy->core->destroyScreen(<wbr>dri2_dpy->dri_screen);<br>
diff --git a/src/egl/drivers/dri2/egl_<wbr>dri2.h b/src/egl/drivers/dri2/egl_<wbr>dri2.h<br>
index b1e224248cc..4fbba8f6069 100644<br>
--- a/src/egl/drivers/dri2/egl_<wbr>dri2.h<br>
+++ b/src/egl/drivers/dri2/egl_<wbr>dri2.h<br>
@@ -427,4 +427,7 @@ dri2_set_WL_bind_wayland_<wbr>display(_EGLDriver *drv, _EGLDisplay *disp)<br>
 #endif<br>
 }<br>
<br>
+void<br>
+dri2_display_destroy(_<wbr>EGLDisplay *disp);<br>
+<br>
 #endif /* EGL_DRI2_INCLUDED */<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>