[Mesa-dev] [PATCH 1/2] egl: wayland: set buffer age value to 0 when image is destroyed

Lionel Landwerlin llandwerlin at gmail.com
Wed Dec 7 11:57:52 UTC 2016


We usually set that value up when creating the buffer (NULL to non-NULL
transition). It doesn't hurt to set that value to 0 up front when we destroy
the buffer (non-NULL to NULL transition).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/egl/drivers/dri2/platform_wayland.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 395f1e181d..540cf690ca 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -297,6 +297,7 @@ dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)
       dri2_surf->color_buffers[i].linear_copy = NULL;
       dri2_surf->color_buffers[i].data = NULL;
       dri2_surf->color_buffers[i].locked = 0;
+      dri2_surf->color_buffers[i].age = 0;
    }
 
    if (dri2_dpy->dri2) {
@@ -469,6 +470,7 @@ update_buffers(struct dri2_egl_surface *dri2_surf)
          dri2_surf->color_buffers[i].wl_buffer = NULL;
          dri2_surf->color_buffers[i].dri_image = NULL;
          dri2_surf->color_buffers[i].linear_copy = NULL;
+         dri2_surf->color_buffers[i].age = 0;
       }
    }
 
-- 
2.11.0



More information about the mesa-dev mailing list