summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_context.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-08-20 10:56:35 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-08-24 18:08:37 -0400
commit3023328ea721d2b87112e37e119345a9662d7e5e (patch)
tree56e50b75287e83ded5552176f5fae38646fa25ab /src/mesa/drivers/dri/r300/r300_context.c
parent8dd151b947c36100f38cf83eca674bd427b23e47 (diff)
r300: add support for getting Z pipe info from drm
Needed for occulsion queries on rv530 chips Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 5b5c064aca..c4b5afa23e 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -241,8 +241,8 @@ static void r300_emit_query_finish(radeonContextPtr radeon)
struct radeon_query_object *query = radeon->query.current;
BATCH_LOCALS(radeon);
- BEGIN_BATCH_NO_AUTOSTATE(3 * 2 *r300->num_z_pipes + 2);
- switch (r300->num_z_pipes) {
+ BEGIN_BATCH_NO_AUTOSTATE(3 * 2 *r300->radeon.radeonScreen->num_gb_pipes + 2);
+ switch (r300->radeon.radeonScreen->num_gb_pipes) {
case 4:
OUT_BATCH_REGVAL(R300_SU_REG_DEST, R300_RASTER_PIPE_SELECT_3);
OUT_BATCH_REGSEQ(R300_ZB_ZPASS_ADDR, 1);
@@ -268,7 +268,7 @@ static void r300_emit_query_finish(radeonContextPtr radeon)
}
OUT_BATCH_REGVAL(R300_SU_REG_DEST, R300_RASTER_PIPE_SELECT_ALL);
END_BATCH();
- query->curr_offset += r300->num_z_pipes * sizeof(uint32_t);
+ query->curr_offset += r300->radeon.radeonScreen->num_gb_pipes * sizeof(uint32_t);
assert(query->curr_offset < RADEON_QUERY_PAGE_SIZE);
query->emitted_begin = GL_FALSE;
}
@@ -290,10 +290,8 @@ static void rv530_emit_query_finish_single_z(radeonContextPtr radeon)
query->emitted_begin = GL_FALSE;
}
-#if 0
static void rv530_emit_query_finish_double_z(radeonContextPtr radeon)
{
- r300ContextPtr r300 = (r300ContextPtr)radeon;
BATCH_LOCALS(radeon);
struct radeon_query_object *query = radeon->query.current;
@@ -311,7 +309,6 @@ static void rv530_emit_query_finish_double_z(radeonContextPtr radeon)
assert(query->curr_offset < RADEON_QUERY_PAGE_SIZE);
query->emitted_begin = GL_FALSE;
}
-#endif
static void r300_init_vtbl(radeonContextPtr radeon)
{
@@ -321,11 +318,12 @@ static void r300_init_vtbl(radeonContextPtr radeon)
radeon->vtbl.swtcl_flush = r300_swtcl_flush;
radeon->vtbl.pre_emit_atoms = r300_vtbl_pre_emit_atoms;
radeon->vtbl.fallback = r300_fallback;
- if (radeon->radeonScreen->chip_family == CHIP_FAMILY_RV530)
- /* single Z gives me correct results on my hw need to check if we ever need
- * double z */
- radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z;
- else
+ if (radeon->radeonScreen->chip_family == CHIP_FAMILY_RV530) {
+ if (radeon->radeonScreen->num_z_pipes == 2)
+ radeon->vtbl.emit_query_finish = rv530_emit_query_finish_double_z;
+ else
+ radeon->vtbl.emit_query_finish = rv530_emit_query_finish_single_z;
+ } else
radeon->vtbl.emit_query_finish = r300_emit_query_finish;
}
@@ -399,10 +397,6 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0;
}
- if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV530)
- r300->num_z_pipes = 2;
- else
- r300->num_z_pipes = r300->radeon.radeonScreen->num_gb_pipes;
}
static void r300ParseOptions(r300ContextPtr r300, radeonScreenPtr screen)