summaryrefslogtreecommitdiff
path: root/src/atimach64.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2006-08-05 18:36:24 +0300
committerGeorge Sapountzis <gsap7@yahoo.gr>2006-08-12 22:21:48 +0300
commitb2beea2fa8949874d3d57fb9b43fe85cc08a8bff (patch)
treeae883b6658eb8685d316422000c23f73632a034c /src/atimach64.c
parent43aaed99950640c3695b3c2b91faabf00c6338a7 (diff)
[mach64] RENDER support: save/restore, cache texture registers.
Diffstat (limited to 'src/atimach64.c')
-rw-r--r--src/atimach64.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/atimach64.c b/src/atimach64.c
index cc3a3cb0..401c4261 100644
--- a/src/atimach64.c
+++ b/src/atimach64.c
@@ -483,6 +483,15 @@ ATIMach64Save
pATIHW->src_height2 = inm(SRC_HEIGHT2);
pATIHW->src_cntl = inm(SRC_CNTL);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ CARD32 offset = TEX_LEVEL(inm(TEX_SIZE_PITCH));
+
+ /* Save 3D control & texture registers */
+ pATIHW->tex_offset = inm(TEX_0_OFF + offset);
+ pATIHW->scale_3d_cntl = inm(SCALE_3D_CNTL);
+ }
+
/* Save host data register */
pATIHW->host_cntl = inm(HOST_CNTL);
@@ -514,6 +523,13 @@ ATIMach64Save
/* Save context */
pATIHW->context_mask = inm(CONTEXT_MASK);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ /* Save texture setup registers */
+ pATIHW->tex_size_pitch = inm(TEX_SIZE_PITCH);
+ pATIHW->tex_cntl = inm(TEX_CNTL);
+ }
+
if (pATI->Block1Base)
{
/* Save overlay & scaler registers */
@@ -853,6 +869,14 @@ ATIMach64Set
outf(DST_BRES_DEC, pATIHW->dst_bres_dec);
outf(DST_CNTL, pATIHW->dst_cntl);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ /* Load ROP unit registers */
+ ATIMach64WaitForFIFO(pATI, 2);
+ outf(Z_CNTL, 0);
+ outf(ALPHA_TST_CNTL, 0);
+ }
+
/* Load source registers */
ATIMach64WaitForFIFO(pATI, 6);
outf(SRC_OFF_PITCH, pATIHW->src_off_pitch);
@@ -865,6 +889,16 @@ ATIMach64Set
SetWord(pATIHW->src_width2, 1) | SetWord(pATIHW->src_height2, 0));
outf(SRC_CNTL, pATIHW->src_cntl);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ CARD32 offset = TEX_LEVEL(pATIHW->tex_size_pitch);
+
+ /* Load 3D control & texture registers */
+ ATIMach64WaitForFIFO(pATI, 2);
+ outf(TEX_0_OFF + offset, pATIHW->tex_offset);
+ outf(SCALE_3D_CNTL, pATIHW->scale_3d_cntl);
+ }
+
/* Load host data register */
ATIMach64WaitForFIFO(pATI, 1);
outf(HOST_CNTL, pATIHW->host_cntl);
@@ -912,6 +946,14 @@ ATIMach64Set
ATIMach64WaitForFIFO(pATI, 1);
outf(CONTEXT_MASK, pATIHW->context_mask);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ /* Load texture setup registers */
+ ATIMach64WaitForFIFO(pATI, 2);
+ outf(TEX_SIZE_PITCH, pATIHW->tex_size_pitch);
+ outf(TEX_CNTL, pATIHW->tex_cntl);
+ }
+
if (pATI->Block1Base)
{
/* Load overlay & scaler registers */
@@ -982,6 +1024,11 @@ ATIMach64Set
CacheRegister(SRC_CNTL);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ CacheRegister(SCALE_3D_CNTL);
+ }
+
CacheRegister(HOST_CNTL);
CacheRegister(PAT_REG0);
@@ -1001,6 +1048,11 @@ ATIMach64Set
CacheRegister(CLR_CMP_MSK);
CacheRegister(CLR_CMP_CNTL);
+ if (pATI->Chip >= ATI_CHIP_264GTPRO)
+ {
+ CacheRegister(TEX_SIZE_PITCH);
+ }
+
if (pATI->Block1Base)
{
CacheRegister(OVERLAY_Y_X_START);