NAK, unfortunately this check isn't going to be enough, see: 2018-05-24 15:44:34 jadahl Lyude: you can also look at the globals sent out by the compositor 2018-05-24 15:44:52 Lyude jadahl: you mean the wl interfaces 2018-05-24 15:45:30 jadahl yes 2018-05-24 15:46:22 -- manuelschneid3r is now known as manuels 2018-05-24 15:51:02 -- manuels is now known as manuelschneid3r 2018-05-24 15:52:04 Lyude jadahl: hm. i thought that hadn't been working before, but something must have changed because it appears to work now 2018-05-24 15:53:03 jadahl checking for the EGL extension alone might not be enough anyhow, in case the compositor doesn't actually support anything on the other end
I'm going to try to come up with a patch that uses this approach today, and I will include you in the CC for it On Fri, 2018-05-25 at 17:10 +0200, Olivier Fourdan wrote: > Check for "platform_gbm" in the avaiable EGL extensions, and enable > automatically EGL stream if not present. > > The command line options “-eglstream” is kept for compatibility to force > the use of the EGL streams backend. > > Suggested-by: Ray Strode <[email protected]> > Signed-off-by: Olivier Fourdan <[email protected]> > --- > Note: * This was suggested by Ray Strode (halfline) in: > https://gitlab.gnome.org/GNOME/mutter/issues/170 > * This goes on top of the previous series here: > https://patchwork.freedesktop.org/series/43704/ > * If GBM is not supported and EGL stream wasn't enabled in Xwayland > at build time, we even get a message from Xwayland stating that > EGL streams backend is not enabled. > > hw/xwayland/xwayland-glamor.c | 7 +++++++ > hw/xwayland/xwayland.c | 2 +- > hw/xwayland/xwayland.h | 1 + > 3 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c > index f543f321d..b84c78735 100644 > --- a/hw/xwayland/xwayland-glamor.c > +++ b/hw/xwayland/xwayland-glamor.c > @@ -58,6 +58,13 @@ xwl_glamor_egl_supports_device_probing(void) > return epoxy_has_egl_extension(NULL, "EGL_EXT_device_base"); > } > > +Bool > +xwl_glamor_should_use_gbm(void) > +{ > + return !!strstr((char *)eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS), > + "platform_gbm"); > +} > + > void ** > xwl_glamor_egl_get_devices(int *num_devices) > { > diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c > index a08d58451..4dd8f3810 100644 > --- a/hw/xwayland/xwayland.c > +++ b/hw/xwayland/xwayland.c > @@ -939,7 +939,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char > **argv) > struct xwl_screen *xwl_screen; > Pixel red_mask, blue_mask, green_mask; > int ret, bpc, green_bpc, i; > - Bool use_eglstreams = FALSE; > + Bool use_eglstreams = !xwl_glamor_should_use_gbm(); > > xwl_screen = calloc(1, sizeof *xwl_screen); > if (xwl_screen == NULL) > diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h > index 39bc20a7e..ff746114c 100644 > --- a/hw/xwayland/xwayland.h > +++ b/hw/xwayland/xwayland.h > @@ -444,6 +444,7 @@ void xwl_screen_init_xdg_output(struct xwl_screen > *xwl_screen); > > void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen); > Bool xwl_glamor_egl_supports_device_probing(void); > +Bool xwl_glamor_should_use_gbm(void); > void **xwl_glamor_egl_get_devices(int *num_devices); > Bool xwl_glamor_egl_device_has_egl_extensions(void *device, > const char **ext_list, -- Cheers, Lyude Paul _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
