Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
case _EGL_PLATFORM_X11:
dri2_teardown_x11(dri2_dpy);
break;
-#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM:
- if (dri2_dpy->own_device) {
- gbm_device_destroy(&dri2_dpy->gbm_dri->base);
- }
+ dri2_teardown_drm(disp);
break;
-#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
if (dri2_dpy->wl_drm)
#ifdef HAVE_DRM_PLATFORM
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp);
+void
+dri2_teardown_drm(struct dri2_egl_display *dri2_dpy);
#else
static inline EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
return _eglError(EGL_NOT_INITIALIZED, "GBM/DRM platform not built");
}
+static inline void
+dri2_teardown_drm(struct dri2_egl_display *dri2_dpy) {}
#endif
#ifdef HAVE_WAYLAND_PLATFORM
dri2_display_destroy(disp);
return _eglError(EGL_NOT_INITIALIZED, err);
}
+
+void
+dri2_teardown_drm(struct dri2_egl_display *dri2_dpy)
+{
+ if (dri2_dpy->own_device)
+ gbm_device_destroy(&dri2_dpy->gbm_dri->base);
+}