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: 58f90fd03f ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9816
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27718>
(cherry picked from commit 7a6836611e39cf00c32b6e189ca7eb2f370d68fe)
This commit is contained in:
Michel Dänzer 2024-02-21 10:40:33 +01:00 committed by Eric Engestrom
parent 83250a30aa
commit 40ab1da1b4
2 changed files with 7 additions and 1 deletions

View file

@ -1114,7 +1114,7 @@
"description": "egl/wayland: Flush after blitting to linear copy", "description": "egl/wayland: Flush after blitting to linear copy",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "58f90fd03f4aaf2ee19010e9cbd9cee2deda9711", "because_sha": "58f90fd03f4aaf2ee19010e9cbd9cee2deda9711",
"notes": null "notes": null

View file

@ -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->current->dri_image, 0, 0, dri2_surf->base.Width,
dri2_surf->base.Height, 0, 0, dri2_surf->base.Width, dri2_surf->base.Height, 0, 0, dri2_surf->base.Width,
dri2_surf->base.Height, 0); 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); wl_surface_commit(dri2_surf->wl_surface_wrapper);