<p dir="ltr">Hi</p>
<p dir="ltr">I seem to have a missing symbol wayland_drm_buffer_get in libgbm.so.1 </p>
<p dir="ltr">I'm pretty sure its related</p>
<p dir="ltr">Regards</p>
<p dir="ltr">Mike</p>
<div class="gmail_quote">On 18 Jul 2013 13:15, "Ander Conselvan de Oliveira" <<a href="mailto:ander.conselvan.de.oliveira@intel.com">ander.conselvan.de.oliveira@intel.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since Wayland 1.2, struct wl_buffer and a few functions are deprecated.<br>
<br>
References to wl_buffer are replaced with wl_resource and some getter<br>
functions and calls to deprecated functions are replaced with the proper<br>
new API. The latter changes are related to resource versioning.<br>
<br>
Signed-off-by: Ander Conselvan de Oliveira <<a href="mailto:ander.conselvan.de.oliveira@intel.com">ander.conselvan.de.oliveira@intel.com</a>><br>
---<br>
 docs/specs/WL_bind_wayland_display.spec            |  8 ++-<br>
 include/EGL/eglmesaext.h                           |  6 +-<br>
 src/egl/drivers/dri2/egl_dri2.c                    | 28 +++++----<br>
 src/egl/drivers/dri2/egl_dri2.h                    |  1 -<br>
 src/egl/main/eglapi.c                              |  2 +-<br>
 src/egl/main/eglapi.h                              |  2 +-<br>
 src/egl/wayland/wayland-drm/wayland-drm.c          | 66 +++++++++++++---------<br>
 src/egl/wayland/wayland-drm/wayland-drm.h          | 13 +++--<br>
 .../state_trackers/egl/common/egl_g3d_api.c        |  2 +-<br>
 .../state_trackers/egl/common/egl_g3d_image.c      |  4 +-<br>
 .../egl/common/native_wayland_bufmgr.h             |  6 +-<br>
 .../egl/common/native_wayland_drm_bufmgr.c         | 25 +++++---<br>
 src/gbm/backends/dri/gbm_dri.c                     |  5 +-<br>
 13 files changed, 99 insertions(+), 69 deletions(-)<br>
<br>
diff --git a/docs/specs/WL_bind_wayland_display.spec b/docs/specs/WL_bind_wayland_display.spec<br>
index 02bd6ea..8f0083c 100644<br>
--- a/docs/specs/WL_bind_wayland_display.spec<br>
+++ b/docs/specs/WL_bind_wayland_display.spec<br>
@@ -17,7 +17,7 @@ Status<br>
<br>
 Version<br>
<br>
-    Version 1, March 1, 2011<br>
+    Version 5, July 16, 2013<br>
<br>
 Number<br>
<br>
@@ -57,7 +57,7 @@ New Procedures and Functions<br>
                                          struct wl_display *display);<br>
<br>
     EGLBoolean eglQueryWaylandBufferWL(EGLDisplay dpy,<br>
-                                       struct wl_buffer *buffer,<br>
+                                       struct wl_resource *buffer,<br>
                                        EGLint attribute, EGLint *value);<br>
<br>
 New Tokens<br>
@@ -173,3 +173,7 @@ Revision History<br>
         Use EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, and EGL_TEXTURE_RGBA,<br>
         and just define the new YUV texture formats.  Add support for<br>
         EGL_WIDTH and EGL_HEIGHT in the query attributes (Kristian Høgsberg)<br>
+    Version 5, July 16, 2013<br>
+        Change eglQueryWaylandBufferWL to take a resource pointer to the<br>
+        buffer instead of a pointer to a struct wl_buffer, as the latter has<br>
+        been deprecated. (Ander Conselvan de Oliveira)<br>
diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h<br>
index d476d18..e0eae28 100644<br>
--- a/include/EGL/eglmesaext.h<br>
+++ b/include/EGL/eglmesaext.h<br>
@@ -120,15 +120,15 @@ typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDRMDISPLAYMESA) (int fd);<br>
 #define EGL_TEXTURE_Y_XUXV_WL           0x31D9<br>
