Mesa (master): r600g: add dirty tracking to context reg.

Dave Airlie airlied at kemper.freedesktop.org
Tue Apr 19 00:07:52 UTC 2011


Module: Mesa
Branch: master
Commit: f05adb83f5fed4b406670585ac42c290bf88bc0d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f05adb83f5fed4b406670585ac42c290bf88bc0d

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Apr 19 10:08:18 2011 +1000

r600g: add dirty tracking to context reg.

just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/winsys/r600/drm/r600_hw_context.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index 63258d6..403dc24 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -845,18 +845,23 @@ void r600_context_reg(struct r600_context *ctx,
 	struct r600_range *range;
 	struct r600_block *block;
 	unsigned id;
+	unsigned new_val;
+	int dirty;
 
 	range = &ctx->range[CTX_RANGE_ID(ctx, offset)];
 	block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
 	id = (offset - block->start_offset) >> 2;
-	block->reg[id] &= ~mask;
-	block->reg[id] |= value;
-	if (!(block->status & R600_BLOCK_STATUS_DIRTY)) {
-		ctx->pm4_dirty_cdwords += block->pm4_ndwords;
-		block->status |= R600_BLOCK_STATUS_ENABLED;
-		block->status |= R600_BLOCK_STATUS_DIRTY;
-		LIST_ADDTAIL(&block->list,&ctx->dirty);
+
+	dirty = block->status & R600_BLOCK_STATUS_DIRTY;
+
+	new_val = block->reg[id];
+	new_val &= ~mask;
+	new_val |= value;
+	if (new_val != block->reg[id]) {
+		dirty |= R600_BLOCK_STATUS_DIRTY;
+		block->reg[id] = new_val;
 	}
+	r600_context_dirty_block(ctx, block, dirty, id);
 }
 
 void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block,




More information about the mesa-commit mailing list