Flushing the command queue before mapping a resource is not enough
to guaruantee that the mapped content is not stale. We have to finish
to make sure that the gb readback actually updated the guest surface.
This fixes races in direct maps (map reads raced with gb readbacks)
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16061>
if (!svga->swc->force_coherent || tex->imported) {
/* Readback the whole surface */
- readback_texture_surface(svga, tex, surf);
+ readback_texture_surface(svga, tex, surf);
- svga_context_flush(svga, NULL);
+ svga_context_finish(svga);
}
/*
* Note: if PIPE_MAP_DISCARD_WHOLE_RESOURCE were specified