On the Savage IX it freezes now, when the 3D window gets too close to
the bottom of the screen. There is an extra allocation of 128kb at the
end of the frame buffer that is not included in RamNeedeFor3D. It
doesn't seem to be used though.

Also the computation of the HW cursor location is off by one.

The attached patch fixes these problems on the SavageIX. It also removes
a few obviously useless lines of code.

Finally I wonder why the case for disableCOB looks pretty much the same
as the case with COB enabled. I guess the cobIndex will be ignored
later, so setting it doesn't do any harm at least. But do we really have
to allocate those 128KB?

Regards,
  Felix

On Sat, 20 Mar 2004 09:07:55 -0800 (PST)
Alex Deucher <[EMAIL PROTECTED]> wrote:

[snip]

--- ./savage_driver.c.~1.16.~   2004-03-20 23:06:21.000000000 +0100
+++ ./savage_driver.c   2004-03-21 03:01:09.000000000 +0100
@@ -775,7 +775,6 @@
     char *s = NULL;
     unsigned char config1, m, n, n1, n2, sr8, cr66 = 0, tmp;
     int mclk;
-    int endfb;
     vgaHWPtr hwp;
     int vgaCRIndex, vgaCRReg;
     pointer ddc;
@@ -1313,9 +1312,6 @@
 #endif
 
 #if 1 /* S3's code */
-    /* reserved 128K for HWICON and DSTN buffer */
-    endfb = psav->videoRambytes - 0x20000 - 1;
-    
     /*
      * If we're running with acceleration, compute the command overflow
      * buffer location.  The command overflow buffer must END at a
@@ -1325,7 +1321,6 @@
     if (psav->NoAccel) {
         psav->cobIndex = 0;
         psav->cobSize = 0;
-        psav->cobOffset = endfb;
     }
     else if( ((S3_SAVAGE4_SERIES(psav->Chipset)) ||
              (S3_SUPERSAVAGE == psav->Chipset)) && psav->disableCOB ) {
@@ -1335,7 +1330,6 @@
          */
         psav->cobIndex = 2;
         psav->cobSize = 0x8000 << psav->cobIndex;
-        psav->cobOffset = endfb - psav->cobSize;
     }
     else {
         /* We use 128kB for the COB on all other chips. */        
@@ -1350,17 +1344,14 @@
        } else {
            psav->cobIndex = 7;
        }
-        psav->cobOffset = endfb - psav->cobSize;
     }
              
     /* align cob to 128k */
-    psav->cobOffset = ((endfb - psav->cobSize + 1) + 0x20000) & ~0x20000;
-    endfb = psav->cobOffset - 1;
+    psav->cobOffset = (psav->videoRambytes - psav->cobSize) & ~0x1ffff;
     
     /* The cursor must be aligned on a 4k boundary. */
-    psav->CursorKByte = (endfb >> 10) - 4;
-    endfb = (psav->CursorKByte << 10) - 1;
-    psav->endfb = endfb;
+    psav->CursorKByte = (psav->cobOffset >> 10) - 4;
+    psav->endfb = (psav->CursorKByte << 10) - 1;
 
 #endif
 

Reply via email to