[PATCH xserver 3/3] xwayland: Check required interfaces for EGLstreams

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


Use the newly added “has_wl_interface” hook to check availability of
“wl_eglstream_display” and “wl_eglstream_controller” interfaces prior to
enable glamor with EGL Streams backend.

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

diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
index 8dd1cc304..fcf7a7149 100644
--- a/hw/xwayland/xwayland-glamor-eglstream.c
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
@@ -581,6 +581,26 @@ xwl_glamor_eglstream_init_wl_registry(struct xwl_screen *xwl_screen,
     }
 }
 
+static Bool
+xwl_glamor_eglstream_has_wl_interface(struct xwl_screen *xwl_screen)
+{
+    struct xwl_eglstream_private *xwl_eglstream =
+        xwl_eglstream_get(xwl_screen);
+
+    if (xwl_eglstream->display == NULL) {
+        ErrorF("glamor: 'wl_eglstream_display' not supported\n");
+        return FALSE;
+    }
+
+    if (xwl_eglstream->controller == NULL) {
+        ErrorF("glamor: 'wl_eglstream_controller' not supported\n");
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+
 static inline void
 xwl_eglstream_init_shaders(struct xwl_screen *xwl_screen)
 {
@@ -819,6 +839,7 @@ xwl_glamor_init_eglstream(struct xwl_screen *xwl_screen)
 
     xwl_screen->egl_backend.init_egl = xwl_glamor_eglstream_init_egl;
     xwl_screen->egl_backend.init_wl_registry = xwl_glamor_eglstream_init_wl_registry;
+    xwl_screen->egl_backend.has_wl_interface = xwl_glamor_eglstream_has_wl_interface;
     xwl_screen->egl_backend.init_screen = xwl_glamor_eglstream_init_screen;
     xwl_screen->egl_backend.get_wl_buffer_for_pixmap = xwl_glamor_eglstream_get_wl_buffer_for_pixmap;
     xwl_screen->egl_backend.post_damage = xwl_glamor_eglstream_post_damage;
-- 
2.17.0



More information about the xorg-devel mailing list