<div dir="ltr">Can you wrap color_buffers around:<div><br></div><div><span style="font-size:12.8px">#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) || defined(HAVE_ANDROID_PLATFO</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">RM)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">flags?  This is because platform_surfaceless has no native surfaces and it's good to be explicit in that regard.</span><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 2:38 PM, Gwan-gyeong Mun <span dir="ltr"><<a href="mailto:elongbug@gmail.com" target="_blank">elongbug@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is added for preventing adding of new color buffers structure and back*<br>
when new platform backend is added.<br>
This refactoring separates out the common and platform specific bits.<br>
This makes odd casting in the platform_foo.c but it prevents adding of new<br>
ifdef magic.<br>
Because of color_buffers array size is different on android and wayland /drm,<br>
it adds COLOR_BUFFERS_SIZE macro.<br>
 - android's color buffers array size is 3.<br>
   drm & wayland's color buffers array size is 4.<br>
<br>
Fixes from Rob's review:<br>
 - refactor to separate out the common and platform specific bits.<br>
<br>
Fixes from Emil's review:<br>
 - use suggested color buffers structure shape.<br>
   it makes a buffer pointer of each platform to void pointer type.<br>
<br>
Signed-off-by: Mun Gwan-gyeong <<a href="mailto:elongbug@gmail.com" target="_blank">elongbug@gmail.com</a>><br>
---<br>
 src/egl/drivers/dri2/egl_<wbr>dri2.h         | 30 +++++++++---------<br>
 src/egl/drivers/dri2/<wbr>platform_android.c | 10 +++---<br>
 src/egl/drivers/dri2/<wbr>platform_drm.c     | 55 +++++++++++++++++-------------<wbr>---<br>
 src/egl/drivers/dri2/<wbr>platform_wayland.c | 46 +++++++++++++--------------<br>
 4 files changed, 71 insertions(+), 70 deletions(-)<br>
<br>
diff --git a/src/egl/drivers/dri2/egl_dri<wbr>2.h b/src/egl/drivers/dri2/egl_dri<wbr>2.h<br>
index 017895f0d9..08ccf24410 100644<br>
--- a/src/egl/drivers/dri2/egl_dri<wbr>2.h<br>
+++ b/src/egl/drivers/dri2/egl_dri<wbr>2.h<br>
@@ -65,6 +65,15 @@ struct zwp_linux_dmabuf_v1;<br>
<br>
 #endif /* HAVE_ANDROID_PLATFORM */<br>
<br>
+#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)<br>
+#define COLOR_BUFFERS_SIZE 4<br>
+#else<br>
+       /* Usually Android uses at most triple buffers in ANativeWindow<br>
+        * so hardcode the number of color_buffers to 3.<br>
+        */<br>
+#define COLOR_BUFFERS_SIZE 3<br>
+#endif<br>
+<br>
 #include "eglconfig.h"<br>
 #include "eglcontext.h"<br>
 #include "egldisplay.h"<br>
@@ -286,39 +295,28 @@ struct dri2_egl_surface<br>
    /* EGL-owned buffers */<br>
    __DRIbuffer           *local_buffers[__DRI_BUFFER_C<wbr>OUNT];<br>
<br>
-#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM)<br>
+   /* Used to record all the buffers created by each platform's native window<br>
+    * and their ages.<br>
+    */<br>
    struct {<br>
+      void *native_buffer; // aka wl_buffer/gbm_bo/ANativeWindow<wbr>Buffer<br>
 #ifdef HAVE_WAYLAND_PLATFORM<br>
-      struct wl_buffer   *wl_buffer;<br>
       __DRIimage         *dri_image;<br>
       /* for is_different_gpu case. NULL else */<br>
       __DRIimage         *linear_copy;<br>
       /* for swrast */<br>
       void *data;<br>
       int data_size;<br>
-#endif<br>
-#ifdef HAVE_DRM_PLATFORM<br>
-      struct gbm_bo       *bo;<br>
 #endif<br>
       bool                locked;<br>
       int                 age;<br>
-   } color_buffers[4], *back, *current;<br>
-#endif<br>
+   } color_buffers[COLOR_BUFFERS_SI<wbr>ZE], *back, *current;<br>
<br>
 #ifdef HAVE_ANDROID_PLATFORM<br>
    struct ANativeWindow *window;<br>
    struct ANativeWindowBuffer *buffer;<br>
    __DRIimage *dri_image_back;<br>
    __DRIimage *dri_image_front;<br>
