? Makefile
? agp.diff
? cobfixes.diff
? savage.4.html
? savage._man
? streams_cleanup.diff
? streams_cleanup_big-v2.diff
? streams_cleanup_big-v3.diff
? streams_cleanup_big.diff
Index: savage.man
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v
retrieving revision 1.2
diff -u -r1.2 savage.man
--- savage.man	22 Mar 2004 15:25:28 -0000	1.2
+++ savage.man	22 Mar 2004 17:12:46 -0000
@@ -138,6 +138,18 @@
 graphics artifacts on some chips.  This option only applies to Savage4 and 
 prosavage/twister chips.  Default: on for prosavage and twister (use BCI for Xv); 
 off for savage4 (do not use the BCI for Xv).
+.TP 
+.BI "Option \*qAGPMode\*q \*q" integer \*q
+Set AGP data transfer rate.
+(used only when DRI is enabled)
+.br
+1      \-\- x1 (default)
+.br
+2      \-\- x2
+.br
+4      \-\- x4
+.br
+others \-\- invalid
 .SH FILES
 savage_drv.o
 .SH "SEE ALSO"
Index: savage_dri.c
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dri.c,v
retrieving revision 1.2
diff -u -r1.2 savage_dri.c
--- savage_dri.c	22 Feb 2004 16:14:42 -0000	1.2
+++ savage_dri.c	22 Mar 2004 17:12:48 -0000
@@ -706,7 +706,8 @@
    
    /* FIXME: Make these configurable...
     */
-   pSAVAGEDRIServer->agp.size = 16 * 1024 * 1024;
+   /*pSAVAGEDRIServer->agp.size = 16 * 1024 * 1024;*/
+   pSAVAGEDRIServer->agp.size = psav->agpSize * 1024 * 1024;
    pSAVAGEDRIServer->agp.offset = pSAVAGEDRIServer->agp.size;
    
    pSAVAGEDRIServer->agpTextures.offset = 0;
@@ -722,9 +723,9 @@
    vendor = drmAgpVendorId( psav->drmFD );
    device = drmAgpDeviceId( psav->drmFD );
 
-   /*   mode &= ~SAVAGE_AGP_MODE_MASK;*/
+   mode &= ~SAVAGE_AGP_MODE_MASK;
 
-/*   switch ( psav->agpMode ) {
+   switch ( psav->agpMode ) {
    case 4:
       mode |= SAVAGE_AGP_4X_MODE;
    case 2:
@@ -733,7 +734,7 @@
    default:
       mode |= SAVAGE_AGP_1X_MODE;
    }
-*/
+
    /*   mode |= SAVAGE_AGP_1X_MODE;*/
 
    xf86DrvMsg( pScreen->myNum, X_INFO,
Index: savage_driver.c
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v
retrieving revision 1.17
diff -u -r1.17 savage_driver.c
--- savage_driver.c	22 Mar 2004 14:37:51 -0000	1.17
+++ savage_driver.c	22 Mar 2004 17:12:49 -0000
@@ -211,6 +211,8 @@
     ,OPTION_DISABLE_TILE
     ,OPTION_DISABLE_COB
     ,OPTION_BCI_FOR_XV
+    ,OPTION_AGP_MODE
+    ,OPTION_AGP_SIZE
 } SavageOpts;
 
 
@@ -228,11 +230,13 @@
     { OPTION_CRT_ONLY,  "CrtOnly",      OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_TV_ON,     "TvOn",         OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_TV_PAL,    "PAL",          OPTV_BOOLEAN, {0}, FALSE },
-    { OPTION_FORCE_INIT,"ForceInit",    OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_FORCE_INIT,   "ForceInit",   OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DISABLE_XVMC, "DisableXVMC", OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DISABLE_TILE, "DisableTile", OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DISABLE_COB,  "DisableCOB",  OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_BCI_FOR_XV,   "BCIforXv",    OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_AGP_MODE,     "AGPMode",   OPTV_INTEGER, {0}, FALSE },
+    { OPTION_AGP_SIZE,     "AGPSize",   OPTV_INTEGER, {0}, FALSE },
     { -1,		NULL,		OPTV_NONE,    {0}, FALSE }
 };
 
@@ -952,11 +956,11 @@
     /* We support 1X 2X and 4X  */
 #ifdef XF86DRI
     from = X_DEFAULT;
-    /*psav->agpMode = SAVAGE_DEFAULT_AGP_MODE;*/
-    psav->agpMode = SAVAGE_MAX_AGP_MODE;
+    psav->agpMode = SAVAGE_DEFAULT_AGP_MODE;
+    /*psav->agpMode = SAVAGE_MAX_AGP_MODE;*/
+    psav->agpSize = 16;
     
     /* temporatly remove by Jiayo */
-#if 0
     if (xf86GetOptValInteger(psav->Options,
                              OPTION_AGP_MODE, &(psav->agpMode))) {
         if (psav->agpMode < 1) {
@@ -965,12 +969,37 @@
         if (psav->agpMode > SAVAGE_MAX_AGP_MODE) {
             psav->agpMode = SAVAGE_MAX_AGP_MODE;
         }
+	if ((psav->agpMode > 2) && 
+	    (psav->Chipset == S3_SAVAGE3D ||
+	     psav->Chipset == S3_SAVAGE_MX))
+		psav->agpMode = 2; /* old savages only support 2x */
         from = X_CONFIG;
     }
-#endif
 
     xf86DrvMsg(pScrn->scrnIndex, from, "Using AGP %dx mode\n",
                psav->agpMode);
+
+    if (xf86GetOptValInteger(psav->Options,
+				 OPTION_AGP_SIZE, (int *)&(psav->agpSize))) {
+	switch (psav->agpSize) {
+	case 4:
+	case 8:
+	case 16:
+	case 32:
+	case 64:
+	case 128:
+	case 256:
+	    break;
+	default:
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+			   "Illegal AGP size: %d MB, defaulting to 16 MB\n", psav->agpSize);
+	    psav->agpSize = 16;
+	}
+    }
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+		   "Using %d MB AGP aperture\n", psav->agpSize);
+
 #endif
 
     /*
Index: savage_driver.h
===================================================================
RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v
retrieving revision 1.11
diff -u -r1.11 savage_driver.h
--- savage_driver.h	20 Mar 2004 17:51:23 -0000	1.11
+++ savage_driver.h	22 Mar 2004 17:12:49 -0000
@@ -307,6 +307,7 @@
 #endif
 
     int 		agpMode;
+    drmSize		agpSize;
     FBLinearPtr		reserved;
     
     unsigned int surfaceAllocation[7];
