summaryrefslogtreecommitdiff
path: root/src/radeon_commonfuncs.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2008-04-14 20:02:14 -0400
committerAlex Deucher <alex@botch2.(none)>2008-04-14 20:02:14 -0400
commit1286fe5ce1c77453d57817b9b26b1bdb32ca7bc8 (patch)
tree2bb4999a00246b9f68e8dde650c5ee3b244c6d0c /src/radeon_commonfuncs.c
parentf72a4b805db26f10f69330b88459cbeae661189b (diff)
R300+: properly setup vap_cntl
this fixes tcl/pvs on RV515 among other things
Diffstat (limited to 'src/radeon_commonfuncs.c')
-rw-r--r--src/radeon_commonfuncs.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c
index 66edc72d..1976805d 100644
--- a/src/radeon_commonfuncs.c
+++ b/src/radeon_commonfuncs.c
@@ -55,14 +55,12 @@
static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
- CARD32 gb_tile_config, su_reg_dest;
+ CARD32 gb_tile_config, su_reg_dest, vap_cntl;
ACCEL_PREAMBLE();
info->texW[0] = info->texH[0] = info->texW[1] = info->texH[1] = 1;
- if (IS_R300_VARIANT || IS_AVIVO_VARIANT ||
- (info->ChipFamily == CHIP_FAMILY_RS690) ||
- (info->ChipFamily == CHIP_FAMILY_RS740)) {
+ if (IS_R300_3D || IS_R500_3D) {
BEGIN_ACCEL(3);
OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D | R300_DC_FREE_3D);
@@ -147,20 +145,35 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
OUT_ACCEL_REG(R300_SU_DEPTH_OFFSET, 0);
FINISH_ACCEL();
- /* setup the VAP */
+ /* setup the VAP */
+ vap_cntl = ((5 << R300_PVS_NUM_SLOTS_SHIFT) |
+ (5 << R300_PVS_NUM_CNTLRS_SHIFT) |
+ (9/*12*/ << R300_VF_MAX_VTX_NUM_SHIFT));
+
+ if (info->ChipFamily == CHIP_FAMILY_RV515)
+ vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT);
+ else if (info->ChipFamily == CHIP_FAMILY_RV530)
+ vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT);
+ else if (info->ChipFamily == CHIP_FAMILY_R420)
+ vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT);
+ else if (info->ChipFamily == CHIP_FAMILY_R520)
+ vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT);
+ else if (info->ChipFamily == CHIP_FAMILY_RV530)
+ vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT);
+ else
+ vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT);
+
if (info->has_tcl)
BEGIN_ACCEL(15);
else
- BEGIN_ACCEL(9);
+ BEGIN_ACCEL(8);
OUT_ACCEL_REG(R300_VAP_VTX_STATE_CNTL, 0);
OUT_ACCEL_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0);
- OUT_ACCEL_REG(R300_VAP_CNTL, ((5/*6*/ << R300_PVS_NUM_SLOTS_SHIFT) |
- (5 << R300_PVS_NUM_CNTLRS_SHIFT) |
- (4 << R300_PVS_NUM_FPUS_SHIFT) |
- (9/*12*/ << R300_VF_MAX_VTX_NUM_SHIFT)));
- if (info->has_tcl)
+
+ if (info->has_tcl) {
OUT_ACCEL_REG(R300_VAP_CNTL_STATUS, 0);
- else
+ OUT_ACCEL_REG(R300_VAP_CNTL, vap_cntl);
+ }else
OUT_ACCEL_REG(R300_VAP_CNTL_STATUS, R300_PVS_BYPASS);
OUT_ACCEL_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0);
OUT_ACCEL_REG(R300_VAP_VTE_CNTL, R300_VTX_XY_FMT | R300_VTX_Z_FMT);