From: Dave Airlie Date: Thu, 12 May 2011 05:24:35 +0000 (+1000) Subject: r600g: use a local var to store pointer to which register we are working on X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ca3efe5485a5e3800c4bc637a65a733257fb89e;p=mesa.git r600g: use a local var to store pointer to which register we are working on this just makes the code a little bit cleaner. Signed-off-by: Dave Airlie --- diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 595b110ed9d..a32793c9b9c 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -922,16 +922,17 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat int dirty; for (int i = 0; i < state->nregs; i++) { unsigned id, reloc_id; + struct r600_pipe_reg *reg = &state->regs[i]; - range = &ctx->range[CTX_RANGE_ID(ctx, state->regs[i].offset)]; - block = range->blocks[CTX_BLOCK_ID(ctx, state->regs[i].offset)]; - id = (state->regs[i].offset - block->start_offset) >> 2; + range = &ctx->range[CTX_RANGE_ID(ctx, reg->offset)]; + block = range->blocks[CTX_BLOCK_ID(ctx, reg->offset)]; + id = (reg->offset - block->start_offset) >> 2; dirty = block->status & R600_BLOCK_STATUS_DIRTY; new_val = block->reg[id]; - new_val &= ~state->regs[i].mask; - new_val |= state->regs[i].value; + new_val &= ~reg->mask; + new_val |= reg->value; if (new_val != block->reg[id]) { block->reg[id] = new_val; dirty |= R600_BLOCK_STATUS_DIRTY; @@ -941,8 +942,8 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat if (block->pm4_bo_index[id]) { /* find relocation */ reloc_id = block->pm4_bo_index[id]; - r600_bo_reference(ctx->radeon, &block->reloc[reloc_id].bo, state->regs[i].bo); - state->regs[i].bo->fence = ctx->radeon->fence; + r600_bo_reference(ctx->radeon, &block->reloc[reloc_id].bo, reg->bo); + reg->bo->fence = ctx->radeon->fence; /* always force dirty for relocs for now */ dirty |= R600_BLOCK_STATUS_DIRTY; }