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 <[email protected]> --- 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 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
