aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.h12
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c13
2 files changed, 7 insertions, 18 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h
index b3559446fa9..bd219742e68 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.h
+++ b/src/gallium/drivers/svga/svga_resource_buffer.h
@@ -289,6 +289,9 @@ svga_buffer_hw_storage_map(struct svga_context *svga,
boolean rebind;
void *map;
+ if (swc->force_coherent) {
+ flags |= PIPE_TRANSFER_PERSISTENT | PIPE_TRANSFER_COHERENT;
+ }
map = swc->surface_map(swc, sbuf->handle, flags, retry, &rebind);
if (map && rebind) {
enum pipe_error ret;
@@ -330,15 +333,6 @@ svga_buffer_hw_storage_unmap(struct svga_context *svga,
ret = SVGA3D_BindGBSurface(swc, sbuf->handle);
assert(ret == PIPE_OK);
}
- if (swc->force_coherent) {
- ret = SVGA3D_UpdateGBSurface(swc, sbuf->handle);
- if (ret != PIPE_OK) {
- /* flush and retry */
- svga_context_flush(svga, NULL);
- ret = SVGA3D_UpdateGBSurface(swc, sbuf->handle);
- assert(ret == PIPE_OK);
- }
- }
}
} else
sws->buffer_unmap(sws, sbuf->hwbuf);
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index 58b2f64d0b7..2385da2e999 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -462,6 +462,10 @@ svga_texture_transfer_map_direct(struct svga_context *svga,
unsigned offset, mip_width, mip_height;
struct svga_winsys_context *swc = svga->swc;
+ if (swc->force_coherent) {
+ usage |= PIPE_TRANSFER_PERSISTENT | PIPE_TRANSFER_COHERENT;
+ }
+
map = swc->surface_map(swc, surf, usage, &retry, &rebind);
if (map == NULL && retry) {
/*
@@ -709,15 +713,6 @@ svga_texture_surface_unmap(struct svga_context *svga,
ret = SVGA3D_BindGBSurface(swc, surf);
assert(ret == PIPE_OK);
}
- if (swc->force_coherent) {
- ret = SVGA3D_UpdateGBSurface(swc, surf);
- if (ret != PIPE_OK) {
- /* flush and retry */
- svga_context_flush(svga, NULL);
- ret = SVGA3D_UpdateGBSurface(swc, surf);
- assert(ret == PIPE_OK);
- }
- }
}
}