[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-savage: Changes to 'upstream-experimental'



 .cvsignore          |   19 --
 .gitignore          |   20 ++
 configure.ac        |   14 +
 man/.cvsignore      |    2 
 man/.gitignore      |    2 
 man/Makefile.am     |    1 
 src/.cvsignore      |    6 
 src/.gitignore      |    6 
 src/savage_accel.c  |    1 
 src/savage_bci.h    |    1 
 src/savage_dga.c    |    3 
 src/savage_dri.c    |   49 ++---
 src/savage_driver.c |  429 +++++++++++++++++++++++++++++++++++++++-------------
 src/savage_driver.h |   34 +++-
 src/savage_hwmc.c   |    2 
 src/savage_i2c.c    |    1 
 src/savage_regs.h   |    1 
 src/savage_shadow.c |    1 
 src/savage_vbe.c    |    1 
 src/savage_vbe.h    |    1 
 src/savage_video.c  |   55 ++++--
 21 files changed, 449 insertions(+), 200 deletions(-)

New commits:
commit d0cbce17e1d1e99dbecda339c6704b96606b20d3
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 15:15:35 2008 -0400

    savage 2.2.0

diff --git a/configure.ac b/configure.ac
index a326f92..2676116 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-savage],
-        2.1.3,
+        2.2.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-savage)
 

commit 6adc23cb19bfd331221df8dccb2dc88b8fc77821
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 15:12:49 2008 -0400

    Remove use of deprecated {DE,}ALLOCATE_LOCAL.

