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

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



 configure.ac        |    4 +--
 man/Makefile.am     |    1 
 src/savage_accel.c  |    1 
 src/savage_bci.h    |    1 
 src/savage_dga.c    |    1 
 src/savage_dri.c    |   35 +++++++++++++--------------------
 src/savage_driver.c |   55 +++++++++++++++++++++++++++++++++++++++++-----------
 src/savage_driver.h |    1 
 src/savage_exa.c    |   21 ++++++++++---------
 src/savage_i2c.c    |    1 
 src/savage_regs.h   |    1 
 src/savage_shadow.c |    1 
 src/savage_vbe.c    |   11 ----------
 src/savage_vbe.h    |    1 
 src/savage_video.c  |   55 +++++++++++++++++++++++++++++++++-------------------
 15 files changed, 107 insertions(+), 83 deletions(-)

New commits:
commit de3350e7937240686a90e51243e701b51a7f5249
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed May 21 16:04:31 2008 -0400

    no, really, savage 2.2.1

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

commit 97a9d2476868befc989b7ddb8067ac791bf2672e
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed May 21 16:01:37 2008 -0400

    savage 2.2.1

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

commit fd20f5ddc2ef5945a757f6afedff5fb6214b607e
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed May 21 16:00:40 2008 -0400

    Fake sync ranges for panels with no EDID.
    
    Red Hat bug #243589.

diff --git a/src/savage_driver.c b/src/savage_driver.c
index eb06519..1b94d1f 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -1211,6 +1211,30 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
 	psav->PanelX = panelX;
 	psav->PanelY = panelY;
 
+	do {
+	    DisplayModePtr native = xf86CVTMode(panelX, panelY, 60.0, 0, 0);
+	    if (!native)
+		break;
+
+	    if (!pScrn->monitor->nHsync) {
+		pScrn->monitor->nHsync = 1;
+		pScrn->monitor->hsync[0].lo = 31.5;
+		pScrn->monitor->hsync[0].hi = (float)native->Clock /
+					      (float)native->HTotal;
+	    }
+	    if (!pScrn->monitor->nVrefresh) {
+		pScrn->monitor->nVrefresh = 1;
+		pScrn->monitor->vrefresh[0].lo = 56.0;
+		pScrn->monitor->vrefresh[0].hi = (float)native->Clock * 1000.0 /
+						 (float)native->HTotal /
+						 (float)native->VTotal;
+	    }
+	    if (!pScrn->monitor->maxPixClock)
+		pScrn->monitor->maxPixClock = native->Clock;
+
+	    xfree(native);
+	} while (0);
+
 	if( psav->LCDClock > 0.0 )
 	{
 	    psav->maxClock = psav->LCDClock * 1000.0;

commit 09c4dcc658b07f2672388eb4ab5fee3ebe190fc9
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed May 21 15:58:24 2008 -0400

    Don't try to call vbeModeInit(), it doesn't exist and never will.

diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index 5933b4e..afbaa8f 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -18,7 +18,6 @@
 #endif
 #define L_ADD(x)  (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
 
-Bool vbeModeInit( vbeInfoPtr, int );
 static int SavageGetDevice( SavagePtr psav );
 /*static int SavageGetTVType( SavagePtr psav );*/
 void SavageSetVESAModeCrtc1( SavagePtr psav, int n, int Refresh );
@@ -186,15 +185,6 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh )
 	    ErrorF("Set video mode failed\n");
 	}
     }
-#ifdef XFree86LOADER
-    else
-    {
-	if( !vbeModeInit( psav->pVbe, n ) )
-	{
-	    ErrorF("Set video mode failed\n");
-	}
-    }
-#endif
 }
 
 void

commit a01c9d12938f977a4310e0547866f01517059a3e
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat May 10 15:06:18 2008 +1000

    savage/pciaccess: don't try to map aperture larger than region window

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 5fd7d66..2205dc8 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3097,10 +3097,16 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
     /* On Paramount and Savage 2000, aperture 0 is PCI base 2.  On other
      * chipsets it's in the same BAR as the framebuffer.
      */
+
+    psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
+        ? (0x01000000 * 2) : (0x01000000 * 5);
+
     if ((psav->Chipset == S3_SUPERSAVAGE) 
         || (psav->Chipset == S3_SAVAGE2000)) {
 #ifdef XSERVER_LIBPCIACCESS
         psav->ApertureRegion.base = psav->PciInfo->regions[2].base_addr;
+        if (psav->ApertureRegion.size > psav->PciInfo->regions[2].size)
+            psav->ApertureRegion.size = psav->PciInfo->regions[2].size;
 #else
         psav->ApertureRegion.base = psav->PciInfo->memBase[2];
 #endif
@@ -3108,8 +3114,6 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
         psav->ApertureRegion.base = psav->FbRegion.base + 0x02000000;
     }
 
-    psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary)
-        ? (0x01000000 * 2) : (0x01000000 * 5);
 
 
     if (psav->FbRegion.size != 0) {

commit 69eca3b8340966874ee3ffdc0d0a3f73de7a816a
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat May 10 14:58:14 2008 +1000

    savage: fix typos in error message

diff --git a/src/savage_driver.c b/src/savage_driver.c
index eb06519..5fd7d66 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3128,7 +3128,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
 #endif
         if (err) {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "Internal error: cound not map framebuffer range (%d, %s).\n",
+                       "Internal error: could not map framebuffer range (%d, %s).\n",
                        err, strerror(err));
             return FALSE;
         }
@@ -3154,7 +3154,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
 #endif
         if (err) {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "Internal error: cound not map aperture range (%d, %s).\n",
+                       "Internal error: could not map aperture range (%d, %s).\n",
                        err, strerror(err));
             return FALSE;
         }
@@ -3179,7 +3179,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
 #endif
         if (err) {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-                       "Internal error: cound not map MMIO range (%d, %s).\n",
+                       "Internal error: could not map MMIO range (%d, %s).\n",
                        err, strerror(err));
             return FALSE;
         }

commit 9cb124b3542c942622a54d0ce429661516b1e2f4
Author: Alex Villacís Lasso <a_villacis@palosanto.com>
Date:   Thu Apr 10 12:51:47 2008 -0400

    EXA upload to screen must honor pitch of the source data

diff --git a/src/savage_exa.c b/src/savage_exa.c
index aa6905a..6320e18 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -460,7 +460,6 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
     CARD32 * srcp; 
     
     Bpp = pDst->drawable.bitsPerPixel / 8;
-    dwords = (((w * Bpp) + 3) >> 2) * h;
 
     psav->sbd_offset = exaGetPixmapOffset(pDst);
     psav->sbd_high = SavageSetBD(psav, pDst);
@@ -486,17 +485,19 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
     BCI_SEND(BCI_X_Y(x, y));
     BCI_SEND(BCI_W_H(w, h));
     
-    srcp = (CARD32 *)src;
     queue = 120 * 1024;
-    while (dwords) {
-	if (queue < 4) {
-	    BCI_RESET;
-	    queue = 120 * 1024;
+    dwords = (((w * Bpp) + 3) >> 2);
+    for (i = 0; i < h; i++) {
+	srcp = (CARD32 *)src;
+	for (j = 0; j < dwords; j++) {
+	    if (queue < 4) {
+		BCI_RESET;
+		queue = 120 * 1024;
+	    }
+	    BCI_SEND(*srcp++);
+	    queue -= 4;
 	}
-	BCI_SEND(*srcp);
-	queue -= 4;
-	dwords--;
-	srcp++;
+	src += src_pitch;
     }
 
     /*exaWaitSync(pDst->drawable.pScreen);*/

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) {


Reply to: