On Fri, 25 May 2018 17:10:07 +0200 Olivier Fourdan <ofour...@redhat.com> 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 <rstr...@redhat.com> > Signed-off-by: Olivier Fourdan <ofour...@redhat.com> > --- > 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"); Hi, do not use strstr() for matching extensions strings. It does a sub-string match, which may not be what you want. What if there was an extension called "platform_gbm_unixmem" or such? Thanks, pq
pgpAsTbeu5rS_.pgp
Description: OpenPGP digital signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel