From 5fd0c92b0e9d1770bb647aebe8b0b35b08e2f4c4 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 12 Mar 2024 14:38:21 +0100 Subject: [PATCH] xwayland/glamor: Remove the flag "is_available" Now that we have only one GBM backend, either it is available and usable, or we cannot use GLAMOR. Therefore we can drop the flag "is_available". Signed-off-by: Olivier Fourdan Part-of: --- hw/xwayland/xwayland-dmabuf.c | 9 +-------- hw/xwayland/xwayland-glamor.c | 6 ++---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/xwayland/xwayland-dmabuf.c b/hw/xwayland/xwayland-dmabuf.c index e5432217b..7133922dc 100644 --- a/hw/xwayland/xwayland-dmabuf.c +++ b/hw/xwayland/xwayland-dmabuf.c @@ -172,14 +172,7 @@ wl_drm_format_for_depth(int depth) static drmDevice * xwl_screen_get_main_dev(struct xwl_screen *xwl_screen) { - /* - * If we have gbm then get our main device from it. Otherwise use what - * the compositor told us. - */ - if (xwl_screen->gbm_backend.is_available) - return xwl_gbm_get_main_device(xwl_screen); - else - return xwl_screen->default_feedback.main_dev; + return xwl_gbm_get_main_device(xwl_screen); } static Bool diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 5020551d3..69d0e0a4d 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -313,8 +313,7 @@ void xwl_glamor_init_backends(struct xwl_screen *xwl_screen) { #ifdef GLAMOR_HAS_GBM - xwl_glamor_init_gbm(xwl_screen); - if (!xwl_screen->gbm_backend.is_available) + if (!xwl_glamor_init_gbm(xwl_screen)) ErrorF("Xwayland glamor: GBM backend is not available\n"); #endif } @@ -323,8 +322,7 @@ static Bool xwl_glamor_select_gbm_backend(struct xwl_screen *xwl_screen) { #ifdef GLAMOR_HAS_GBM - if (xwl_screen->gbm_backend.is_available && - xwl_glamor_has_wl_interfaces(xwl_screen, &xwl_screen->gbm_backend)) { + if (xwl_glamor_has_wl_interfaces(xwl_screen, &xwl_screen->gbm_backend)) { xwl_screen->egl_backend = &xwl_screen->gbm_backend; LogMessageVerb(X_INFO, 3, "glamor: Using GBM backend\n"); return TRUE;