From 6d0a011acbea90537d142c86b8dd5aecd1e14390 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 30 Jan 2012 09:11:01 +0100 Subject: [PATCH] r600g: fix computation of how many dwords is needed for a flush at the end of CS --- src/gallium/drivers/r600/r600.h | 1 - src/gallium/drivers/r600/r600_hw_context.c | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index d0f0b399b41..229fa7068b2 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -144,7 +144,6 @@ struct r600_block { unsigned flags; unsigned start_offset; unsigned pm4_ndwords; - unsigned pm4_flush_ndwords; unsigned nbo; uint16_t nreg; uint16_t nreg_dirty; diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index b7ba0681845..7fd0152e456 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -199,11 +199,6 @@ static void r600_init_block(struct r600_context *ctx, block->pm4[block->pm4_ndwords++] = reg[i+j].flush_flags; } } - for (j = 0; j < n; j++) { - if (reg[i+j].flush_flags) { - block->pm4_flush_ndwords += 7; - } - } /* check that we stay in limit */ assert(block->pm4_ndwords < R600_BLOCK_MAX_REG); } @@ -944,7 +939,7 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw, } /* Count in framebuffer cache flushes at the end of CS. */ - num_dw += ctx->num_dest_buffers * 7; + num_dw += 7; /* one SURFACE_SYNC and CACHE_FLUSH_AND_INV (r6xx-only) */ /* Save 16 dwords for the fence mechanism. */ num_dw += 16; @@ -964,7 +959,7 @@ void r600_context_dirty_block(struct r600_context *ctx, if ((dirty != (block->status & R600_BLOCK_STATUS_DIRTY)) || !(block->status & R600_BLOCK_STATUS_ENABLED)) { block->status |= R600_BLOCK_STATUS_DIRTY; - ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords; + ctx->pm4_dirty_cdwords += block->pm4_ndwords; if (!(block->status & R600_BLOCK_STATUS_ENABLED)) { block->status |= R600_BLOCK_STATUS_ENABLED; LIST_ADDTAIL(&block->enable_list, &ctx->enable_list); @@ -1018,7 +1013,7 @@ static void r600_context_dirty_resource_block(struct r600_context *ctx, if ((dirty != (block->status & R600_BLOCK_STATUS_RESOURCE_DIRTY)) || !(block->status & R600_BLOCK_STATUS_ENABLED)) { block->status |= R600_BLOCK_STATUS_RESOURCE_DIRTY; - ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords; + ctx->pm4_dirty_cdwords += block->pm4_ndwords; if (!(block->status & R600_BLOCK_STATUS_ENABLED)) { block->status |= R600_BLOCK_STATUS_ENABLED; LIST_ADDTAIL(&block->enable_list, &ctx->enable_list); @@ -1477,8 +1472,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags) enable_block->status |= R600_BLOCK_STATUS_RESOURCE_DIRTY; } } - ctx->pm4_dirty_cdwords += enable_block->pm4_ndwords + - enable_block->pm4_flush_ndwords; + ctx->pm4_dirty_cdwords += enable_block->pm4_ndwords; enable_block->nreg_dirty = enable_block->nreg; } } -- 2.30.2