summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-11-09 18:58:52 +0000
committerEmil Velikov <[email protected]>2017-11-16 14:03:06 +0000
commit938fcab08b863603834b37afaae6a253e670df24 (patch)
tree1afa2f935e1d77ae27b49b1fb0bdbfbdbd067620 /src/egl
parent55245fe1c9925045198f2f0954eff8f2e5d42d7b (diff)
egl/x11: move teardown code to the platform file
Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c6
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h4
-rw-r--r--src/egl/drivers/dri2/platform_x11.c6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index af821425355..280e70c137a 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -988,13 +988,9 @@ dri2_display_destroy(_EGLDisplay *disp)
#endif
switch (disp->Platform) {
-#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
- if (dri2_dpy->own_device) {
- xcb_disconnect(dri2_dpy->conn);
- }
+ dri2_teardown_x11(dri2_dpy);
break;
-#endif
#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM:
if (dri2_dpy->own_device) {
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 9cccf05253a..ef5a458f5dd 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -403,12 +403,16 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
#ifdef HAVE_X11_PLATFORM
EGLBoolean
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp);
+void
+dri2_teardown_x11(struct dri2_egl_display *dri2_dpy);
#else
static inline EGLBoolean
dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp)
{
return _eglError(EGL_NOT_INITIALIZED, "X11 platform not built");
}
+static inline void
+dri2_teardown_x11(struct dri2_egl_display *dri2_dpy) {}
#endif
#ifdef HAVE_DRM_PLATFORM
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 5bcdb2dac74..c49cb1fd8ef 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -1476,3 +1476,9 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp)
return initialized;
}
+void
+dri2_teardown_x11(struct dri2_egl_display *dri2_dpy)
+{
+ if (dri2_dpy->own_device)
+ xcb_disconnect(dri2_dpy->conn);
+}