r600g: turn some CS overflow checks into assertions
authorMarek Olšák <maraeo@gmail.com>
Thu, 10 Nov 2011 16:52:36 +0000 (17:52 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 10 Nov 2011 17:09:10 +0000 (18:09 +0100)
They're not really exhaustive and not so useful either.

src/gallium/drivers/r600/evergreen_hw_context.c
src/gallium/drivers/r600/r600_hw_context.c

index 5eb6332..96e8d18 100644 (file)
@@ -1156,12 +1156,7 @@ void evergreen_context_draw(struct r600_context *ctx, const struct r600_draw *dr
        }
 
        r600_need_cs_space(ctx, 0, TRUE);
-
-       /* at this point everything is flushed and ctx->pm4_cdwords = 0 */
-       if (unlikely((ctx->pm4_dirty_cdwords + ndwords) > RADEON_MAX_CMDBUF_DWORDS)) {
-               R600_ERR("context is too big to be scheduled\n");
-               return;
-       }
+       assert(ctx->pm4_cdwords + ctx->pm4_dirty_cdwords + ndwords < RADEON_MAX_CMDBUF_DWORDS);
 
        /* enough room to copy packet */
        LIST_FOR_EACH_ENTRY_SAFE(dirty_block, next_block, &ctx->dirty,list) {
index eb80fa9..3a0cde3 100644 (file)
@@ -1460,12 +1460,7 @@ void r600_context_draw(struct r600_context *ctx, const struct r600_draw *draw)
        }
 
        r600_need_cs_space(ctx, 0, TRUE);
-
-       /* at this point everything is flushed and ctx->pm4_cdwords = 0 */
-       if (unlikely((ctx->pm4_dirty_cdwords + ndwords) > RADEON_MAX_CMDBUF_DWORDS)) {
-               R600_ERR("context is too big to be scheduled\n");
-               return;
-       }
+       assert(ctx->pm4_cdwords + ctx->pm4_dirty_cdwords + ndwords < RADEON_MAX_CMDBUF_DWORDS);
 
        /* enough room to copy packet */
        LIST_FOR_EACH_ENTRY_SAFE(dirty_block, next_block, &ctx->dirty, list) {