-<br>
-   /* Used to record all the buffers created by ANativeWindow and their ages.<br>
-    * Usually Android uses at most triple buffers in ANativeWindow<br>
-    * so hardcode the number of color_buffers to 3.<br>
-    */<br>
-   struct {<br>
-      struct ANativeWindowBuffer *buffer;<br>
-      int age;<br>
-   } color_buffers[3], *back;<br>
 #endif<br>
<br>
 #if defined(HAVE_SURFACELESS_PLATF<wbr>ORM)<br>
diff --git a/src/egl/drivers/dri2/platfor<wbr>m_android.c b/src/egl/drivers/dri2/platfor<wbr>m_android.c<br>
index 0acbb38bd8..67e739c1fc 100644<br>
--- a/src/egl/drivers/dri2/platfor<wbr>m_android.c<br>
+++ b/src/egl/drivers/dri2/platfor<wbr>m_android.c<br>
@@ -193,10 +193,10 @@ droid_window_dequeue_buffer(st<wbr>ruct dri2_egl_surface *dri2_surf)<br>
     */<br>
    EGLBoolean updated = EGL_FALSE;<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-      if (!dri2_surf->color_buffers[i].<wbr>buffer) {<br>
-         dri2_surf->color_buffers[i].b<wbr>uffer = dri2_surf->buffer;<br>
+      if (!dri2_surf->color_buffers[i].<wbr>native_buffer) {<br>
+         dri2_surf->color_buffers[i].n<wbr>ative_buffer = (void *)dri2_surf->buffer;<br>
       }<br>
-      if (dri2_surf->color_buffers[i].b<wbr>uffer == dri2_surf->buffer) {<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer == (void *)dri2_surf->buffer) {<br>
          dri2_surf->back = &dri2_surf->color_buffers[i];<br>
          updated = EGL_TRUE;<br>
          break;<br>
@@ -208,10 +208,10 @@ droid_window_dequeue_buffer(st<wbr>ruct dri2_egl_surface *dri2_surf)<br>
        * the color_buffers<br>
        */<br>
       for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-         dri2_surf->color_buffers[i].b<wbr>uffer = NULL;<br>
+         dri2_surf->color_buffers[i].n<wbr>ative_buffer = NULL;<br>
          dri2_surf->color_buffers[i].ag<wbr>e = 0;<br>
       }<br>
-      dri2_surf->color_buffers[0].bu<wbr>ffer = dri2_surf->buffer;<br>
+      dri2_surf->color_buffers[0].na<wbr>tive_buffer = (void *)dri2_surf->buffer;<br>
       dri2_surf->back = &dri2_surf->color_buffers[0];<br>
    }<br>
<br>
diff --git a/src/egl/drivers/dri2/platfor<wbr>m_drm.c b/src/egl/drivers/dri2/platfor<wbr>m_drm.c<br>
index 9005f5dd9e..3527352bab 100644<br>
--- a/src/egl/drivers/dri2/platfor<wbr>m_drm.c<br>
+++ b/src/egl/drivers/dri2/platfor<wbr>m_drm.c<br>
@@ -53,7 +53,7 @@ lock_front_buffer(struct gbm_surface *_surf)<br>
       return NULL;<br>
    }<br>
<br>
-   bo = dri2_surf->current->bo;<br>
+   bo = (struct gbm_bo *)dri2_surf->current->native_b<wbr>uffer;<br>
<br>
    if (device->dri2) {<br>
       dri2_surf->current->locked = true;<br>
@@ -70,7 +70,7 @@ release_buffer(struct gbm_surface *_surf, struct gbm_bo *bo)<br>
    struct dri2_egl_surface *dri2_surf = surf->dri_private;<br>
<br>
    for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-      if (dri2_surf->color_buffers[i].b<wbr>o == bo) {<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer == (void *)bo) {<br>
         dri2_surf->color_buffers[i].l<wbr>ocked = false;<br>
         break;<br>
       }<br>
@@ -172,8 +172,8 @@ dri2_drm_destroy_surface(_EGLD<wbr>river *drv, _EGLDisplay *disp, _EGLSurface *surf)<br>
    dri2_dpy->core->destroyDrawabl<wbr>e(dri2_surf->dri_drawable);<br>
<br>
    for (unsigned i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-      if (dri2_surf->color_buffers[i].b<wbr>o)<br>
-        gbm_bo_destroy(dri2_surf->colo<wbr>r_buffers[i].bo);<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer)<br>
+        gbm_bo_destroy((struct gbm_bo *)dri2_surf->color_buffers[i].<wbr>native_buffer);<br>
    }<br>