diff --git a/src/savage_dri.c b/src/savage_dri.c
index 468cf7d..0d40222 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -1429,11 +1429,11 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
 
         if (nbox>1) {
 	    /* Keep ordering in each band, reverse order of bands */
-	    pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
+	    pboxNew1 = xalloc(sizeof(BoxRec)*nbox);
 	    if (!pboxNew1) return;
-	    pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pptNew1 = xalloc(sizeof(DDXPointRec)*nbox);
 	    if (!pptNew1) {
-	        DEALLOCATE_LOCAL(pboxNew1);
+	        xfree(pboxNew1);
 	        return;
 	    }
 	    pboxBase = pboxNext = pbox+nbox-1;
@@ -1464,14 +1464,14 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
 
         if (nbox > 1) {
 	    /*reverse orderof rects in each band */
-	    pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
-	    pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pboxNew2 = xalloc(sizeof(BoxRec)*nbox);
+	    pptNew2 = xalloc(sizeof(DDXPointRec)*nbox);
 	    if (!pboxNew2 || !pptNew2) {
-	        if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
-	        if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
+	        if (pptNew2) xfree(pptNew2);
+	        if (pboxNew2) xfree(pboxNew2);
 	        if (pboxNew1) {
-		    DEALLOCATE_LOCAL(pptNew1);
-		    DEALLOCATE_LOCAL(pboxNew1);
+		    xfree(pptNew1);
+		    xfree(pboxNew1);
 		}
 	       return;
 	    }
@@ -1526,12 +1526,12 @@ SAVAGEDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
     SAVAGESelectBuffer(pScrn, SAVAGE_FRONT);
 
     if (pboxNew2) {
-        DEALLOCATE_LOCAL(pptNew2);
-        DEALLOCATE_LOCAL(pboxNew2);
+        xfree(pptNew2);
+        xfree(pboxNew2);
     }
     if (pboxNew1) {
-        DEALLOCATE_LOCAL(pptNew1);
-        DEALLOCATE_LOCAL(pboxNew1);
+        xfree(pptNew1);
+        xfree(pboxNew1);
     }
 
     BCI_SEND(0xc0020000); /* wait for 2D idle */

commit 371d8fbae6f077d5a6dd845fad129fa9c7b0a701
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 15:06:46 2008 -0400

    Death to RCS tags.

diff --git a/src/savage_accel.c b/src/savage_accel.c
index c80dfa0..450b402 100644
--- a/src/savage_accel.c
+++ b/src/savage_accel.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.23 2003/12/22 17:48:10 tsi Exp $ */
 
 /*
  *
diff --git a/src/savage_bci.h b/src/savage_bci.h
index 410925d..174a26b 100644
--- a/src/savage_bci.h
+++ b/src/savage_bci.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_bci.h,v 1.3 2002/05/14 20:19:51 alanh Exp $ */
 
 #ifndef _S3BCI_H_
 #define _S3BCI_H_
diff --git a/src/savage_dga.c b/src/savage_dga.c
index fd26d78..eb1c5d2 100644
--- a/src/savage_dga.c
+++ b/src/savage_dga.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.6 2003/01/18 15:22:29 eich Exp $ */
 
 /*
 Copyright (C) 1994-2000 The XFree86 Project, Inc.  All Rights Reserved.
diff --git a/src/savage_i2c.c b/src/savage_i2c.c
index 6873003..d8eb46b 100644
--- a/src/savage_i2c.c
+++ b/src/savage_i2c.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_i2c.c,v 1.1 2001/02/13 21:15:19 dawes Exp $ */
 
 /*
 Copyright (C) 1994-2000 The XFree86 Project, Inc.  All Rights Reserved.
diff --git a/src/savage_regs.h b/src/savage_regs.h
index f4737d5..26cc2da 100644
--- a/src/savage_regs.h
+++ b/src/savage_regs.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.11 2002/05/14 20:19:52 alanh Exp $ */
 
 #ifndef _SAVAGE_REGS_H
 #define _SAVAGE_REGS_H
diff --git a/src/savage_shadow.c b/src/savage_shadow.c
index 77d687d..899da11 100644
--- a/src/savage_shadow.c
+++ b/src/savage_shadow.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_shadow.c,v 1.3 2000/03/31 20:13:33 dawes Exp $ */
 
 /*
    Copyright (c) 1999,2000  The XFree86 Project Inc. 
diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index f10eae9..5933b4e 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.11 2002/05/14 20:19:52 alanh Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/src/savage_vbe.h b/src/savage_vbe.h
index 43d758d..9b06e0c 100644
--- a/src/savage_vbe.h
+++ b/src/savage_vbe.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h,v 1.1 2000/12/02 01:16:15 dawes Exp $ */
 
 /*
 This file was originally part of the Linux Real-Mode Interface, or LRMI.

commit dc6a410290ab5103812a49273b27e3c72a7b2a98
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date:   Sat Mar 8 23:47:57 2008 +0100

    Makefile.am: nuke RCS Id

diff --git a/man/Makefile.am b/man/Makefile.am
index bf7ec17..f0eb29b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # 

commit 908b155161ebb6cd506f43a3987e4d146ef5b330
Author: Julien Cristau <jcristau@debian.org>
Date:   Fri Mar 7 17:10:52 2008 +0100

    fixup pciaccess version detect

diff --git a/configure.ac b/configure.ac
index d596b7a..a326f92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,7 +103,7 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
 CFLAGS="$save_CFLAGS"
 
 if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10.0])
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
 fi
 AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 

commit eeea6468df31ee770c8d7c9dab4fac7ff0865bba
Author: Alex Villacs Lasso <a_villacis@palosanto.com>
Date:   Thu Feb 28 19:32:42 2008 -0500

    Fix broken downscale past 2:1 - MM8190 and MM8198 can be used together for arbitrary downscale

diff --git a/src/savage_video.c b/src/savage_video.c
index dd6c4a1..a68c191 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1489,23 +1489,32 @@ SavageDisplayVideoOld(
      * Process horizontal scaling
      *  upscaling and downscaling smaller than 2:1 controled by MM8198
      *  MM8190 controls downscaling mode larger than 2:1
+     *  Together MM8190 and MM8198 can set arbitrary downscale up to 64:1
      */
     scalratio = 0;
     ssControl = 0;
 
     if (src_w >= (drw_w * 2)) {
         if (src_w < (drw_w * 4)) {
-            scalratio = HSCALING(2,1);
-        } else if (src_w < (drw_w * 8)) {
             ssControl |= HDSCALE_4;
-        } else if (src_w < (drw_w * 16)) {
+            scalratio = HSCALING(src_w,(drw_w*4));
+        } else if (src_w < (drw_w * 8)) {
             ssControl |= HDSCALE_8;
-        } else if (src_w < (drw_w * 32)) {
+            scalratio = HSCALING(src_w,(drw_w*8));
+        } else if (src_w < (drw_w * 16)) {
             ssControl |= HDSCALE_16;
-        }  else if (src_w < (drw_w * 64)) {
+            scalratio = HSCALING(src_w,(drw_w*16));
+        } else if (src_w < (drw_w * 32)) {
             ssControl |= HDSCALE_32;
-        } else
+            scalratio = HSCALING(src_w,(drw_w*32));
+        } else if (src_w < (drw_w * 64)) {
+            ssControl |= HDSCALE_64;
+            scalratio = HSCALING(src_w,(drw_w*64));
+        } else {
+            /* Request beyond maximum downscale! */
             ssControl |= HDSCALE_64;
+            scalratio = HSCALING(2,1);
+        }
     } else 
         scalratio = HSCALING(src_w,drw_w);
 

commit d838ed93a23b4e9dc438ad17875423e8b90f0015
Author: Tormod Volden <git.tormod@xoxy.net>
Date:   Sun Feb 24 21:46:43 2008 -0500

    Bug #11139: Remove some dead code.

diff --git a/src/savage_dri.c b/src/savage_dri.c
index 211fef0..468cf7d 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -1119,14 +1119,7 @@ Bool SAVAGEDRIFinishScreenInit( ScreenPtr pScreen )
 
    pSAVAGEDRI->apertureHandle	= pSAVAGEDRIServer->aperture.handle;
    pSAVAGEDRI->apertureSize	= pSAVAGEDRIServer->aperture.size;
-   {
-      unsigned int shift = 0;
-      
-      if(pSAVAGEDRI->width > 1024)
-        shift = 1; 
-
-      pSAVAGEDRI->aperturePitch = psav->ulAperturePitch;
-   }
+   pSAVAGEDRI->aperturePitch    = psav->ulAperturePitch;
 
    {
       unsigned int value = 0;

commit 583051fce0d39fd2b8b5022016599e88d0af9041
Author: Alex Villacís Lasso <a_villacis@palosanto.com>
Date:   Wed Jan 30 21:49:05 2008 -0500

    [PATCH] Do not wait for vertical retrace anymore on old streams engine.

diff --git a/src/savage_video.c b/src/savage_video.c
index 848d1cb..dd6c4a1 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1512,8 +1512,10 @@ SavageDisplayVideoOld(
     ssControl |= src_w;
     /*ssControl |= (1 << 24);*/
     ssControl |= (GetBlendForFourCC(psav->videoFourCC) << 24);
+#if 0
     /* Wait for VBLANK. */
     VerticalRetraceWait();
+#endif
     OUTREG(SSTREAM_CONTROL_REG, ssControl);
     if (scalratio)
         OUTREG(SSTREAM_STRETCH_REG,scalratio);

commit 52029dede1924c25275a1c6f20f68e98ba210e22
Author: Alex Villacís Lasso <a_villacis@palosanto.com>
Date:   Wed Jan 30 21:47:42 2008 -0500

    [PATCH] Reset lastKnownPitch to 0 right after enabling streams.

diff --git a/src/savage_video.c b/src/savage_video.c
index 351dde9..848d1cb 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1471,6 +1471,7 @@ SavageDisplayVideoOld(
         SavageSetBlend(pScrn,id);
 	SavageStreamsOn(pScrn);
 	SavageResetVideo(pScrn);
+	pPriv->lastKnownPitch = 0;
       }
 
     if (S3_MOBILE_TWISTER_SERIES(psav->Chipset)
@@ -1614,6 +1615,7 @@ SavageDisplayVideoNew(
 	SavageSetBlend(pScrn,id);
 	SavageStreamsOn(pScrn);
 	SavageResetVideo(pScrn);
+	pPriv->lastKnownPitch = 0;
       }
 
     /* Calculate horizontal and vertical scale factors. */
@@ -1748,6 +1750,7 @@ SavageDisplayVideo2000(
         SavageSetBlend(pScrn,id);
         SavageStreamsOn(pScrn);
         SavageResetVideo(pScrn);
+        pPriv->lastKnownPitch = 0;
     }
 
     if (src_w > drw_w)

commit efd4ae6fda22a9283663cde23e6deead13130f6f
Author: Alex Villacís Lasso <a_villacis@palosanto.com>
Date:   Wed Jan 30 21:46:11 2008 -0500

    [PATCH] Prevent use of BCI for YV12 -> YUY2 conversion from scribbling past the end of the allocated video buffer.

diff --git a/src/savage_video.c b/src/savage_video.c
index cb944a4..351dde9 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1177,7 +1177,7 @@ SavageCopyPlanarDataBCI(
     SavagePtr psav = SAVPTR(pScrn);
     /* half of the dest buffer for copying the YVU data to it ??? */
     unsigned char *dstCopy = (unsigned char *)(((unsigned long)dst
-                                                + 2 * srcPitch * h
+                                                + dstPitch * h
                                                 + 0x0f) & ~0x0f);
     /* for pixel transfer */
     unsigned long offsetY = (unsigned long)dstCopy - (unsigned long)psav->FBBase;
@@ -1909,6 +1909,10 @@ SavagePutImage(
 	break;
     }  
 
+    if (srcPitch2 != 0 && S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) {
+        new_size = ((new_size + 0xF) & ~0xF) + srcPitch * height + srcPitch2 * height;
+    }
+
 /*    if(!(pPriv->area = SavageAllocateMemory(pScrn, pPriv->area, new_h)))
 	return BadAlloc;*/
     pPriv->video_offset = SavageAllocateMemory(pScrn, &pPriv->video_memory,

commit ee5b54a66495e51fb2a27b4ecb5875dae776b3c9
Author: Alex Villacís Lasso <a_villacis@palosanto.com>
Date:   Wed Jan 30 21:45:19 2008 -0500

    [PATCH] BCI can only handle widths that are multiple of 16, so only use BCI for these (for now).
    
    Small optimizations (use memcpy instead of copy loop).

diff --git a/src/savage_video.c b/src/savage_video.c
index 45b082b..cb944a4 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1189,21 +1189,15 @@ SavageCopyPlanarDataBCI(
     BCI_GET_PTR;
 
     /* copy Y planar */
-    for (i=0;i<srcPitch * h;i++) {
-        dstCopy[i] = srcY[i];
-    }
+    memcpy(dstCopy, srcY, srcPitch * h);
 
     /* copy V planar */    
     dstCopy = dstCopy + srcPitch * h;
-    for (i=0;i<srcPitch2 * (h>>1);i++) {
-        dstCopy[i] = srcV[i];
-    }
+    memcpy(dstCopy, srcV, srcPitch2 * (h>>1));
 
     /* copy U planar */
     dstCopy = dstCopy + srcPitch2 * (h>>1);    
-    for (i=0;i<srcPitch2 * (h>>1);i++) {
-        dstCopy[i] = srcU[i];        
-    }
+    memcpy(dstCopy, srcU, srcPitch2 * (h>>1));
 
     /*
      * Transfer pixel data from one memory location to another location
@@ -1253,6 +1247,9 @@ SavageCopyData(
   int w
 ){
     w <<= 1;
+    if (w == srcPitch && w == dstPitch) {
+        memcpy(dst, src, w * h);
+    } else
     while(h--) {
 	memcpy(dst, src, w);
 	src += srcPitch;
@@ -1937,7 +1934,7 @@ SavagePutImage(
 	offsetU += tmp;
 	offsetV += tmp;
 	nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
-        if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) {
+        if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0) {
             SavageCopyPlanarDataBCI(
                 pScrn,
 	    	buf + (top * srcPitch) + (left >> 1), 

commit 1169cb5bd96f7a4ac0deea6d085133d446ec0d6a
Author: Alex Villací­s Lasso <a_villacis@palosanto.com>
Date:   Sat Jan 19 12:08:50 2008 -0500

    Implement driver option IgnoreEDID
    
    Since some time, savage enforces video-mode and max. pixel clock
    validation through EDID, which is great for autoconfiguration, but
    prevents users from defining higher screen resolutions, even though the
    monitor is capable of it. This patch implements the IgnoreEDID option so
    that the EDID monitor information can be explictly disabled.

diff --git a/src/savage_driver.c b/src/savage_driver.c
index ed30efc..eb06519 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -277,6 +277,7 @@ typedef enum {
     ,OPTION_AGP_MODE
     ,OPTION_AGP_SIZE
     ,OPTION_DRI
+    ,OPTION_IGNORE_EDID
 } SavageOpts;
 
 
@@ -303,6 +304,7 @@ static const OptionInfoRec SavageOptions[] =
     { OPTION_DISABLE_COB,  "DisableCOB",  OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_BCI_FOR_XV,   "BCIforXv",    OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DVI,          "DVI",       OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_IGNORE_EDID,  "IgnoreEDID",  OPTV_BOOLEAN, {0}, FALSE },
 #ifdef XF86DRI
     { OPTION_BUS_TYPE,	"BusType",	OPTV_ANYSTR,  {0}, FALSE },
     { OPTION_DMA_TYPE,	"DmaType",	OPTV_ANYSTR,  {0}, FALSE },
@@ -1073,11 +1075,12 @@ static void SavageDoDDC(ScrnInfoPtr pScrn)
                 xf86LoaderReqSymLists(i2cSymbols,NULL);
                 if (SavageI2CInit(pScrn)) {
                     unsigned char tmp;
+                    xf86MonPtr pMon;
                     
                     InI2CREG(tmp,psav->DDCPort);
                     OutI2CREG(tmp | 0x13,psav->DDCPort);
-                    xf86SetDDCproperties(pScrn,xf86PrintEDID(
-                                             xf86DoEDID_DDC2(pScrn->scrnIndex,psav->I2C)));
+                    pMon = xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex,psav->I2C));
+                    if (!psav->IgnoreEDID) xf86SetDDCproperties(pScrn, pMon);
                     OutI2CREG(tmp,psav->DDCPort);
                 }
             }
@@ -1347,6 +1350,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
     memcpy(psav->Options, SavageOptions, sizeof(SavageOptions));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, psav->Options);
 
+    xf86GetOptValBool(psav->Options, OPTION_IGNORE_EDID, &psav->IgnoreEDID);
     xf86GetOptValBool(psav->Options, OPTION_PCI_BURST, &psav->pci_burst);
 
     if (psav->pci_burst) {
@@ -4728,7 +4732,8 @@ SavageDDC1(int scrnIndex)
     
     xf86PrintEDID(pMon);
     
-    xf86SetDDCproperties(pScrn,pMon);
+    if (!psav->IgnoreEDID)
+        xf86SetDDCproperties(pScrn,pMon);
 
     /* undo initialization */
     OutI2CREG(byte,psav->I2CPort);
diff --git a/src/savage_driver.h b/src/savage_driver.h
index e032ddc..b6d1e7a 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -335,6 +335,7 @@ typedef struct _Savage {
     /* Here are all the Options */
 
     OptionInfoPtr	Options;
+    Bool		IgnoreEDID;
     Bool		ShowCache;
     Bool		pci_burst;
     Bool		NoPCIRetry;

commit ce182d1883bba35491858b47291c8240441443d0
Author: Alex Villací­s Lasso <a_villacis@palosanto.com>
Date:   Sat Jan 19 12:06:25 2008 -0500

    Fix ambiguous operator precedence
    
    In the modified lines, the logical-not binds first to psav->videoFlags,
    not to (psav->videoFlags & VF_STREAMS_ON). If more flags are ever
    implemented, they could interfere with this check. More of a preventive
    patch than anything else.

diff --git a/src/savage_video.c b/src/savage_video.c
index 64dcef1..45b082b 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1469,7 +1469,7 @@ SavageDisplayVideoOld(
     if( psav->videoFourCC != id )
       SavageStreamsOff(pScrn);
 
-    if( !psav->videoFlags & VF_STREAMS_ON )
+    if( !(psav->videoFlags & VF_STREAMS_ON) )
       {
         SavageSetBlend(pScrn,id);
 	SavageStreamsOn(pScrn);
@@ -1612,7 +1612,7 @@ SavageDisplayVideoNew(
     if( psav->videoFourCC != id )
       SavageStreamsOff(pScrn);
 
-    if( !psav->videoFlags & VF_STREAMS_ON )
+    if( !(psav->videoFlags & VF_STREAMS_ON) )
       {
 	SavageSetBlend(pScrn,id);
 	SavageStreamsOn(pScrn);
@@ -1746,7 +1746,7 @@ SavageDisplayVideo2000(
     if( psav->videoFourCC != id )
         SavageStreamsOff(pScrn);
                                                                                                                              
-    if( !psav->videoFlags & VF_STREAMS_ON )
+    if( !(psav->videoFlags & VF_STREAMS_ON) )
     {
         SavageSetBlend(pScrn,id);
         SavageStreamsOn(pScrn);

commit 88141fd21214c501cafed73b1bba084b8a2bb929
Author: Alex Villací­s Lasso <a_villacis@palosanto.com>
Date:   Sat Jan 19 12:02:56 2008 -0500

    Make sure MMIO region is mapped VIDMEM_MMIO, not VIDMEM_FRAMEBUFFER

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 8209afe..ed30efc 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3168,7 +3168,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
                                    & psav->MmioRegion.memory);
 #else
         psav->MmioRegion.memory = 
-            xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
+            xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
                           psav->PciTag, psav->MmioRegion.base,
                           psav->MmioRegion.size);
         err = (psav->MmioRegion.memory == NULL) ? errno : 0;

commit fd2a598e64a522c028a20444379fa200a5724e62
Author: Alex Deucher <alex@botch2.(none)>
Date:   Sat Jan 19 12:00:16 2008 -0500

    Fix reversed logic in SavageMapMem()

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 9d4209a..8209afe 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3156,8 +3156,8 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
         }
 
         psav->ApertureMap = (psav->IsSecondary)
-            ? psav->ApertureRegion.memory
-            : psav->ApertureRegion.memory + 0x1000000;
+            ? psav->ApertureRegion.memory + 0x1000000
+            : psav->ApertureRegion.memory;
     }
 
     if (psav->MmioRegion.memory == NULL) {

commit 9c959f53ca8376aa136a9d434c3383cdb20487c2
Author: Alex Deucher <alex@botch2.(none)>
Date:   Fri Sep 14 20:21:12 2007 -0400

    fix the build for the non-pci-rework case (compile tested only)

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 586fbad..9d4209a 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -40,6 +40,7 @@
 #endif
 
 #include <unistd.h>
+#include <errno.h>
 
 #include "xf86RAC.h"
 #include "shadowfb.h"
@@ -3080,9 +3081,9 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
             + psav->PciInfo->regions[0].base_addr;
         psav->FbRegion.base = psav->PciInfo->regions[1].base_addr;
 #else
-        psav->MmioBase = SAVAGE_NEWMMIO_REGBASE_S4 
+        psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4 
             + psav->PciInfo->memBase[0];
-        psav->FrameBufferBase = psav->PciInfo->memBase[1];
+        psav->FbRegion.base = psav->PciInfo->memBase[1];
 #endif
     }
 
diff --git a/src/savage_driver.h b/src/savage_driver.h
index a65b2d8..e032ddc 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -280,8 +280,13 @@ typedef struct _StatInfo {
 } StatInfoRec,*StatInfoPtr;
 
 struct savage_region {
+#ifdef XSERVER_LIBPCIACCESS
     pciaddr_t       base;
     pciaddr_t       size;
+#else
+    unsigned long   base;
+    unsigned long   size;
+#endif
     void          * memory;
 };
 

commit 846a69f70d189c486448df269a512b8d42fab0c2
Author: Alex Deucher <alex@botch2.(none)>
Date:   Fri Sep 14 20:13:33 2007 -0400

    fix segfault from pScrn->currentMode
    
    should fix bug 12260

diff --git a/src/savage_driver.c b/src/savage_driver.c
index a49f6a9..586fbad 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -119,7 +119,7 @@ static Bool SavageDDC1(int scrnIndex);
 static unsigned int SavageDDC1Read(ScrnInfoPtr pScrn);
 static void SavageProbeDDC(ScrnInfoPtr pScrn, int index);
 static void SavageGetTvMaxSize(SavagePtr psav);
-static Bool SavagePanningCheck(ScrnInfoPtr pScrn);
+static Bool SavagePanningCheck(ScrnInfoPtr pScrn, DisplayModePtr pMode);
 #ifdef XF86DRI
 static Bool SavageCheckAvailableRamFor3D(ScrnInfoPtr pScrn);
 #endif
@@ -3627,7 +3627,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
     }
 #endif
 
-    SavagePanningCheck(pScrn);
+    SavagePanningCheck(pScrn, pScrn->currentMode);
 #ifdef XvExtension
     if( !psav->FBStart2nd && !psav->NoAccel  /*&& !SavagePanningCheck(pScrn)*/ ) {
 	if (psav->IsSecondary)
@@ -4271,7 +4271,7 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
         pSavEnt = pPriv->ptr;
         SavageModeInit(pSavEnt->pSecondaryScrn, pSavEnt->pSecondaryScrn->currentMode);
     }
-    SavagePanningCheck(pScrn);
+    SavagePanningCheck(pScrn, mode);
 
     return success;
 }
@@ -4750,12 +4750,9 @@ SavageGetTvMaxSize(SavagePtr psav)
 
 
 static Bool
-SavagePanningCheck(ScrnInfoPtr pScrn)
+SavagePanningCheck(ScrnInfoPtr pScrn, DisplayModePtr pMode)
 {
     SavagePtr psav = SAVPTR(pScrn);
-    DisplayModePtr pMode;
-
-    pMode = pScrn->currentMode;
     psav->iResX = pMode->CrtcHDisplay;
     psav->iResY = pMode->CrtcVDisplay;
 

commit 7da1a03d4b8b40483001b1f6e56dae655a1797f4
Author: James Cloos <cloos@jhcloos.com>
Date:   Mon Sep 3 05:52:43 2007 -0400

    Add *~ to .gitignore to skip patch/emacs droppings

diff --git a/.gitignore b/.gitignore
index fb1befd..2df4a8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ libtool
 ltmain.sh
 missing
 stamp-h1
+*~

commit 0287432c65231460fadff7d8d7b332208e345a31
Author: Ian Romanick <idr@us.ibm.com>
Date:   Fri Aug 31 13:07:17 2007 -0700

    Fix odd typo.

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 0346faa..a49f6a9 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3226,7 +3226,7 @@ static void SavageUnmapMem(ScrnInfoPtr pScrn, int All)
 #else
         xf86UnMapVidMem(pScrn->scrnIndex, (pointer)psav->FbRegion.base,
                         psav->FbRegion.size);
-#else
+#endif
     }
 
     if (psav->ApertureRegion.memory != NULL) {

commit 514dc647d108e179965adb1377b1d4c011afa367
Author: Ian Romanick <idr@us.ibm.com>
Date:   Thu Aug 30 17:53:11 2007 -0700

    Update to use new libpciaccess interfaces for mapping with MTRR support.

diff --git a/configure.ac b/configure.ac
index 04a4c3e..d596b7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,11 +51,6 @@ AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
                                   [Disable DRI support [[default=auto]]]),
               [DRI="$enableval"],
               [DRI=auto])
-AC_ARG_ENABLE(pciaccess,
-              AS_HELP_STRING([--enable-pciaccess],
-                             [Enable use of libpciaccess (default: disabled)]),
-              [PCIACCESS=$enableval],
-              [PCIACCESS=no])
 
 # Checks for extensions
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
@@ -100,12 +95,17 @@ if test "$DRI" = yes; then
         AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
 fi
 
-AM_CONDITIONAL(PCIACCESS, [test "x$PCIACCESS" = xyes])
-if test "x$PCIACCESS" = xyes; then
-    AC_DEFINE(PCIACCESS, 1, [Use libpciaccess])
-    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.7.0])
-    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+save_CFLAGS="$CFLAGS"
+CFLAGS="$XORG_CFLAGS"
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+              [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no],
+              [#include "xorg-server.h"])
+CFLAGS="$save_CFLAGS"
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10.0])
 fi
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 
 AC_SUBST([DRI_CFLAGS])
 AC_SUBST([XORG_CFLAGS])
diff --git a/src/savage_dga.c b/src/savage_dga.c
index 49c9a3c..fd26d78 100644
--- a/src/savage_dga.c
+++ b/src/savage_dga.c
@@ -391,7 +391,7 @@ Savage_OpenFramebuffer(
     SavagePtr psav = SAVPTR(pScrn);
 
     *name = NULL;	 /* no special device */
-    *mem = (unsigned char*)psav->FrameBufferBase;
+    *mem = (unsigned char*)psav->FbRegion.base;
     *size = psav->videoRambytes;
     *offset = 0;
     *flags = DGA_NEED_ROOT;
diff --git a/src/savage_dri.c b/src/savage_dri.c
index aca0b8c..211fef0 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -624,7 +624,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen )
    pSAVAGEDRIServer->registers.size = SAVAGEIOMAPSIZE;
 
    if ( drmAddMap( psav->drmFD,
-		   (drm_handle_t)psav->MmioBase,
+		   (drm_handle_t)psav->MmioRegion.base,
 		   pSAVAGEDRIServer->registers.size,
 		   DRM_REGISTERS,0,
 		   &pSAVAGEDRIServer->registers.handle ) < 0 ) {
@@ -636,7 +636,7 @@ static Bool SAVAGEDRIMapInit( ScreenPtr pScreen )
    pSAVAGEDRIServer->aperture.size = 5 * 0x01000000;
    
    if ( drmAddMap( psav->drmFD,
-		   (drm_handle_t)(psav->ApertureBase),
+		   (drm_handle_t)(psav->ApertureRegion.base),
 		   pSAVAGEDRIServer->aperture.size,
 		   DRM_FRAME_BUFFER,0,
 		   &pSAVAGEDRIServer->aperture.handle ) < 0 ) {
@@ -882,7 +882,7 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
       sprintf(pDRIInfo->busIdString,
               "PCI:%d:%d:%d",
               psav->PciInfo->bus,
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
               psav->PciInfo->dev,
 #else
               psav->PciInfo->device,
@@ -893,7 +893,7 @@ Bool SAVAGEDRIScreenInit( ScreenPtr pScreen )
    pDRIInfo->ddxDriverMinorVersion = SAVAGE_VERSION_MINOR;
    pDRIInfo->ddxDriverPatchVersion = SAVAGE_PATCHLEVEL;
 
-   pDRIInfo->frameBufferPhysicalAddress = (pointer) psav->FrameBufferBase;
+   pDRIInfo->frameBufferPhysicalAddress = (pointer) psav->FbRegion.base;
    pDRIInfo->frameBufferSize = psav->videoRambytes;
    pDRIInfo->frameBufferStride = pScrn->displayWidth*(pScrn->bitsPerPixel/8);
    pDRIInfo->ddxDrawableTableEntry = SAVAGE_MAX_DRAWABLES;
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 4c4246b..0346faa 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -72,7 +72,7 @@ static void SavageDisableMMIO(ScrnInfoPtr pScrn);
 
 static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid);
 static void SavageIdentify(int flags);
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
 static Bool SavagePciProbe(DriverPtr drv, int entity_num,
 			   struct pci_device *dev, intptr_t match_data);
 #else
@@ -138,7 +138,7 @@ extern ScrnInfoPtr gpScrn;
 
 int gSavageEntityIndex = -1;
 
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
 #define SAVAGE_DEVICE_MATCH(d, i) \
     { 0x5333, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
 
@@ -212,7 +212,7 @@ static SymTabRec SavageChipsets[] = {
     { -1,		NULL }
 };
 
-#ifndef PCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
 /* This table maps a PCI device ID to a chipset family identifier. */
 
 static PciChipsets SavagePciChipsets[] = {
@@ -318,7 +318,7 @@ _X_EXPORT DriverRec SAVAGE =
     SAVAGE_VERSION,
     SAVAGE_DRIVER_NAME,
     SavageIdentify,
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
     NULL,
 #else
     SavageProbe,
@@ -328,7 +328,7 @@ _X_EXPORT DriverRec SAVAGE =
     0,
     NULL,
 
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
     savage_device_match,
     SavagePciProbe
 #endif
@@ -838,7 +838,7 @@ static void SavageIdentify(int flags)
 }
 
 
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
 static Bool SavagePciProbe(DriverPtr drv, int entity_num,
 			   struct pci_device *dev, intptr_t match_data)
 {
@@ -1592,7 +1592,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
 
     xfree(pEnt);
 
-#ifndef PCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     psav->PciTag = pciTag(psav->PciInfo->bus, psav->PciInfo->device,
 			  psav->PciInfo->func);
 #endif
@@ -1601,7 +1601,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
     /* Set AGP Mode from config */
     /* We support 1X 2X and 4X  */
 #ifdef XF86DRI
-#ifdef PCIACCESS
+#ifdef XSERVER_LIBPCIACCESS
     /* Try to read the AGP capabilty block from the device.  If there is
      * no AGP info, the device is PCI.
      */
@@ -3060,127 +3060,132 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
 static Bool SavageMapMem(ScrnInfoPtr pScrn)
 {
     SavagePtr psav = SAVPTR(pScrn);
-#ifndef PCIACCESS
-    int mode;
-#endif
-    unsigned i;
+    int err;
 
     TRACE(("SavageMapMem()\n"));
 
     if( S3_SAVAGE3D_SERIES(psav->Chipset) ) {
-	psav->MmioRegion.bar = 0;
-	psav->MmioRegion.offset = SAVAGE_NEWMMIO_REGBASE_S3;
-
-	psav->FbRegion.bar = 0;
-	psav->FbRegion.offset = 0;
-
-	psav->last_bar = 0;
+#ifdef XSERVER_LIBPCIACCESS
+        psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S3
+            + psav->PciInfo->regions[0].base_addr;
+        psav->FbRegion.base = psav->PciInfo->regions[0].base_addr;
+#else
+        psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S3
+            + psav->PciInfo->memBase[0];
+        psav->FbRegion.base = psav->PciInfo->memBase[0];
+#endif
     } else {
-	psav->MmioRegion.bar = 0;
-	psav->MmioRegion.offset = SAVAGE_NEWMMIO_REGBASE_S4;
-
-	psav->FbRegion.bar = 1;
-	psav->FbRegion.offset = 0;
-
-	psav->last_bar = 1;
+#ifdef XSERVER_LIBPCIACCESS
+        psav->MmioRegion.base = SAVAGE_NEWMMIO_REGBASE_S4
+            + psav->PciInfo->regions[0].base_addr;
+        psav->FbRegion.base = psav->PciInfo->regions[1].base_addr;
+#else
+        psav->MmioBase = SAVAGE_NEWMMIO_REGBASE_S4 
+            + psav->PciInfo->memBase[0];
+        psav->FrameBufferBase = psav->PciInfo->memBase[1];
+#endif
     }
 
+    psav->MmioRegion.size = SAVAGE_NEWMMIO_REGSIZE;
+    psav->FbRegion.size = psav->videoRambytes;
+
     /* On Paramount and Savage 2000, aperture 0 is PCI base 2.  On other
      * chipsets it's in the same BAR as the framebuffer.
      */
     if ((psav->Chipset == S3_SUPERSAVAGE) 
-	|| (psav->Chipset == S3_SAVAGE2000)) {
-	psav->ApertureRegion.bar = 2;
-	psav->ApertureRegion.offset = 0;
-
-	psav->last_bar = 2;
+        || (psav->Chipset == S3_SAVAGE2000)) {
+#ifdef XSERVER_LIBPCIACCESS
+        psav->ApertureRegion.base = psav->PciInfo->regions[2].base_addr;
+#else
+        psav->ApertureRegion.base = psav->PciInfo->memBase[2];
+#endif
     } else {
-	psav->ApertureRegion.bar = psav->FbRegion.bar;
-	psav->ApertureRegion.offset = 0x02000000;
+        psav->ApertureRegion.base = psav->FbRegion.base + 0x02000000;
     }
 
+    psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
+        ? (0x01000000 * 2) : (0x01000000 * 5);
 
-#ifdef PCIACCESS
-    psav->MmioBase = psav->PciInfo->regions[ psav->MmioRegion.bar ].base_addr
-      + psav->MmioRegion.offset;
 


Reply to: