[Mesa-dev] [PATCH 16/19] r600g: get rid of the mask in r600_pipe_reg

Marek Olšák maraeo at gmail.com
Sun Jan 29 11:51:31 PST 2012


---
 src/gallium/drivers/r600/r600.h              |    1 -
 src/gallium/drivers/r600/r600_hw_context.c   |    8 ++------
 src/gallium/drivers/r600/r600_state_common.c |    2 --
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index c6a2790..a51e6af 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -111,7 +111,6 @@ struct r600_resource {
 
 struct r600_pipe_reg {
 	u32				value;
-	u32				mask;
 	struct r600_block 		*block;
 	struct r600_resource		*bo;
 	enum radeon_bo_usage		bo_usage;
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index ad568c6..0dfce01 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -1077,7 +1077,6 @@ void r600_context_dirty_block(struct r600_context *ctx,
 void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_state *state)
 {
 	struct r600_block *block;
-	unsigned new_val;
 	int dirty;
 	for (int i = 0; i < state->nregs; i++) {
 		unsigned id, reloc_id;
@@ -1088,11 +1087,8 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat
 
 		dirty = block->status & R600_BLOCK_STATUS_DIRTY;
 
-		new_val = block->reg[id];
-		new_val &= ~reg->mask;
-		new_val |= reg->value;
-		if (new_val != block->reg[id]) {
-			block->reg[id] = new_val;
+		if (reg->value != block->reg[id]) {
+			block->reg[id] = reg->value;
 			dirty |= R600_BLOCK_STATUS_DIRTY;
 		}
 		if (block->flags & REG_FLAG_DIRTY_ALWAYS)
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index ca43ec7..09a7d73 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -814,7 +814,6 @@ void _r600_pipe_state_add_reg(struct r600_context *ctx,
 	state->regs[state->nregs].id = (offset - block->start_offset) >> 2;
 
 	state->regs[state->nregs].value = value;
-	state->regs[state->nregs].mask = 0xFFFFFFFF;
 	state->regs[state->nregs].bo = bo;
 	state->regs[state->nregs].bo_usage = usage;
 
@@ -832,7 +831,6 @@ void r600_pipe_state_add_reg_noblock(struct r600_pipe_state *state,
 	state->regs[state->nregs].id = offset;
 	state->regs[state->nregs].block = NULL;
 	state->regs[state->nregs].value = value;
-	state->regs[state->nregs].mask = 0xFFFFFFFF;
 	state->regs[state->nregs].bo = bo;
 	state->regs[state->nregs].bo_usage = usage;
 
-- 
1.7.5.4



More information about the mesa-dev mailing list