<br>
    dri2_egl_surface_free_local_bu<wbr>ffers(dri2_surf);<br>
@@ -204,23 +204,24 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)<br>
<br>
    if (dri2_surf->back == NULL)<br>
       return -1;<br>
-   if (dri2_surf->back->bo == NULL) {<br>
+   if (dri2_surf->back->native_buffe<wbr>r == NULL) {<br>
       if (surf->base.modifiers)<br>
-         dri2_surf->back->bo = gbm_bo_create_with_modifiers(&<wbr>dri2_dpy->gbm_dri->base,<br>
-                                                            surf->base.width,<br>
-                                                            surf->base.height,<br>
-                                                            surf->base.format,<br>
-                                                            surf->base.modifiers,<br>
-                                                            surf->base.count);<br>
+         dri2_surf->back->native_<wbr>buffer =<br>
+            (void *)gbm_bo_create_with_modifiers<wbr>(&dri2_dpy->gbm_dri->base,<br>
+                                                 surf->base.width,<br>
+                                                 surf->base.height,<br>
+                                                 surf->base.format,<br>
+                                                 surf->base.modifiers,<br>
+                                                 surf->base.count);<br>
       else<br>
-         dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_d<wbr>ri->base,<br>
-                                             surf->base.width,<br>
-                                             surf->base.height,<br>
-                                             surf->base.format,<br>
-                                             surf->base.flags);<br>
+         dri2_surf->back->native_<wbr>buffer = (void *)gbm_bo_create(&dri2_dpy->gbm<wbr>_dri->base,<br>
+                                                                surf->base.width,<br>
+                                                                surf->base.height,<br>
+                                                                surf->base.format,<br>
+                                                                surf->base.flags);<br>
<br>
    }<br>
-   if (dri2_surf->back->bo == NULL)<br>
+   if (dri2_surf->back->native_buffe<wbr>r == NULL)<br>
       return -1;<br>
<br>
    return 0;<br>
@@ -238,11 +239,13 @@ get_swrast_front_bo(struct dri2_egl_surface *dri2_surf)<br>
       dri2_surf->current = &dri2_surf->color_buffers[0];<br>
    }<br>
<br>
-   if (dri2_surf->current->bo == NULL)<br>
-      dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_d<wbr>ri->base,<br>
-                                             surf->base.width, surf->base.height,<br>
-                                             surf->base.format, surf->base.flags);<br>
-   if (dri2_surf->current->bo == NULL)<br>
+   if (dri2_surf->current->native_bu<wbr>ffer == NULL)<br>
+      dri2_surf->current->native_buf<wbr>fer = (void *)gbm_bo_create(&dri2_dpy->gbm<wbr>_dri->base,<br>
+                                                                surf->base.width,<br>
+                                                                surf->base.height,<br>
+                                                                surf->base.format,<br>
+                                                                surf->base.flags);<br>
+   if (dri2_surf->current->native_bu<wbr>ffer == NULL)<br>
       return -1;<br>
<br>
    return 0;<br>
@@ -256,7 +259,7 @@ back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)<br>
    struct gbm_dri_bo *bo;<br>
    int name, pitch;<br>
<br>
-   bo = (struct gbm_dri_bo *) dri2_surf->back->bo;<br>
+   bo = (struct gbm_dri_bo *) dri2_surf->back->native_buffer<wbr>;<br>
<br>
    dri2_dpy->image->queryImage(bo<wbr>->image, __DRI_IMAGE_ATTRIB_NAME, &name);<br>
    dri2_dpy->image->queryImage(bo<wbr>->image, __DRI_IMAGE_ATTRIB_STRIDE, &pitch);<br>