<br>
 struct wl_display;<br>
-struct wl_buffer;<br>
+struct wl_resource;<br>
 #ifdef EGL_EGLEXT_PROTOTYPES<br>
 EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);<br>
 EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display);<br>
-EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);<br>
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);<br>
 #endif<br>
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);<br>
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);<br>
-typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value);<br>
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);<br>
<br>
 #endif<br>
<br>
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c<br>
index 1bce314..44fd8a8 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2.c<br>
+++ b/src/egl/drivers/dri2/egl_dri2.c<br>
@@ -41,6 +41,10 @@<br>
<br>
 #include "egl_dri2.h"<br>
<br>
+#ifdef HAVE_WAYLAND_PLATFORM<br>
+#include "wayland-drm.h"<br>
+#endif<br>
+<br>
 const __DRIuseInvalidateExtension use_invalidate = {<br>
    { __DRI_USE_INVALIDATE, 1 }<br>
 };<br>
@@ -1195,7 +1199,7 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,<br>
                                    EGLClientBuffer _buffer,<br>
                                    const EGLint *attr_list)<br>
 {<br>
-   struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;<br>
+   struct wl_drm_buffer *buffer;<br>
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>
    const struct wl_drm_components_descriptor *f;<br>
    __DRIimage *dri_image;<br>
@@ -1203,7 +1207,8 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,<br>
    EGLint err;<br>
    int32_t plane;<br>
<br>
-   if (!wayland_buffer_is_drm(&buffer->buffer))<br>
+   buffer = wayland_drm_buffer_get((struct wl_resource *) _buffer);<br>
+   if (!buffer)<br>
        return NULL;<br>
<br>
    err = _eglParseImageAttribList(&attrs, disp, attr_list);<br>
@@ -1508,8 +1513,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd,<br>
<br>
    if (fd == -1)<br>
       img = dri2_dpy->image->createImageFromNames(dri2_dpy->dri_screen,<br>
-                                                  buffer->buffer.width,<br>
-                                                  buffer->buffer.height,<br>
+                                                  buffer->width,<br>
+                                                  buffer->height,<br>
                                                   buffer->format,<br>
                                                   (int*)&name, 1,<br>
                                                   buffer->stride,<br>
@@ -1517,8 +1522,8 @@ dri2_wl_reference_buffer(void *user_data, uint32_t name, int fd,<br>
                                                   NULL);<br>
    else<br>
       img = dri2_dpy->image->createImageFromFds(dri2_dpy->dri_screen,<br>
-                                                buffer->buffer.width,<br>
-                                                buffer->buffer.height,<br>
+                                                buffer->width,<br>
+                                                buffer->height,<br>
                                                 buffer->format,<br>
                                                 &fd, 1,<br>
                                                 buffer->stride,<br>
@@ -1607,13 +1612,14 @@ dri2_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,<br>
<br>
 static EGLBoolean<br>
 dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,<br>
-                             struct wl_buffer *_buffer,<br>
+                             struct wl_resource *buffer_resource,<br>
                              EGLint attribute, EGLint *value)<br>
 {<br>
-   struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;<br>
+   struct wl_drm_buffer *buffer;<br>
    const struct wl_drm_components_descriptor *format;<br>
<br>
-   if (!wayland_buffer_is_drm(&buffer->buffer))<br>
+   buffer = wayland_drm_buffer_get(buffer_resource);<br>
+   if (!buffer)<br>
       return EGL_FALSE;<br>
<br>
    format = buffer->driver_format;<br>
@@ -1622,10 +1628,10 @@ dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,<br>
       *value = format->components;<br>
       return EGL_TRUE;<br>
    case EGL_WIDTH:<br>
-      *value = buffer->buffer.width;<br>
+      *value = buffer->width;<br>
       return EGL_TRUE;<br>
    case EGL_HEIGHT:<br>
-      *value = buffer->buffer.height;<br>
+      *value = buffer->height;<br>
       return EGL_TRUE;<br>
    }<br>
<br>
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h<br>
index 6dfdf94..fba5f81 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2.h<br>
+++ b/src/egl/drivers/dri2/egl_dri2.h<br>
@@ -37,7 +37,6 @@<br>
<br>
 #ifdef HAVE_WAYLAND_PLATFORM<br>
 #include <wayland-client.h><br>
-#include "wayland-drm.h"<br>
 #include "wayland-egl-priv.h"<br>
 #endif<br>
<br>
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c<br>
index 4a9831b..a788295 100644<br>
--- a/src/egl/main/eglapi.c<br>
+++ b/src/egl/main/eglapi.c<br>
@@ -1571,7 +1571,7 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)<br>
 }<br>
