aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-10-28 12:59:38 +0100
committerMarek Olšák <[email protected]>2015-11-04 00:43:14 +0100
commit7f9122c9680a882fee5a9d5a8e09c3e3b7466937 (patch)
tree4865e66a351d3df18d3c5eefabf255d786fafb29
parent36fd65381756ed1b8f774f7fcdd555941a3d39e1 (diff)
gallium/radeon: always return the last SDMA fence on SDMA flush if needed
Reviewed-by: Michel Dänzer <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c11
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 0ad36849645..56977c06869 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -192,13 +192,15 @@ static void r600_flush_dma_ring(void *ctx, unsigned flags,
struct r600_common_context *rctx = (struct r600_common_context *)ctx;
struct radeon_winsys_cs *cs = rctx->rings.dma.cs;
- if (!cs->cdw) {
- return;
- }
+ if (!cs->cdw)
+ goto done;
rctx->rings.dma.flushing = true;
- rctx->ws->cs_flush(cs, flags, fence, 0);
+ rctx->ws->cs_flush(cs, flags, &rctx->last_sdma_fence, 0);
rctx->rings.dma.flushing = false;
+done:
+ if (fence)
+ rctx->ws->fence_reference(fence, rctx->last_sdma_fence);
}
static enum pipe_reset_status r600_get_reset_status(struct pipe_context *ctx)
@@ -297,6 +299,7 @@ void r600_common_context_cleanup(struct r600_common_context *rctx)
if (rctx->allocator_so_filled_size) {
u_suballocator_destroy(rctx->allocator_so_filled_size);
}
+ rctx->ws->fence_reference(&rctx->last_sdma_fence, NULL);
}
void r600_context_add_resource_size(struct pipe_context *ctx, struct pipe_resource *r)
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index c300c0b3332..b7f1a234baf 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -384,6 +384,7 @@ struct r600_common_context {
enum radeon_family family;
enum chip_class chip_class;
struct r600_rings rings;
+ struct pipe_fence_handle *last_sdma_fence;
unsigned initial_gfx_cs_size;
unsigned gpu_reset_counter;