[Mesa-dev] Mesa (master): gallium-egl: Implement eglQueryWaylandBufferWL

Jose Fonseca jfonseca at vmware.com
Thu Jul 19 11:41:29 PDT 2012


This commit is causing build failures in several platforms because EGL_WL_bind_wayland_display is defined everywhere (including windows), and not just on platforms where wayland-drm.h exists.

Don't know why it was not failing before though.

I'm not very familiar with the st/egl code, but shouldn't the waylayng specific stuff be in src/gallium/state_trackers/egl/wayland/ instead of src/gallium/state_trackers/egl/common?

Jose

----- Original Message -----
> Module: Mesa
> Branch: master
> Commit: e1b45a3c06ec19a2b9f1e0d3f8732aaad2d932da
> URL:
>    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e1b45a3c06ec19a2b9f1e0d3f8732aaad2d932da
> 
> Author: Kristian Høgsberg <krh at bitplanet.net>
> Date:   Thu Jul 19 08:48:45 2012 -0400
> 
> gallium-egl: Implement eglQueryWaylandBufferWL
> 
> Support this query for gallium EGL too.
> 
> Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
> 
> ---
> 
>  .../state_trackers/egl/common/egl_g3d_api.c        |   32
>  +++++++++++++++++++-
>  1 files changed, 31 insertions(+), 1 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
> b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
> index 58e772f..f2e86de 100644
> --- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
> +++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
> @@ -39,6 +39,10 @@
>  #include "egl_g3d_st.h"
>  #include "native.h"
>  
> +#ifdef EGL_WL_bind_wayland_display
> +#include <wayland-drm.h>
> +#endif
> +
>  /**
>   * Return the state tracker for the given context.
>   */
> @@ -873,6 +877,32 @@ egl_g3d_unbind_wayland_display_wl(_EGLDriver
> *drv, _EGLDisplay *dpy,
>     return gdpy->native->wayland_bufmgr->unbind_display(gdpy->native,
>     wl_dpy);
>  }
>  
> +static EGLBoolean
> +egl_g3d_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *dpy,
> +                                struct wl_buffer *_buffer,
> +                                EGLint attribute, EGLint *value)
> +{
> +   struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
> +   struct pipe_resource *resource = buffer->driver_buffer;
> +
> +   if (!wayland_buffer_is_drm(&buffer->buffer))
> +      return EGL_FALSE;
> +
> +   if (attribute == EGL_WAYLAND_BUFFER_COMPONENTS_WL) {
> +      switch (resource->format) {
> +      case PIPE_FORMAT_B8G8R8A8_UNORM:
> +         *value = EGL_WAYLAND_BUFFER_RGBA_WL;
> +         return EGL_TRUE;
> +      case PIPE_FORMAT_B8G8R8X8_UNORM:
> +         *value = EGL_WAYLAND_BUFFER_RGB_WL;
> +         return EGL_TRUE;
> +      default:
> +         return EGL_FALSE;
> +      }
> +   }
> +
> +   return EGL_FALSE;
> +}
>  #endif /* EGL_WL_bind_wayland_display */
>  
>  void
> @@ -907,7 +937,7 @@ egl_g3d_init_driver_api(_EGLDriver *drv)
>  #ifdef EGL_WL_bind_wayland_display
>     drv->API.BindWaylandDisplayWL = egl_g3d_bind_wayland_display_wl;
>     drv->API.UnbindWaylandDisplayWL =
>     egl_g3d_unbind_wayland_display_wl;
> -
> +   drv->API.QueryWaylandBufferWL = egl_g3d_query_wayland_buffer_wl;
>  #endif
>  
>     drv->API.CreateSyncKHR = egl_g3d_create_sync;
> 
> _______________________________________________
> mesa-commit mailing list
> mesa-commit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-commit
>


More information about the mesa-dev mailing list