From 7a6836611e39cf00c32b6e189ca7eb2f370d68fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 21 Feb 2024 10:40:33 +0100 Subject: [PATCH] egl/wayland: Flush after blitting to linear copy We need to flush after blitting to the linear copy, or the Wayland compositor may not see the correct linear buffer contents. v2: * Keep blitImage call in the same place (Daniel Stone) * Add second flush for the blit to linear copy Fixes: 58f90fd03f4a ("egl/wayland: fix glthread crashes") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9816 Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 9ce508225ec..7abdc7f11e2 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1643,6 +1643,12 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw, dri2_surf->current->dri_image, 0, 0, dri2_surf->base.Width, dri2_surf->base.Height, 0, 0, dri2_surf->base.Width, dri2_surf->base.Height, 0); + + if (dri2_dpy->flush) { + __DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw); + + dri2_dpy->flush->flush(dri_drawable); + } } wl_surface_commit(dri2_surf->wl_surface_wrapper);