@@ -360,7 +363,7 @@ dri2_drm_image_get_buffers(__D<wbr>RIdrawable *driDrawable,<br>
    if (get_back_bo(dri2_surf) < 0)<br>
       return 0;<br>
<br>
-   bo = (struct gbm_dri_bo *) dri2_surf->back->bo;<br>
+   bo = (struct gbm_dri_bo *) dri2_surf->back->native_buffer<wbr>;<br>
    buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;<br>
    buffers->back = bo->image;<br>
<br>
@@ -496,7 +499,7 @@ swrast_put_image2(__DRIdrawabl<wbr>e *driDrawable,<br>
    if (get_swrast_front_bo(dri2_surf<wbr>) < 0)<br>
       return;<br>
<br>
-   bo = gbm_dri_bo(dri2_surf->current-<wbr>>bo);<br>
+   bo = gbm_dri_bo(dri2_surf->current-<wbr>>native_buffer);<br>
<br>
    bpp = gbm_bo_get_bpp(&bo->base);<br>
    if (bpp == 0)<br>
@@ -541,7 +544,7 @@ swrast_get_image(__DRIdrawable *driDrawable,<br>
    if (get_swrast_front_bo(dri2_surf<wbr>) < 0)<br>
       return;<br>
<br>
-   bo = gbm_dri_bo(dri2_surf->current-<wbr>>bo);<br>
+   bo = gbm_dri_bo(dri2_surf->current-<wbr>>native_buffer);<br>
<br>
    bpp = gbm_bo_get_bpp(&bo->base);<br>
    if (bpp == 0)<br>
diff --git a/src/egl/drivers/dri2/platfor<wbr>m_wayland.c b/src/egl/drivers/dri2/platfor<wbr>m_wayland.c<br>
index 14db55ca74..1518a24b7c 100644<br>
--- a/src/egl/drivers/dri2/platfor<wbr>m_wayland.c<br>
+++ b/src/egl/drivers/dri2/platfor<wbr>m_wayland.c<br>
@@ -77,7 +77,7 @@ wl_buffer_release(void *data, struct wl_buffer *buffer)<br>
    int i;<br>
<br>
    for (i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); ++i)<br>
-      if (dri2_surf->color_buffers[i].w<wbr>l_buffer == buffer)<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer == (void *)buffer)<br>
          break;<br>
<br>
    if (i == ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers)) {<br>
@@ -267,8 +267,8 @@ dri2_wl_destroy_surface(_EGLDr<wbr>iver *drv, _EGLDisplay *disp, _EGLSurface *surf)<br>
    dri2_dpy->core->destroyDrawabl<wbr>e(dri2_surf->dri_drawable);<br>
<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-      if (dri2_surf->color_buffers[i].w<wbr>l_buffer)<br>
-         wl_buffer_destroy(dri2_surf-><wbr>color_buffers[i].wl_buffer);<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer)<br>
+         wl_buffer_destroy((struct wl_buffer *)dri2_surf->color_buffers[i].<wbr>native_buffer);<br>
       if (dri2_surf->color_buffers[i].d<wbr>ri_image)<br>
          dri2_dpy->image->destroyImage(<wbr>dri2_surf->color_buffers[i].dr<wbr>i_image);<br>
       if (dri2_surf->color_buffers[i].l<wbr>inear_copy)<br>
@@ -309,9 +309,9 @@ dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)<br>
       dri2_egl_display(dri2_surf->b<wbr>ase.Resource.Display);<br>
<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
-      if (dri2_surf->color_buffers[i].w<wbr>l_buffer &&<br>
+      if (dri2_surf->color_buffers[i].n<wbr>ative_buffer &&<br>
           !dri2_surf->color_buffers[i].<wbr>locked)<br>
-         wl_buffer_destroy(dri2_surf-><wbr>color_buffers[i].wl_buffer);<br>
+         wl_buffer_destroy((struct wl_buffer *)dri2_surf->color_buffers[i].<wbr>native_buffer);<br>
       if (dri2_surf->color_buffers[i].d<wbr>ri_image)<br>
          dri2_dpy->image->destroyImage(<wbr>dri2_surf->color_buffers[i].dr<wbr>i_image);<br>
       if (dri2_surf->color_buffers[i].l<wbr>inear_copy)<br>
@@ -320,7 +320,7 @@ dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)<br>
          munmap(dri2_surf->color_buffer<wbr>s[i].data,<br>
                 dri2_surf->color_buffers[i].d<wbr>ata_size);<br>