<br>
 EGLBoolean EGLAPIENTRY<br>
-eglQueryWaylandBufferWL(EGLDisplay dpy,struct wl_buffer *buffer,<br>
+eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer,<br>
                         EGLint attribute, EGLint *value)<br>
 {<br>
    _EGLDisplay *disp = _eglLockDisplay(dpy);<br>
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h<br>
index ee382d0..4a4f976 100644<br>
--- a/src/egl/main/eglapi.h<br>
+++ b/src/egl/main/eglapi.h<br>
@@ -123,7 +123,7 @@ typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _<br>
 struct wl_display;<br>
 typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);<br>
 typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);<br>
-typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_buffer *buffer, EGLint attribute, EGLint *value);<br>
+typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_resource *buffer, EGLint attribute, EGLint *value);<br>
 #endif<br>
<br>
 typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);<br>
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c<br>
index 7e2073a..d317c5e 100644<br>
--- a/src/egl/wayland/wayland-drm/wayland-drm.c<br>
+++ b/src/egl/wayland/wayland-drm/wayland-drm.c<br>
@@ -37,6 +37,8 @@<br>
 #include "wayland-drm.h"<br>
 #include "wayland-drm-server-protocol.h"<br>
<br>
+#define MIN(x,y) (((x)<(y))?(x):(y))<br>
+<br>
 struct wl_drm {<br>
        struct wl_display *display;<br>
<br>
@@ -86,8 +88,8 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,<br>
        }<br>
<br>
        buffer->drm = drm;<br>
-       buffer->buffer.width = width;<br>
-       buffer->buffer.height = height;<br>
+       buffer->width = width;<br>
+       buffer->height = height;<br>
        buffer->format = format;<br>
        buffer->offset[0] = offset0;<br>
        buffer->stride[0] = stride0;<br>
@@ -104,16 +106,17 @@ create_buffer(struct wl_client *client, struct wl_resource *resource,<br>
                return;<br>
        }<br>
<br>
-       buffer-><a href="http://buffer.resource.object.id" target="_blank">buffer.resource.object.id</a> = id;<br>
-       buffer->buffer.resource.object.interface = &wl_buffer_interface;<br>
-       buffer->buffer.resource.object.implementation =<br>
-               (void (**)(void)) &drm_buffer_interface;<br>
-       buffer->buffer.resource.data = buffer;<br>
-<br>
-       buffer->buffer.resource.destroy = destroy_buffer;<br>
-       buffer->buffer.resource.client = resource->client;<br>
+       buffer->resource =<br>
+               wl_resource_create(client, &wl_buffer_interface, 1, id);<br>
+       if (!buffer->resource) {<br>
+               wl_resource_post_no_memory(resource);<br>
+               free(buffer);<br>
+               return;<br>
+       }<br>
<br>
-       wl_client_add_resource(resource->client, &buffer->buffer.resource);<br>
+       wl_resource_set_implementation(buffer->resource,<br>
+                                      (void (**)(void)) &drm_buffer_interface,<br>
+                                      buffer, destroy_buffer);<br>
 }<br>
<br>
 static void<br>
@@ -208,8 +211,15 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)<br>
        struct wl_resource *resource;<br>
         uint32_t capabilities;<br>
