[PATCH weston 2/2] weston-egl-ext: Define EGL tokens harder for old Mesa

Bryce Harrington bryce at osg.samsung.com
Wed Feb 11 18:13:08 PST 2015


On Wed, Feb 11, 2015 at 06:15:18PM +0000, Daniel Stone wrote:
> Older versions of Mesa provided header definitions for the
> EGL_WL_bind_wayland_display extension, but an earlier version of the
> extension which only provided the (un)bind entrypoints, and not
> QueryWaylandBuffer. Detect this half-provision and make sure we export
> the QueryWaylandBuffer definitions as well.
> 
> Fixes build failure with EGL on Ubuntu 12.04.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>

If I understand properly, this basically splits the definitions that
were provided for when EGL_WL_bind_wayland_display is unavailable into
two chunks, the first just declares wl_display and the bind api when
EGL_WL_bind_wayland_display is missing, and the remainder only when
EGL_WAYLAND_BUFFER_WL isn't available.  Ubuntu 12.04 has
EGL_WL_bind_wayland_display defined but not EGL_WAYLAND_BUFFER_WL.

Presuming my understanding's correct and assuming this has been verified
as a fix on 12.04,

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

> ---
>  src/weston-egl-ext.h | 28 +++++++++++++++++++++++-----
>  1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/src/weston-egl-ext.h b/src/weston-egl-ext.h
> index 4888323..145322b 100644
> --- a/src/weston-egl-ext.h
> +++ b/src/weston-egl-ext.h
> @@ -33,6 +33,29 @@
>  #ifndef EGL_WL_bind_wayland_display
>  #define EGL_WL_bind_wayland_display 1
>  
> +struct wl_display;
> +
> +#ifdef EGL_EGLEXT_PROTOTYPES
> +EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
> +EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
> +#endif
> +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
> +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
> +#endif
> +
> +/*
> + * This is a little different to the tests shipped with EGL implementations,
> + * which wrap the entire thing in #ifndef EGL_WL_bind_wayland_display, then go
> + * on to define both BindWaylandDisplay and QueryWaylandBuffer.
> + *
> + * Unfortunately, some implementations (particularly the version of Mesa shipped
> + * in Ubuntu 12.04) define EGL_WL_bind_wayland_display, but then only provide
> + * prototypes for (Un)BindWaylandDisplay, completely omitting
> + * QueryWaylandBuffer.
> + *
> + * Detect this, and provide our own definitions if necessary.
> + */
> +#ifndef EGL_WAYLAND_BUFFER_WL
>  #define EGL_WAYLAND_BUFFER_WL		0x31D5 /* eglCreateImageKHR target */
>  #define EGL_WAYLAND_PLANE_WL		0x31D6 /* eglCreateImageKHR target */
>  
> @@ -41,15 +64,10 @@
>  #define EGL_TEXTURE_Y_XUXV_WL           0x31D9
>  #define EGL_TEXTURE_EXTERNAL_WL         0x31DA
>  
> -struct wl_display;
>  struct wl_resource;
>  #ifdef EGL_EGLEXT_PROTOTYPES
> -EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
> -EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);
>  EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
>  #endif
> -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
> -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
>  typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
>  #endif
>  
> -- 
> 2.1.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list