r600g: use last_gfx_fence like radeonsi

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák
2016-07-15 01:06:58 +02:00
parent a6bfafa083
commit 435d9595d3
+11 -2
View File
@@ -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;
struct radeon_winsys *ws = ctx->b.ws;
if (!radeon_emitted(cs, ctx->b.initial_gfx_cs_size) && !fence)
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);
}