[PATCH xserver 2/3] xwayland: Check required interfaces for GBM backend

Olivier Fourdan ofourdan at redhat.com
Wed May 30 09:30:36 UTC 2018


Use the newly added “has_wl_interface” hook to check availability of
“wl_drm” interface prior to enable glamor with GBM backend.

Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
---
 hw/xwayland/xwayland-glamor-gbm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 29325adac..0df24be20 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -746,6 +746,19 @@ xwl_glamor_gbm_init_wl_registry(struct xwl_screen *xwl_screen,
         xwl_screen_set_dmabuf_interface(xwl_screen, id, version);
 }
 
+static Bool
+xwl_glamor_gbm_has_wl_interface(struct xwl_screen *xwl_screen)
+{
+    struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
+
+    if (xwl_gbm->drm == NULL) {
+        ErrorF("glamor: 'wl_drm' not supported\n");
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
 static Bool
 xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
 {
@@ -879,6 +892,7 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen)
                   xwl_gbm);
 
     xwl_screen->egl_backend.init_wl_registry = xwl_glamor_gbm_init_wl_registry;
+    xwl_screen->egl_backend.has_wl_interface = xwl_glamor_gbm_has_wl_interface;
     xwl_screen->egl_backend.init_egl = xwl_glamor_gbm_init_egl;
     xwl_screen->egl_backend.init_screen = xwl_glamor_gbm_init_screen;
     xwl_screen->egl_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap;
-- 
2.17.0



More information about the xorg-devel mailing list