Mesa (main): egl/wayland: Don't replace existing backbuffer in get_buffers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 7 10:31:52 UTC 2022


Module: Mesa
Branch: main
Commit: b56194649704bd0da2d8dd3044fff2e80d07f3f9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b56194649704bd0da2d8dd3044fff2e80d07f3f9

Author: Daniel Stone <daniels at collabora.com>
Date:   Fri Feb  4 18:17:51 2022 +0000

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 <daniels at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14873>

---

 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;



More information about the mesa-commit mailing list