<br>
-       resource = wl_client_add_object(client, &wl_drm_interface,<br>
-                                       &drm_interface, id, data);<br>
+       resource = wl_resource_create(client, &wl_drm_interface,<br>
+                                     MIN(version, 2), id);<br>
+       if (!resource) {<br>
+               wl_client_post_no_memory(client);<br>
+               return;<br>
+       }<br>
+<br>
+       wl_resource_set_implementation(resource, &drm_interface, data, NULL);<br>
+<br>
        wl_resource_post_event(resource, WL_DRM_DEVICE, drm->device_name);<br>
        wl_resource_post_event(resource, WL_DRM_FORMAT,<br>
                               WL_DRM_FORMAT_ARGB8888);<br>
@@ -232,6 +242,19 @@ bind_drm(struct wl_client *client, void *data, uint32_t version, uint32_t id)<br>
            wl_resource_post_event(resource, WL_DRM_CAPABILITIES, capabilities);<br>
 }<br>
<br>
+struct wl_drm_buffer *<br>
+wayland_drm_buffer_get(struct wl_resource *resource)<br>
+{<br>
+       if (resource == NULL)<br>
+               return NULL;<br>
+<br>
+       if (wl_resource_instance_of(resource, &wl_buffer_interface,<br>
+                                   &drm_buffer_interface))<br>
+               return wl_resource_get_user_data(resource);<br>
+       else<br>
+               return NULL;<br>
+}<br>
+<br>
 struct wl_drm *<br>
 wayland_drm_init(struct wl_display *display, char *device_name,<br>
                  struct wayland_drm_callbacks *callbacks, void *user_data,<br>
@@ -247,7 +270,7 @@ wayland_drm_init(struct wl_display *display, char *device_name,<br>
        drm->user_data = user_data;<br>
         drm->flags = flags;<br>
<br>
-       wl_display_add_global(display, &wl_drm_interface, drm, bind_drm);<br>
+       wl_global_create(display, &wl_drm_interface, 2, drm, bind_drm);<br>
<br>
        return drm;<br>
 }<br>
@@ -262,25 +285,14 @@ wayland_drm_uninit(struct wl_drm *drm)<br>
        free(drm);<br>
 }<br>
<br>
-int<br>
-wayland_buffer_is_drm(struct wl_buffer *buffer)<br>
-{<br>
-       return buffer->resource.object.implementation ==<br>
-               (void (**)(void)) &drm_buffer_interface;<br>
-}<br>
-<br>
 uint32_t<br>
-wayland_drm_buffer_get_format(struct wl_buffer *buffer_base)<br>
+wayland_drm_buffer_get_format(struct wl_drm_buffer *buffer)<br>
 {<br>
-       struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;<br>
-<br>
        return buffer->format;<br>
 }<br>
<br>
 void *<br>
