[PATCH v2 xserver 4/5] xwayland: Do not disable glamor if eglstream failed

Lyude Paul lyude at redhat.com
Fri May 25 22:42:18 UTC 2018


Reviewed-by: Lyude Paul <lyude at redhat.com>

On Thu, 2018-05-24 at 16:33 +0200, Olivier Fourdan wrote:
> EGL stream requires glamor, but the opposite is not true. So if someone
> passes "-eglstream" with a GPU which does not support EGL stream, we
> could maybe still try GBM and be lucky.
> 
> That allows Wayland compositor to pass "eglstream" regardless of the
> actual hardware, if they want to enable EGL stream on GPU which support
> it.
> 
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> ---
>  v2: Try GBM only if EGL streams actually failed (or wasn't requested)
> 
>  hw/xwayland/xwayland.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
> index cc16edf27..a08d58451 100644
> --- a/hw/xwayland/xwayland.c
> +++ b/hw/xwayland/xwayland.c
> @@ -939,9 +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;
> -#ifdef XWL_HAS_EGLSTREAM
>      Bool use_eglstreams = FALSE;
> -#endif
>  
>      xwl_screen = calloc(1, sizeof *xwl_screen);
>      if (xwl_screen == NULL)
> @@ -998,12 +996,12 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char
> **argv)
>  #ifdef XWL_HAS_EGLSTREAM
>          if (use_eglstreams) {
>              if (!xwl_glamor_init_eglstream(xwl_screen)) {
> -                ErrorF("xwayland glamor: failed to setup eglstream backend,
> falling back to swaccel\n");
> -                xwl_screen->glamor = 0;
> +                ErrorF("xwayland glamor: failed to setup eglstream
> backend\n");
> +                use_eglstreams = FALSE;
>              }
> -        } else
> +        }
>  #endif
> -        if (!xwl_glamor_init_gbm(xwl_screen)) {
> +        if (!use_eglstreams && !xwl_glamor_init_gbm(xwl_screen)) {
>              ErrorF("xwayland glamor: failed to setup GBM backend, falling
> back to sw accel\n");
>              xwl_screen->glamor = 0;
>          }
-- 
Cheers,
	Lyude Paul


More information about the xorg-devel mailing list