summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-07-15 01:06:58 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-08-03 17:46:46 +0200
commit435d9595d38981187a2eaa025fc437cfc1295107 (patch)
tree980092b60e046978f554273d0bd4b517832c8a3c /src/gallium/drivers/r600
parenta6bfafa083ef4f3320ca45bfc3e5697674e4b12c (diff)
downloadexternal_mesa3d-435d9595d38981187a2eaa025fc437cfc1295107.zip
external_mesa3d-435d9595d38981187a2eaa025fc437cfc1295107.tar.gz
external_mesa3d-435d9595d38981187a2eaa025fc437cfc1295107.tar.bz2
r600g: use last_gfx_fence like radeonsi
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_hw_context.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index ea6902f..2ddea13 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -252,9 +252,16 @@ void r600_context_gfx_flush(void *context, unsigned flags,
{
struct r600_context *ctx = context;
struct radeon_winsys_cs *cs = ctx->b.gfx.cs;
-
- if (!radeon_emitted(cs, ctx->b.initial_gfx_cs_size) && !fence)
+ struct radeon_winsys *ws = ctx->b.ws;
+
+ if (!radeon_emitted(cs, ctx->b.initial_gfx_cs_size) &&
+ (!fence || ctx->b.last_gfx_fence)) {
+ if (fence)
+ ws->fence_reference(fence, ctx->b.last_gfx_fence);
+ if (!(flags & RADEON_FLUSH_ASYNC))
+ ws->cs_sync_flush(cs);
return;
+ }
r600_preflush_suspend_features(&ctx->b);
@@ -275,7 +282,9 @@ void r600_context_gfx_flush(void *context, unsigned flags,
}
/* Flush the CS. */
- ctx->b.ws->cs_flush(cs, flags, fence);
+ ws->cs_flush(cs, flags, &ctx->b.last_gfx_fence);
+ if (fence)
+ ws->fence_reference(fence, ctx->b.last_gfx_fence);
r600_begin_new_cs(ctx);
}