[Mesa-dev] [PATCH 09/12] r600g: remove duplicated evergreen_context_pipe_state_set_sampler
Marek Olšák
maraeo at gmail.com
Tue Feb 21 16:56:00 PST 2012
---
src/gallium/drivers/r600/evergreen_hw_context.c | 31 +---------------------
src/gallium/drivers/r600/r600_hw_context.c | 4 +-
src/gallium/drivers/r600/r600_hw_context_priv.h | 1 +
3 files changed, 5 insertions(+), 31 deletions(-)
diff --git a/src/gallium/drivers/r600/evergreen_hw_context.c b/src/gallium/drivers/r600/evergreen_hw_context.c
index a547475..b0620a2 100644
--- a/src/gallium/drivers/r600/evergreen_hw_context.c
+++ b/src/gallium/drivers/r600/evergreen_hw_context.c
@@ -774,33 +774,6 @@ out_err:
return r;
}
-static inline void evergreen_context_pipe_state_set_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset)
-{
- struct r600_range *range;
- struct r600_block *block;
- int i;
- int dirty;
-
- range = &ctx->range[CTX_RANGE_ID(offset)];
- block = range->blocks[CTX_BLOCK_ID(offset)];
- if (state == NULL) {
- block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
- LIST_DELINIT(&block->list);
- LIST_DELINIT(&block->enable_list);
- return;
- }
- dirty = block->status & R600_BLOCK_STATUS_DIRTY;
-
- for (i = 0; i < 3; i++) {
- if (block->reg[i] != state->regs[i].value) {
- dirty |= R600_BLOCK_STATUS_DIRTY;
- block->reg[i] = state->regs[i].value;
- }
- }
- if (dirty)
- r600_context_dirty_block(ctx, block, dirty, 2);
-}
-
static inline void evergreen_context_ps_partial_flush(struct r600_context *ctx)
{
struct radeon_winsys_cs *cs = ctx->cs;
@@ -861,7 +834,7 @@ void evergreen_context_pipe_state_set_ps_sampler(struct r600_context *ctx, struc
unsigned offset;
offset = 0x0003C000 + id * 0xc;
- evergreen_context_pipe_state_set_sampler(ctx, state, offset);
+ r600_context_pipe_state_set_sampler(ctx, state, offset);
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A400_TD_PS_SAMPLER0_BORDER_INDEX, id);
}
@@ -870,7 +843,7 @@ void evergreen_context_pipe_state_set_vs_sampler(struct r600_context *ctx, struc
unsigned offset;
offset = 0x0003C0D8 + id * 0xc;
- evergreen_context_pipe_state_set_sampler(ctx, state, offset);
+ r600_context_pipe_state_set_sampler(ctx, state, offset);
evergreen_context_pipe_state_set_sampler_border(ctx, state, R_00A414_TD_VS_SAMPLER0_BORDER_INDEX, id);
}
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index e73b609..b0a0f30 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -992,7 +992,7 @@ void r600_context_pipe_state_set_fs_resource(struct r600_context *ctx, struct r6
r600_context_pipe_state_set_resource(ctx, state, block);
}
-static inline void r600_context_pipe_state_set_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset)
+void r600_context_pipe_state_set_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset)
{
struct r600_range *range;
struct r600_block *block;
@@ -1008,6 +1008,7 @@ static inline void r600_context_pipe_state_set_sampler(struct r600_context *ctx,
return;
}
dirty = block->status & R600_BLOCK_STATUS_DIRTY;
+
for (i = 0; i < 3; i++) {
if (block->reg[i] != state->regs[i].value) {
block->reg[i] = state->regs[i].value;
@@ -1019,7 +1020,6 @@ static inline void r600_context_pipe_state_set_sampler(struct r600_context *ctx,
r600_context_dirty_block(ctx, block, dirty, 2);
}
-
static inline void r600_context_pipe_state_set_sampler_border(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset)
{
struct r600_range *range;
diff --git a/src/gallium/drivers/r600/r600_hw_context_priv.h b/src/gallium/drivers/r600/r600_hw_context_priv.h
index 7001890..5894320 100644
--- a/src/gallium/drivers/r600/r600_hw_context_priv.h
+++ b/src/gallium/drivers/r600/r600_hw_context_priv.h
@@ -64,6 +64,7 @@ void r600_context_dirty_block(struct r600_context *ctx, struct r600_block *block
int r600_setup_block_table(struct r600_context *ctx);
int r600_resource_init(struct r600_context *ctx, struct r600_range *range, unsigned offset, unsigned nblocks, unsigned stride, struct r600_reg *reg, int nreg, unsigned offset_base);
int r600_state_sampler_init(struct r600_context *ctx, uint32_t offset);
+void r600_context_pipe_state_set_sampler(struct r600_context *ctx, struct r600_pipe_state *state, unsigned offset);
/*
* evergreen_hw_context.c
--
1.7.5.4
More information about the mesa-dev
mailing list