radeonsi: Flush when we're asked to return a fence but don't have one yet
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 22 Jul 2015 07:11:39 +0000 (16:11 +0900)
committerMichel Dänzer <michel@daenzer.net>
Wed, 22 Jul 2015 07:11:39 +0000 (16:11 +0900)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_hw_context.c

index 08cc08e64feabe800d31a6f1961feb80f5189b66..dc8702e95a63d88f95addc89ac36371a5a9a65ca 100644 (file)
@@ -84,7 +84,8 @@ void si_context_gfx_flush(void *context, unsigned flags,
        struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
        struct radeon_winsys *ws = ctx->b.ws;
 
-       if (cs->cdw == ctx->b.initial_gfx_cs_size) {
+       if (cs->cdw == ctx->b.initial_gfx_cs_size &&
+           (!fence || ctx->last_gfx_fence)) {
                if (fence)
                        ws->fence_reference(fence, ctx->last_gfx_fence);
                if (!(flags & RADEON_FLUSH_ASYNC))