Re: [PATCH xserver 2/2] xwayland: mandatory EGL backend API

2018-06-13 Thread Lyude Paul
Reviewed-by: Lyude Paul 

On Mon, 2018-06-11 at 10:22 +0200, Olivier Fourdan wrote:
> The API init_wl_registry() and has_wl_interfaces() are marked as being
> optional, but both GBM And EGLStream backends implement them so there is
> point in keeping those optional.
> 
> Suggested-by: Emil Velikov 
> Signed-off-by: Olivier Fourdan 
> ---
>  hw/xwayland/xwayland-glamor.c | 8 +---
>  hw/xwayland/xwayland.h| 6 ++
>  2 files changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
> index 61418e707..f17914344 100644
> --- a/hw/xwayland/xwayland-glamor.c
> +++ b/hw/xwayland/xwayland-glamor.c
> @@ -72,14 +72,12 @@ xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen,
>  uint32_t version)
>  {
>  if (xwl_screen->gbm_backend.is_available &&
> -xwl_screen->gbm_backend.init_wl_registry &&
>  xwl_screen->gbm_backend.init_wl_registry(xwl_screen,
>   registry,
>   id,
>   interface,
>   version)); /* no-op */
>  else if (xwl_screen->eglstream_backend.is_available &&
> - xwl_screen->eglstream_backend.init_wl_registry &&
>   xwl_screen->eglstream_backend.init_wl_registry(xwl_screen,
>  registry,
>  id,
> @@ -91,11 +89,7 @@ Bool
>  xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
>  struct xwl_egl_backend *xwl_egl_backend)
>  {
> -if (xwl_egl_backend->has_wl_interfaces)
> -return xwl_egl_backend->has_wl_interfaces(xwl_screen);
> -
> -/* If the backend has no requirement wrt WL interfaces, we're fine */
> -return TRUE;
> +return xwl_egl_backend->has_wl_interfaces(xwl_screen);
>  }
>  
>  struct wl_buffer *
> diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
> index dc01c747c..d70ad54bf 100644
> --- a/hw/xwayland/xwayland.h
> +++ b/hw/xwayland/xwayland.h
> @@ -64,16 +64,14 @@ struct xwl_egl_backend {
>  Bool is_available;
>  
>  /* Called once for each interface in the global registry. Backends
> - * should use this to bind to any wayland interfaces they need. This
> - * callback is optional.
> + * should use this to bind to any wayland interfaces they need.
>   */
>  Bool (*init_wl_registry)(struct xwl_screen *xwl_screen,
>   struct wl_registry *wl_registry,
>   uint32_t id, const char *name,
>   uint32_t version);
>  
> -/* Check that the required Wayland interfaces are available. This
> - * callback is optional.
> +/* Check that the required Wayland interfaces are available.
>   */
>  Bool (*has_wl_interfaces)(struct xwl_screen *xwl_screen);
>  
___
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

[PATCH xserver 2/2] xwayland: mandatory EGL backend API

2018-06-11 Thread Olivier Fourdan
The API init_wl_registry() and has_wl_interfaces() are marked as being
optional, but both GBM And EGLStream backends implement them so there is
point in keeping those optional.

Suggested-by: Emil Velikov 
Signed-off-by: Olivier Fourdan 
---
 hw/xwayland/xwayland-glamor.c | 8 +---
 hw/xwayland/xwayland.h| 6 ++
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 61418e707..f17914344 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -72,14 +72,12 @@ xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen,
 uint32_t version)
 {
 if (xwl_screen->gbm_backend.is_available &&
-xwl_screen->gbm_backend.init_wl_registry &&
 xwl_screen->gbm_backend.init_wl_registry(xwl_screen,
  registry,
  id,
  interface,
  version)); /* no-op */
 else if (xwl_screen->eglstream_backend.is_available &&
- xwl_screen->eglstream_backend.init_wl_registry &&
  xwl_screen->eglstream_backend.init_wl_registry(xwl_screen,
 registry,
 id,
@@ -91,11 +89,7 @@ Bool
 xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
 struct xwl_egl_backend *xwl_egl_backend)
 {
-if (xwl_egl_backend->has_wl_interfaces)
-return xwl_egl_backend->has_wl_interfaces(xwl_screen);
-
-/* If the backend has no requirement wrt WL interfaces, we're fine */
-return TRUE;
+return xwl_egl_backend->has_wl_interfaces(xwl_screen);
 }
 
 struct wl_buffer *
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index dc01c747c..d70ad54bf 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -64,16 +64,14 @@ struct xwl_egl_backend {
 Bool is_available;
 
 /* Called once for each interface in the global registry. Backends
- * should use this to bind to any wayland interfaces they need. This
- * callback is optional.
+ * should use this to bind to any wayland interfaces they need.
  */
 Bool (*init_wl_registry)(struct xwl_screen *xwl_screen,
  struct wl_registry *wl_registry,
  uint32_t id, const char *name,
  uint32_t version);
 
-/* Check that the required Wayland interfaces are available. This
- * callback is optional.
+/* Check that the required Wayland interfaces are available.
  */
 Bool (*has_wl_interfaces)(struct xwl_screen *xwl_screen);
 
-- 
2.17.1

___
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