diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 7028f9508..dab51e1d9 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -47,6 +47,7 @@ #include "drm-client-protocol.h" #include "xwayland-glamor.h" +#include "xwayland-glamor-gbm.h" #include "xwayland-pixmap.h" #include "xwayland-screen.h" @@ -85,6 +86,14 @@ xwl_gbm_get(struct xwl_screen *xwl_screen) &xwl_gbm_private_key); } +Bool +xwl_glamor_has_wl_drm(struct xwl_screen *xwl_screen) +{ + struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); + + return !!(xwl_gbm->drm != NULL); +} + /* There is a workaround for Mesa behaviour, which will cause black windows * when RGBX formats is using. Why exactly? There is an explanation: * 1. We create GL_RGBA texture with GL_UNSIGNED_BYTE type, all allowed by ES. @@ -1007,19 +1016,6 @@ xwl_glamor_gbm_has_egl_extension(void) epoxy_has_egl_extension(NULL, "EGL_KHR_platform_gbm")); } -static Bool -xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen) -{ - struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); - - if (xwl_gbm->drm == NULL && xwl_screen->dmabuf_protocol_version < 4) { - LogMessageVerb(X_INFO, 3, "glamor: 'wl_drm' not supported and linux-dmabuf v4 not supported\n"); - return FALSE; - } - - return TRUE; -} - static Bool xwl_glamor_try_to_make_context_current(struct xwl_screen *xwl_screen) { @@ -1305,7 +1301,6 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen) dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key, xwl_gbm); - xwl_screen->gbm_backend.has_wl_interfaces = xwl_glamor_gbm_has_wl_interfaces; xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl; xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen; xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap; diff --git a/hw/xwayland/xwayland-glamor-gbm.h b/hw/xwayland/xwayland-glamor-gbm.h index 411b11aec..125d8a1b5 100644 --- a/hw/xwayland/xwayland-glamor-gbm.h +++ b/hw/xwayland/xwayland-glamor-gbm.h @@ -35,5 +35,6 @@ #include "xwayland-types.h" void xwl_glamor_init_gbm(struct xwl_screen *xwl_screen); +Bool xwl_glamor_has_wl_drm(struct xwl_screen *xwl_screen); #endif /* XWAYLAND_GLAMOR_GBM_H */ diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 42a5ea820..d518bfb90 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -121,7 +121,13 @@ Bool xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen, struct xwl_egl_backend *xwl_egl_backend) { - return xwl_egl_backend->has_wl_interfaces(xwl_screen); + if (!xwl_glamor_has_wl_drm(xwl_screen) && + xwl_screen->dmabuf_protocol_version < 4) { + LogMessageVerb(X_INFO, 3, "glamor: 'wl_drm' not supported and linux-dmabuf v4 not supported\n"); + return FALSE; + } + + return TRUE; } struct wl_buffer *