From b56194649704bd0da2d8dd3044fff2e80d07f3f9 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 4 Feb 2022 18:17:51 +0000 Subject: [PATCH] egl/wayland: Don't replace existing backbuffer in get_buffers If the surface already has a current backbuffer - say through a buffer_age query - we do not want to replace it in get_buffers, because it means the result we'd previously returned them is stale. If we already have a backbuffer set on the surface, keep it locked in no matter what until we hit SwapBuffers. Signed-off-by: Daniel Stone Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 5ff83cce08a..1c2d9540da9 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1172,7 +1172,7 @@ dri2_wl_get_buffers_with_format(__DRIdrawable * driDrawable, struct dri2_egl_surface *dri2_surf = loaderPrivate; int i, j; - if (update_buffers(dri2_surf) < 0) + if (update_buffers_if_needed(dri2_surf) < 0) return NULL; for (i = 0, j = 0; i < 2 * count; i += 2, j++) { @@ -1251,7 +1251,7 @@ image_get_buffers(__DRIdrawable *driDrawable, { struct dri2_egl_surface *dri2_surf = loaderPrivate; - if (update_buffers(dri2_surf) < 0) + if (update_buffers_if_needed(dri2_surf) < 0) return 0; buffers->image_mask = __DRI_IMAGE_BUFFER_BACK;