[PATCH xserver] Xwayland: Enable EGL backend automatically

Pekka Paalanen ppaalanen at gmail.com
Mon May 28 07:24:39 UTC 2018


On Fri, 25 May 2018 17:10:07 +0200
Olivier Fourdan <ofourdan at 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 <rstrode at redhat.com>
> Signed-off-by: Olivier Fourdan <ofourdan at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180528/0e75e852/attachment.sig>


More information about the xorg-devel mailing list