summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600.h
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-09-28 17:37:56 -0400
committerJerome Glisse <[email protected]>2010-09-29 12:44:32 -0400
commit5646964b1360883b6254e2ebacc198f43869d36f (patch)
tree05f02b140afc27d6e6b781ef228af9d143a91590 /src/gallium/drivers/r600/r600.h
parent0cb545a7f2e823c85309013c4c41e9461f297d06 (diff)
r600g: use a hash table instead of group
Instead of creating group of register use a hash table to lookup into which block each register belongs. This simplify code a bit. Signed-off-by: Jerome Glisse <[email protected]
Diffstat (limited to 'src/gallium/drivers/r600/r600.h')
-rw-r--r--src/gallium/drivers/r600/r600.h44
1 files changed, 9 insertions, 35 deletions
diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h
index adc35afc025..58d753ef5e2 100644
--- a/src/gallium/drivers/r600/r600.h
+++ b/src/gallium/drivers/r600/r600.h
@@ -117,32 +117,7 @@ void radeon_ws_bo_reference(struct radeon *radeon, struct radeon_ws_bo **dst,
#define R600_BLOCK_MAX_BO 32
#define R600_BLOCK_MAX_REG 128
-enum r600_group_id {
- R600_GROUP_CONFIG = 0,
- R600_GROUP_CONTEXT,
- R600_GROUP_ALU_CONST,
- R600_GROUP_RESOURCE,
- R600_GROUP_SAMPLER,
- R600_GROUP_CTL_CONST,
- R600_GROUP_LOOP_CONST,
- R600_GROUP_BOOL_CONST,
- R600_NGROUPS
-};
-
-enum evergreen_group_id {
- EVERGREEN_GROUP_CONFIG = 0,
- EVERGREEN_GROUP_CONTEXT,
- EVERGREEN_GROUP_RESOURCE,
- EVERGREEN_GROUP_SAMPLER,
- EVERGREEN_GROUP_CTL_CONST,
- EVERGREEN_GROUP_LOOP_CONST,
- EVERGREEN_GROUP_BOOL_CONST,
- EVERGREEN_GROUP_SAMPLER_BORDER,
- EVERGREEN_NGROUPS
-};
-
struct r600_pipe_reg {
- unsigned group_id;
u32 offset;
u32 mask;
u32 value;
@@ -156,11 +131,9 @@ struct r600_pipe_state {
};
static inline void r600_pipe_state_add_reg(struct r600_pipe_state *state,
- unsigned group_id, u32 offset,
- u32 value, u32 mask,
+ u32 offset, u32 value, u32 mask,
struct radeon_ws_bo *bo)
{
- state->regs[state->nregs].group_id = group_id;
state->regs[state->nregs].offset = offset;
state->regs[state->nregs].value = value;
state->regs[state->nregs].mask = mask;
@@ -178,7 +151,7 @@ struct r600_block_reloc {
unsigned bo_pm4_index[R600_BLOCK_MAX_BO];
};
-struct r600_group_block {
+struct r600_block {
unsigned status;
unsigned start_offset;
unsigned pm4_ndwords;
@@ -190,12 +163,10 @@ struct r600_group_block {
struct r600_block_reloc reloc[R600_BLOCK_MAX_BO];
};
-struct r600_group {
+struct r600_range {
unsigned start_offset;
unsigned end_offset;
- unsigned nblocks;
- struct r600_group_block *blocks;
- unsigned *offset_block_id;
+ struct r600_block **blocks;
};
/*
@@ -236,8 +207,11 @@ struct r600_query {
struct r600_context {
struct radeon *radeon;
- unsigned ngroups;
- struct r600_group groups[R600_GROUP_MAX];
+ unsigned hash_size;
+ unsigned hash_shift;
+ struct r600_range range[256];
+ unsigned nblocks;
+ struct r600_block **blocks;
unsigned pm4_ndwords;
unsigned pm4_cdwords;
unsigned pm4_dirty_cdwords;