-wayland_drm_buffer_get_buffer(struct wl_buffer *buffer_base)<br>
+wayland_drm_buffer_get_buffer(struct wl_drm_buffer *buffer)<br>
 {<br>
-       struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) buffer_base;<br>
-<br>
        return buffer->driver_buffer;<br>
 }<br>
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.h b/src/egl/wayland/wayland-drm/wayland-drm.h<br>
index 335073a..ca04882 100644<br>
--- a/src/egl/wayland/wayland-drm/wayland-drm.h<br>
+++ b/src/egl/wayland/wayland-drm/wayland-drm.h<br>
@@ -70,8 +70,9 @@ enum wl_drm_format {<br>
 struct wl_drm;<br>
<br>
 struct wl_drm_buffer {<br>
-       struct wl_buffer buffer;<br>
+       struct wl_resource *resource;<br>
        struct wl_drm *drm;<br>
+       int32_t width, height;<br>
        uint32_t format;<br>
         const void *driver_format;<br>
         int32_t offset[3];<br>
@@ -90,6 +91,9 @@ struct wayland_drm_callbacks {<br>
<br>
 enum { WAYLAND_DRM_PRIME = 0x01 };<br>
<br>
+struct wl_drm_buffer *<br>
+wayland_drm_buffer_get(struct wl_resource *resource);<br>
+<br>
 struct wl_drm *<br>
 wayland_drm_init(struct wl_display *display, char *device_name,<br>
                 struct wayland_drm_callbacks *callbacks, void *user_data,<br>
@@ -98,13 +102,10 @@ wayland_drm_init(struct wl_display *display, char *device_name,<br>
 void<br>
 wayland_drm_uninit(struct wl_drm *drm);<br>
<br>
-int<br>
-wayland_buffer_is_drm(struct wl_buffer *buffer);<br>
-<br>
 uint32_t<br>
-wayland_drm_buffer_get_format(struct wl_buffer *buffer_base);<br>
+wayland_drm_buffer_get_format(struct wl_drm_buffer *buffer);<br>
<br>
 void *<br>
-wayland_drm_buffer_get_buffer(struct wl_buffer *buffer);<br>
+wayland_drm_buffer_get_buffer(struct wl_drm_buffer *buffer);<br>
<br>
 #endif<br>
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c<br>
index 2e5424e..3ee0d67 100644<br>
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c<br>
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c<br>
@@ -874,7 +874,7 @@ egl_g3d_unbind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *dpy,<br>
<br>
 static EGLBoolean<br>
 egl_g3d_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *dpy,<br>
-                                struct wl_buffer *buffer,<br>
+                                struct wl_resource *buffer,<br>
                                 EGLint attribute, EGLint *value)<br>
 {<br>
    struct egl_g3d_display *gdpy = egl_g3d_display(dpy);<br>
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_image.c b/src/gallium/state_trackers/egl/common/egl_g3d_image.c<br>
index aa1980b..c459dc3 100644<br>
--- a/src/gallium/state_trackers/egl/common/egl_g3d_image.c<br>
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.c<br>
@@ -183,7 +183,7 @@ egl_g3d_reference_drm_buffer(_EGLDisplay *dpy, EGLint name,<br>
 #ifdef EGL_WL_bind_wayland_display<br>
<br>
 static struct pipe_resource *<br>
-egl_g3d_reference_wl_buffer(_EGLDisplay *dpy, struct wl_buffer *buffer,<br>
+egl_g3d_reference_wl_buffer(_EGLDisplay *dpy, struct wl_resource *buffer,<br>
                             _EGLImage *img, const EGLint *attribs)<br>
 {<br>
    struct egl_g3d_display *gdpy = egl_g3d_display(dpy);<br>
@@ -253,7 +253,7 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,<br>
 #ifdef EGL_WL_bind_wayland_display<br>
    case EGL_WAYLAND_BUFFER_WL:<br>
       ptex = egl_g3d_reference_wl_buffer(dpy,<br>
-            (struct wl_buffer *) buffer, &gimg->base, attribs);<br>
+            (struct wl_resource *) buffer, &gimg->base, attribs);<br>
       break;<br>
 #endif<br>
 #ifdef EGL_ANDROID_image_native_buffer<br>
diff --git a/src/gallium/state_trackers/egl/common/native_wayland_bufmgr.h b/src/gallium/state_trackers/egl/common/native_wayland_bufmgr.h<br>
index dd27828..eb324bf 100644<br>
--- a/src/gallium/state_trackers/egl/common/native_wayland_bufmgr.h<br>
+++ b/src/gallium/state_trackers/egl/common/native_wayland_bufmgr.h<br>
@@ -27,7 +27,7 @@<br>
<br>
 struct native_display;<br>
 struct wl_display;<br>
-struct wl_buffer;<br>
+struct wl_resource;<br>
 struct pipe_resource;<br>
<br>
 struct native_display_wayland_bufmgr {<br>
@@ -38,11 +38,11 @@ struct native_display_wayland_bufmgr {<br>
                              struct wl_display *wl_dpy);<br>
<br>
    struct pipe_resource *(*buffer_get_resource)(struct native_display *ndpy,<br>
-                                                struct wl_buffer *buffer);<br>
+                                                struct wl_resource *buffer);<br>
<br>
<br>
    boolean (*query_buffer)(struct native_display *ndpy,<br>
-                           struct wl_buffer *buffer,<br>
+                           struct wl_resource *buffer,<br>
                            int attribute, int *value);<br>
 };<br>
<br>
diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr.c b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr.c<br>
index 1603a3a..9b69cb9 100644<br>
--- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr.c<br>
+++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr.c<br>
@@ -70,8 +70,8 @@ wayland_drm_bufmgr_reference_buffer(void *user_data, uint32_t name, int fd,<br>
    templ.target = PIPE_TEXTURE_2D;<br>
    templ.format = pf;<br>
    templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;<br>
-   templ.width0 = buffer->buffer.width;<br>
-   templ.height0 = buffer->buffer.height;<br>
+   templ.width0 = buffer->width;<br>
+   templ.height0 = buffer->height;<br>
    templ.depth0 = 1;<br>
    templ.array_size = 1;<br>
<br>
@@ -137,22 +137,29 @@ wayland_drm_bufmgr_unbind_display(struct native_display *ndpy,<br>
<br>
 static struct pipe_resource *<br>
 wayland_drm_bufmgr_wl_buffer_get_resource(struct native_display *ndpy,<br>
-                                          struct wl_buffer *buffer)<br>
+                                          struct wl_resource *buffer_resource)<br>
 {<br>
+   struct wl_drm_buffer *buffer = wayland_drm_buffer_get(buffer_resource);<br>
+<br>
+   if (!buffer)<br>
+      return NULL;<br>
+<br>
    return wayland_drm_buffer_get_buffer(buffer);<br>
 }<br>
<br>
 static EGLBoolean<br>
 wayland_drm_bufmgr_query_buffer(struct native_display *ndpy,<br>
-                                struct wl_buffer *_buffer,<br>
+                                struct wl_resource *buffer_resource,<br>
                                 EGLint attribute, EGLint *value)<br>
 {<br>
-   struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;<br>
-   struct pipe_resource *resource = buffer->driver_buffer;<br>
+   struct wl_drm_buffer *buffer = wayland_drm_buffer_get(buffer_resource);<br>
+   struct pipe_resource *resource;<br>
<br>
-   if (!wayland_buffer_is_drm(&buffer->buffer))<br>
+   if (!buffer)<br>
       return EGL_FALSE;<br>
<br>
+   resource = buffer->driver_buffer;<br>
+<br>
    switch (attribute) {<br>
    case EGL_TEXTURE_FORMAT:<br>
       switch (resource->format) {<br>
@@ -166,10 +173,10 @@ wayland_drm_bufmgr_query_buffer(struct native_display *ndpy,<br>
          return EGL_FALSE;<br>
       }<br>
    case EGL_WIDTH:<br>
-      *value = buffer->buffer.width;<br>
+      *value = buffer->width;<br>
       return EGL_TRUE;<br>
    case EGL_HEIGHT:<br>
-      *value = buffer->buffer.height;<br>
+      *value = buffer->height;<br>
       return EGL_TRUE;<br>
    default:<br>
       return EGL_FALSE;<br>
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c<br>
index a3a0530..f7da79c 100644<br>
--- a/src/gbm/backends/dri/gbm_dri.c<br>
+++ b/src/gbm/backends/dri/gbm_dri.c<br>
@@ -374,9 +374,10 @@ gbm_dri_bo_import(struct gbm_device *gbm,<br>
 #if HAVE_WAYLAND_PLATFORM<br>
    case GBM_BO_IMPORT_WL_BUFFER:<br>
    {<br>
-      struct wl_drm_buffer *wb = (struct wl_drm_buffer *) buffer;<br>
+      struct wl_drm_buffer *wb;<br>
<br>
-      if (!wayland_buffer_is_drm(buffer))<br>
+      wb = wayland_drm_buffer_get((struct wl_resource *) buffer);<br>
+      if (!wb)<br>
          return NULL;<br>
<br>
       image = wb->driver_buffer;<br>
--<br>
1.8.1.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>