r600g: fix check for empty cs
authorVadim Girlin <vadimgirlin@gmail.com>
Wed, 29 Jun 2011 12:29:18 +0000 (16:29 +0400)
committerAlex Deucher <alexdeucher@gmail.com>
Thu, 30 Jun 2011 20:39:08 +0000 (16:39 -0400)
src/gallium/drivers/r600/r600.h
src/gallium/drivers/r600/r600_pipe.c
src/gallium/winsys/r600/drm/r600_hw_context.c

index 225c17c2540b186d296bd9cf07a99b13da5a1619..151e831e5c6dc04ee31fe087f77a674ab325107a 100644 (file)
@@ -245,6 +245,7 @@ struct r600_context {
        unsigned                pm4_cdwords;
        unsigned                pm4_dirty_cdwords;
        unsigned                ctx_pm4_ndwords;
+       unsigned                init_dwords;
        unsigned                nreloc;
        unsigned                creloc;
        struct r600_reloc       *reloc;
index 12599bf7902f56fb0f5797eb5606744b9af7a48e..8f3a175587eb9bb705b396a9322cf8d01005bb23 100644 (file)
@@ -126,9 +126,6 @@ static void r600_flush(struct pipe_context *ctx,
        if (rfence)
                *rfence = r600_create_fence(rctx);
 
-       if (!rctx->ctx.pm4_cdwords)
-               return;
-
 #if 0
        sprintf(dname, "gallium-%08d.bof", dc);
        if (dc < 20) {
index f89f24c4d181d0d4333f19a72384ecaef2bb7880..19dc729d00ae689416ed37a037532dc1a4f0e74b 100644 (file)
@@ -62,6 +62,8 @@ void r600_init_cs(struct r600_context *ctx)
        ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0);
        ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
        ctx->pm4[ctx->pm4_cdwords++] = 0x80000000;
+
+       ctx->init_dwords = ctx->pm4_cdwords;
 }
 
 static void INLINE r600_context_update_fenced_list(struct r600_context *ctx)
@@ -1496,7 +1498,7 @@ void r600_context_flush(struct r600_context *ctx)
        int r;
        struct r600_block *enable_block = NULL;
 
-       if (!ctx->pm4_cdwords)
+       if (ctx->pm4_cdwords == ctx->init_dwords)
                return;
 
        /* suspend queries */