Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
#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) {
#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
return initialized;
}
+void
+dri2_teardown_x11(struct dri2_egl_display *dri2_dpy)
+{
+ if (dri2_dpy->own_device)
+ xcb_disconnect(dri2_dpy->conn);
+}