From d90b14c7687635bc6f9ace9ef5fa897405a0fe09 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 22 Feb 2024 10:04:26 -0500 Subject: [PATCH] egl/wayland/sw: fix no-op updating of current backbuffer if the frontbuffer is the backbuffer then its contents are up-to-date Acked-by: Daniel Stone Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index f1c1b08b0b9..8109b033dc6 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2432,12 +2432,14 @@ dri2_wl_swrast_get_image(__DRIdrawable *read, int x, int y, int w, int h, char *src, *dst; src = dri2_wl_swrast_get_frontbuffer_data(dri2_surf); + /* this is already the most up-to-date buffer */ + if (src == data) + return; if (!src) { memset(data, 0, copy_width * h); return; } - assert(data != src); assert(copy_width <= src_stride); src += x_offset;