summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2022-03-02 14:08:09 -0500
committerDylan Baker <dylan.c.baker@intel.com>2022-06-01 14:10:27 -0700
commit991e904e95c386a2dfa29b6290a6491cf655c444 (patch)
treec5280278d7596e6f56376012e774c36a8ccebfbe
parent6ec3f71e05dbf3f26e6f4a37189da871d40fa139 (diff)
svga: finish readbacks before mapping resources
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> (cherry picked from commit c7b0309723721495edd318eb6ecd4446900d702b) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564>
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index cc1514bff70..ff2c500dbb4 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -342,9 +342,9 @@ svga_texture_transfer_map_direct(struct svga_context *svga,
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