[PATCH xserver] xwayland: add envvar XWAYLAND_NO_GLAMOR

Eric Engestrom eric.engestrom at imgtec.com
Wed Mar 1 17:28:37 UTC 2017


On Wednesday, 2017-03-01 17:45:12 +0100, Olivier Fourdan wrote:
> Not all compositors allow for customizing the Xwayland command line,
> gnome-shell/mutter for example have the command line and path to
> Xwayland binary hardcoded, which makes it harder for users to disable
> glamor acceleration in Xwayland (glamor being used by default).
> 
> Add an environment variable XWAYLAND_NO_GLAMOR t odiable glamor support

"to disable"

The change itself looks good to me.
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

As to whether it's a good idea to allow this, I'd say it is, but you
might want the opinion of someone who's more involved in this project :)

Cheers,
  Eric

> in Xwayland.
> 
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> ---
>  hw/xwayland/xwayland-glamor.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
> index b3d0aab..45de54f 100644
> --- a/hw/xwayland/xwayland-glamor.c
> +++ b/hw/xwayland/xwayland-glamor.c
> @@ -549,6 +549,13 @@ Bool
>  xwl_glamor_init(struct xwl_screen *xwl_screen)
>  {
>      ScreenPtr screen = xwl_screen->screen;
> +    const char *no_glamor_env;
> +
> +    no_glamor_env = getenv("XWAYLAND_NO_GLAMOR");
> +    if (no_glamor_env && *no_glamor_env != '0') {

Nit: `XWAYLAND_NO_GLAMOR=` evaluates to true here, disabling glamor.
Not sure how much we care about this case though, or if we do want this
behaviour, but this would fix it:

    if (no_glamor_env && *no_glamor_env && *no_glamor_env != '0') {

> +        ErrorF("Disabling glamor and dri3 support, XWAYLAND_NO_GLAMOR is set\n");
> +        return FALSE;
> +    }
>  
>      if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
>          ErrorF("Disabling glamor and dri3, EGL setup failed\n");
> -- 
> 2.9.3
> 


More information about the xorg-devel mailing list