<br>
-      dri2_surf->color_buffers[i].wl<wbr>_buffer = NULL;<br>
+      dri2_surf->color_buffers[i].na<wbr>tive_buffer = NULL;<br>
       dri2_surf->color_buffers[i].d<wbr>ri_image = NULL;<br>
       dri2_surf->color_buffers[i].l<wbr>inear_copy = NULL;<br>
       dri2_surf->color_buffers[i].d<wbr>ata = NULL;<br>
@@ -514,12 +514,12 @@ update_buffers(struct dri2_egl_surface *dri2_surf)<br>
     * That means we can free any unlocked buffer now. */<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
       if (!dri2_surf->color_buffers[i].<wbr>locked &&<br>
-          dri2_surf->color_buffers[i].wl<wbr>_buffer) {<br>
-         wl_buffer_destroy(dri2_surf-><wbr>color_buffers[i].wl_buffer);<br>
+          dri2_surf->color_buffers[i].na<wbr>tive_buffer) {<br>
+         wl_buffer_destroy((struct wl_buffer *)dri2_surf->color_buffers[i].<wbr>native_buffer);<br>
          dri2_dpy->image->destroyImage(<wbr>dri2_surf->color_buffers[i].dr<wbr>i_image);<br>
          if (dri2_dpy->is_different_gpu)<br>
             dri2_dpy->image-><wbr>destroyImage(dri2_surf->color_<wbr>buffers[i].linear_copy);<br>
-         dri2_surf->color_buffers[i].w<wbr>l_buffer = NULL;<br>
+         dri2_surf->color_buffers[i].n<wbr>ative_buffer = NULL;<br>
          dri2_surf->color_buffers[i].dr<wbr>i_image = NULL;<br>
          dri2_surf->color_buffers[i].li<wbr>near_copy = NULL;<br>
       }<br>
@@ -848,7 +848,7 @@ dri2_wl_swap_buffers_with_dama<wbr>ge(_EGLDriver *drv,<br>
    dri2_surf->current = dri2_surf->back;<br>
    dri2_surf->back = NULL;<br>
<br>
-   if (!dri2_surf->current->wl_buffe<wbr>r) {<br>
+   if (!dri2_surf->current->native_b<wbr>uffer) {<br>
       __DRIimage *image;<br>
<br>
       if (dri2_dpy->is_different_gpu)<br>
@@ -856,15 +856,15 @@ dri2_wl_swap_buffers_with_dama<wbr>ge(_EGLDriver *drv,<br>
       else<br>
          image = dri2_surf->current->dri_image;<br>
<br>
-      dri2_surf->current->wl_buffer =<br>
-         create_wl_buffer(dri2_dpy, dri2_surf, image);<br>
+      dri2_surf->current->native_buf<wbr>fer =<br>
+         (void *)create_wl_buffer(dri2_dpy, dri2_surf, image);<br>
<br>
-      wl_buffer_add_listener(dri2_su<wbr>rf->current->wl_buffer,<br>
+      wl_buffer_add_listener(dri2_su<wbr>rf->current->native_buffer,<br>
                              &wl_buffer_listener, dri2_surf);<br>
    }<br>
<br>
    wl_surface_attach(dri2_surf->w<wbr>l_surface_wrapper,<br>
-                     dri2_surf->current->wl_<wbr>buffer,<br>
+                     (struct wl_buffer *)dri2_surf->current->native_b<wbr>uffer,<br>
                      dri2_surf->dx, dri2_surf->dy);<br>
<br>
    dri2_surf->wl_win->attached_wi<wbr>dth  = dri2_surf->base.Width;<br>
@@ -1521,7 +1521,7 @@ static EGLBoolean<br>
 dri2_wl_swrast_allocate_buffe<wbr>r(struct dri2_egl_surface *dri2_surf,<br>
                                int format, int w, int h,<br>
                                void **data, int *size,<br>
-                               struct wl_buffer **buffer)<br>
+                               void **buffer)<br>
 {<br>
    struct dri2_egl_display *dri2_dpy =<br>
       dri2_egl_display(dri2_surf->b<wbr>ase.Resource.Display);<br>
@@ -1546,7 +1546,7 @@ dri2_wl_swrast_allocate_buffer<wbr>(struct dri2_egl_surface *dri2_surf,<br>
    /* Share it in a wl_buffer */<br>
    pool = wl_shm_create_pool(dri2_dpy->w<wbr>l_shm, fd, size_map);<br>
    wl_proxy_set_queue((struct wl_proxy *)pool, dri2_surf->wl_queue);<br>
-   *buffer = wl_shm_pool_create_buffer(pool<wbr>, 0, w, h, stride, format);<br>
+   *buffer = (void *)wl_shm_pool_create_buffer(po<wbr>ol, 0, w, h, stride, format);<br>
    wl_shm_pool_destroy(pool);<br>
    close(fd);<br>
<br>
@@ -1585,7 +1585,7 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)<br>
    /* try get free buffer already created */<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
       if (!dri2_surf->color_buffers[i].<wbr>locked &&<br>
-          dri2_surf->color_buffers[i].wl<wbr>_buffer) {<br>
+          dri2_surf->color_buffers[i].na<wbr>tive_buffer) {<br>
           dri2_surf->back = &dri2_surf->color_buffers[i];<br>
           break;<br>
       }<br>
@@ -1602,11 +1602,11 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)<br>
                                                  dri2_surf->base.Height,<br>
                                                  &dri2_surf->back->data,<br>
                                                  &dri2_surf->back->data_size,<br>
-                                                 &dri2_surf->back->wl_buffer)) {<br>
+                                                 &dri2_surf->back->native_buff<wbr>er)) {<br>
                 _eglError(EGL_BAD_ALLOC, "failed to allocate color buffer");<br>
                  return -1;<br>
              }<br>
-             wl_buffer_add_listener(dri2_s<wbr>urf->back->wl_buffer,<br>
+             wl_buffer_add_listener((<wbr>struct wl_buffer *)dri2_surf->back->native_buff<wbr>er,<br>
                                     &wl_buffer_listener, dri2_surf);<br>
              break;<br>
          }<br>
@@ -1625,11 +1625,11 @@ swrast_update_buffers(struct dri2_egl_surface *dri2_surf)<br>
     * That means we can free any unlocked buffer now. */<br>
    for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_bu<wbr>ffers); i++) {<br>
       if (!dri2_surf->color_buffers[i].<wbr>locked &&<br>
-          dri2_surf->color_buffers[i].wl<wbr>_buffer) {<br>
-         wl_buffer_destroy(dri2_surf-><wbr>color_buffers[i].wl_buffer);<br>
+          dri2_surf->color_buffers[i].na<wbr>tive_buffer) {<br>
+         wl_buffer_destroy((struct wl_buffer *)dri2_surf->color_buffers[i].<wbr>native_buffer);<br>
          munmap(dri2_surf->color_buffer<wbr>s[i].data,<br>
                 dri2_surf->color_buffers[i].d<wbr>ata_size);<br>
-         dri2_surf->color_buffers[i].w<wbr>l_buffer = NULL;<br>
+         dri2_surf->color_buffers[i].n<wbr>ative_buffer = NULL;<br>
          dri2_surf->color_buffers[i].da<wbr>ta = NULL;<br>
       }<br>
    }<br>
@@ -1675,7 +1675,7 @@ dri2_wl_swrast_commit_backbuff<wbr>er(struct dri2_egl_surface *dri2_surf)<br>
    dri2_surf->back = NULL;<br>
<br>
    wl_surface_attach(dri2_surf->w<wbr>l_surface_wrapper,<br>
-                     dri2_surf->current->wl_<wbr>buffer,<br>
+                     (struct wl_buffer *)dri2_surf->current->native_b<wbr>uffer,<br>
                      dri2_surf->dx, dri2_surf->dy);<br>
<br>
    dri2_surf->wl_win->attached_wi<wbr>dth  = dri2_surf->base.Width;<br>
<span class="gmail-m_3836231957089432823HOEnZb"><font color="#888888">--<br>
2.14.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div></div>