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

xserver-xorg-video-savage: Changes to 'ubuntu'



 ChangeLog            |   86 +++++++++++++++++++++++++
 configure.ac         |    6 -
 debian/changelog     |   14 ++++
 src/Makefile.am      |    1 
 src/savage_accel.c   |    4 -
 src/savage_bci.h     |    7 --
 src/savage_common.h  |    6 -
 src/savage_dri.c     |  170 +++++++++++++++------------------------------------
 src/savage_dri.h     |    6 -
 src/savage_dripriv.h |    6 -
 src/savage_driver.c  |   46 +++++++------
 src/savage_driver.h  |   11 ++-
 src/savage_drm.h     |   12 +--
 src/savage_exa.c     |    8 +-
 src/savage_hwmc.c    |    1 
 src/savage_i2c.c     |    5 -
 src/savage_pciids.h  |   55 ++++++++++++++++
 src/savage_regs.h    |    6 -
 src/savage_sarea.h   |   12 +--
 src/savage_streams.h |    7 --
 src/savage_vbe.h     |    6 -
 src/savage_video.c   |   12 +--
 22 files changed, 287 insertions(+), 200 deletions(-)

New commits:
commit f988cfa5407d54c5ba133bbac10ecbf41aa71580
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Fri Jun 8 15:14:43 2012 +0200

    Merge from Debian
    
    * Merge from Debian Testing.  Remaining Ubuntu changes:
      - 100_bustype_pci_by_default.diff (LP: 33617, 37218)

diff --git a/debian/changelog b/debian/changelog
index 1832774..7666441 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-savage (1:2.3.4-1ubuntu1) UNRELEASED; urgency=low
+
+  * Merge from Debian Testing.  Remaining Ubuntu changes:
+    - 100_bustype_pci_by_default.diff (LP: 33617, 37218)
+
+ -- Maarten Lankhorst <maarten.lankhorst@canonical.com>  Fri, 08 Jun 2012 15:13:45 +0200
+
 xserver-xorg-video-savage (1:2.3.4-1) unstable; urgency=low
 
   * New upstream release

commit a148cd99785b5312d923ad0df34b56bf1b32063e
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue May 8 11:44:47 2012 +0200

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index b3463ff..e68bc48 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-xserver-xorg-video-savage (1:2.3.4-1) UNRELEASED; urgency=low
+xserver-xorg-video-savage (1:2.3.4-1) unstable; urgency=low
 
   * New upstream release
     + Fix for new vgahw ABI (closes: #671800)
 
- -- Julien Cristau <jcristau@debian.org>  Tue, 08 May 2012 11:32:10 +0200
+ -- Julien Cristau <jcristau@debian.org>  Tue, 08 May 2012 11:44:31 +0200
 
 xserver-xorg-video-savage (1:2.3.3-1) unstable; urgency=low
 

commit ddf889f135e1df01ea71d36574dcb00084f0cd71
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue May 8 11:35:07 2012 +0200

    Bump changelogs

diff --git a/ChangeLog b/ChangeLog
index 9c3d48e..eda84db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,89 @@
+commit 63dd44674a28263c5d8d6aec8b72e95f94d3fe6c
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Mar 23 19:46:12 2012 -0700
+
+    xf86-video-savage 2.3.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit dfcc325f55d580eb630f3b236eadf99f6b7d6ad6
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Mar 23 19:38:07 2012 -0700
+
+    Add savage_pciids.h to src/Makefile.am to fix distcheck
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit c4022796ec69bb3223d435d8442f9168aebe9c3d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 17 15:35:39 2012 +1000
+
+    Untangle XF86DRI from the driver-specific DRI define
+    
+    XF86DRI is defined by xorg-server.h, so --disable-dri in the driver
+    itself does exactly nothing other than not fill in the CFLAGS and thus stop
+    the driver from compiling.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
+
+commit 05f74bd80018bc503ff5631b357fc0b02df6187f
+Author: Andrew Turner <andrew@fubar.geek.nz>
+Date:   Fri Oct 14 00:18:40 2011 +0200
+
+    Merge almost identical code in SAVAGEInitVisualConfigs
+    
+    https://bugs.freedesktop.org/show_bug.cgi?id=9961
+    
+    Signed-off-by: Andrew Turner <andrew@fubar.geek.nz>
+    [Tormod: Rename table to SAVAGEVisuals]
+    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
+
+commit 0600b7279382c66445506fa98dc50299574a1abd
+Author: Tormod Volden <debian.tormod@gmail.com>
+Date:   Sun Dec 4 23:36:19 2011 +0100
+
+    Avoid leading underscores in #include guards
+    
+    In a user header file, the macro name should not begin with `_'
+    http://gcc.gnu.org/onlinedocs/cpp/Once_002dOnly-Headers.html
+    
+    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
+
+commit 10f319e43f77fef450aa723eff25bd200600c48d
+Author: Tormod Volden <debian.tormod@gmail.com>
+Date:   Sun Dec 4 23:36:18 2011 +0100
+
+    Do not use the deprecated xf86PciInfo.h from xserver
+    
+    Instead maintain our own list of supported PCI IDs.
+    
+    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
+
+commit c3eaacd25358c225e355a1ea7d64dece8188b69a
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Dec 19 17:23:35 2011 -0500
+
+    Fix for new vgahw ABI
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit a0776b675a4a62d972d135508079950b8adbfe28
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Dec 19 17:22:53 2011 -0500
+
+    Fall back to shadowfb if XAA is unavailable
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 4618374e37674345303b5b44474195def65bba2a
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Jun 22 17:05:37 2011 -0400
+
+    Don't include xf86Priv.h
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
 commit 8b9c81bacf45a9f56b0ec275e1b48e1407380baf
 Author: Tormod Volden <debian.tormod@gmail.com>
 Date:   Sat Oct 8 21:55:38 2011 +0200
diff --git a/debian/changelog b/debian/changelog
index 45ffbee..b3463ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-savage (1:2.3.4-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + Fix for new vgahw ABI (closes: #671800)
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 08 May 2012 11:32:10 +0200
+
 xserver-xorg-video-savage (1:2.3.3-1) unstable; urgency=low
 
   [ Tormod Volden ]

commit 63dd44674a28263c5d8d6aec8b72e95f94d3fe6c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Mar 23 19:46:12 2012 -0700

    xf86-video-savage 2.3.4
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 2db5746..d82af14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-savage],
-        [2.3.3],
+        [2.3.4],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-savage])
 AC_CONFIG_SRCDIR([Makefile.am])

commit dfcc325f55d580eb630f3b236eadf99f6b7d6ad6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Fri Mar 23 19:38:07 2012 -0700

    Add savage_pciids.h to src/Makefile.am to fix distcheck
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index 8ae8051..e980c1a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,6 +40,7 @@ savage_drv_la_SOURCES = \
          savage_driver.h \
          savage_drm.h \
          savage_i2c.c \
+         savage_pciids.h \
          savage_regs.h \
          savage_sarea.h \
          savage_shadow.c \

commit c4022796ec69bb3223d435d8442f9168aebe9c3d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jan 17 15:35:39 2012 +1000

    Untangle XF86DRI from the driver-specific DRI define
    
    XF86DRI is defined by xorg-server.h, so --disable-dri in the driver
    itself does exactly nothing other than not fill in the CFLAGS and thus stop
    the driver from compiling.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

diff --git a/configure.ac b/configure.ac
index 6836350..2db5746 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,8 +99,8 @@ AC_MSG_RESULT([$DRI])
 AM_CONDITIONAL(DRI, test x$DRI = xyes)
 if test "$DRI" = yes; then
         PKG_CHECK_MODULES(DRI, [libdrm >= 2.0 xf86driproto])
-        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
-        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
+        AC_DEFINE(SAVAGEDRI,1,[Enable DRI driver support])
+        AC_DEFINE(SAVAGEDRI_DEVEL,1,[Enable developmental DRI driver support])
 fi
 
 save_CFLAGS="$CFLAGS"
diff --git a/src/savage_accel.c b/src/savage_accel.c
index 24e0a22..0920e22 100644
--- a/src/savage_accel.c
+++ b/src/savage_accel.c
@@ -24,7 +24,7 @@
 #include "savage_bci.h"
 #include "savage_streams.h"
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 #define _XF86DRI_SERVER_
 #include "savage_dri.h"
 #endif
@@ -1277,7 +1277,7 @@ SavageInitAccel(ScreenPtr pScreen)
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     SavagePtr psav = SAVPTR(pScrn);
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
         int cpp = pScrn->bitsPerPixel / 8;
diff --git a/src/savage_dri.c b/src/savage_dri.c
index 414e724..38d2a86 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -26,7 +26,7 @@
 #include "config.h"
 #endif
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 
 #include "xf86.h"
 #include "xf86_OSproc.h"
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 447beec..5e4ca0e 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -67,7 +67,7 @@
 
 #define TRANSPARENCY_KEY 0xff;
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 #define _XF86DRI_SERVER_
 #include "savage_dri.h"
 #include "savage_sarea.h"
@@ -130,7 +130,7 @@ static unsigned int SavageDDC1Read(ScrnInfoPtr pScrn);
 static void SavageProbeDDC(ScrnInfoPtr pScrn, int index);
 static void SavageGetTvMaxSize(SavagePtr psav);
 static Bool SavagePanningCheck(ScrnInfoPtr pScrn, DisplayModePtr pMode);
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 static Bool SavageCheckAvailableRamFor3D(ScrnInfoPtr pScrn);
 #endif
 static void SavageResetStreams(ScrnInfoPtr pScrn);
@@ -315,7 +315,7 @@ static const OptionInfoRec SavageOptions[] =
     { 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
+#ifdef SAVAGEDRI
     { OPTION_BUS_TYPE,	"BusType",	OPTV_ANYSTR,  {0}, FALSE },
     { OPTION_DMA_TYPE,	"DmaType",	OPTV_ANYSTR,  {0}, FALSE },
     { OPTION_DMA_MODE,  "DmaMode",	OPTV_ANYSTR,  {0}, FALSE },
@@ -1461,7 +1461,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
 
     /* Set AGP Mode from config */
     /* We support 1X 2X and 4X  */
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 #ifdef XSERVER_LIBPCIACCESS
     /* Try to read the AGP capabilty block from the device.  If there is
      * no AGP info, the device is PCI.
@@ -1672,7 +1672,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
                    "Option: %s Tile Mode and Program it \n",(psav->bDisableTile?"Disable":"Enable"));
     }
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     /* disabled by default...doesn't seem to work */
     psav->bDisableXvMC = TRUE; /* if you want to free up more mem for DRI,etc. */
     if (xf86GetOptValBool(psav->Options, OPTION_DISABLE_XVMC, &psav->bDisableXvMC)) {
@@ -1702,7 +1702,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
                    "%s DVI port support (Savage4 only)\n",(psav->dvi?"Force":"Disable"));
     }
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     psav->AGPforXv = FALSE;
     if (xf86GetOptValBool(psav->Options, OPTION_AGP_FOR_XV, &psav->AGPforXv)) {
         if (psav->AGPforXv) {
@@ -2201,7 +2201,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
 static Bool SavageEnterVT(int scrnIndex, int flags)
 {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     SavagePtr psav = SAVPTR(pScrn);
     ScreenPtr pScreen;
 #endif
@@ -2211,7 +2211,7 @@ static Bool SavageEnterVT(int scrnIndex, int flags)
     gpScrn = pScrn;
     SavageEnableMMIO(pScrn);
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         pScreen = screenInfo.screens[scrnIndex];
         SAVAGEDRIResume(pScreen);
@@ -2239,14 +2239,14 @@ static void SavageLeaveVT(int scrnIndex, int flags)
     SavagePtr psav = SAVPTR(pScrn);
     vgaRegPtr vgaSavePtr = &hwp->SavedReg;
     SavageRegPtr SavageSavePtr = &psav->SavedReg;
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     ScreenPtr pScreen;
 #endif
 
     TRACE(("SavageLeaveVT(%d)\n", flags));
     gpScrn = pScrn;
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         pScreen = screenInfo.screens[scrnIndex];
         DRILock(pScreen, 0);
@@ -2459,7 +2459,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
     
     TRACE(("SavageWriteMode(%x)\n", restore->mode));
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
         psav->LockHeld = 1;
@@ -2652,7 +2652,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
 	SavageSetGBD(pScrn);
 
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     	if (psav->directRenderingEnabled)
     	    DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
     	psav->LockHeld = 0;
@@ -2908,7 +2908,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr,
     vgaHWProtect(pScrn, FALSE);
 
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled)
         DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
     psav->LockHeld = 0;
@@ -3114,7 +3114,7 @@ static void SavageUnmapMem(ScrnInfoPtr pScrn, int All)
     return;
 }
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 static Bool SavageCheckAvailableRamFor3D(ScrnInfoPtr pScrn)
 {
     SavagePtr psav = SAVPTR(pScrn);
@@ -3258,7 +3258,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
 
     vgaHWBlankScreen(pScrn, TRUE);
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (!xf86ReturnOptValBool(psav->Options, OPTION_DRI, TRUE)) {
 	psav->directRenderingEnabled = FALSE;
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -3472,7 +3472,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
     if (xf86DPMSInit(pScreen, SavageDPMS, 0) == FALSE)
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed\n");
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         /* complete the DRI setup.*/
         psav->directRenderingEnabled = SAVAGEDRIFinishScreenInit(pScreen);
@@ -3503,7 +3503,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen,
     }
 #endif
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if ((psav->directRenderingEnabled) && (!psav->bDisableXvMC)) {
         if (SAVAGEInitMC(pScreen))
             xf86DrvMsg(pScrn->scrnIndex,X_CONFIG,"XvMC is enabled\n");
@@ -3979,7 +3979,7 @@ static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen)
 
     TRACE(("SavageCloseScreen\n"));
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (psav->directRenderingEnabled) {
         SAVAGEDRICloseScreen(pScreen);
 	/* reset shadow values */
diff --git a/src/savage_driver.h b/src/savage_driver.h
index 6c6dda8..7b7e01d 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -70,7 +70,11 @@
 #include "savage_regs.h"
 #include "savage_vbe.h"
 
-#ifdef XF86DRI
+#ifndef XF86DRI
+#undef SAVAGEDRI
+#endif
+
+#ifdef SAVAGEDRI
 #define _XF86DRI_SERVER_
 #include "savage_dripriv.h"
 #include "savage_dri.h"
@@ -457,7 +461,7 @@ typedef struct _Savage {
      int                 overlayDepth;
      int			primStreamBpp;
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     int 		LockHeld;
     Bool 		directRenderingEnabled;
     DRIInfoPtr 		pDRIInfo;
@@ -547,7 +551,7 @@ typedef struct _Savage {
 #define writescan savagewritescan
 
 /* add for support DRI */
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 
 #define SAVAGE_FRONT	0x1
 #define SAVAGE_BACK	0x2
diff --git a/src/savage_exa.c b/src/savage_exa.c
index 4fe43e5..613100b 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -15,7 +15,7 @@
 #include "savage_bci.h"
 #include "savage_streams.h"
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 #define _XF86DRI_SERVER_
 #include "savage_dri.h"
 #endif
@@ -441,7 +441,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
     int i, j, dwords, queue, Bpp;
     unsigned int cmd;
     CARD32 * srcp;
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     unsigned int dst_pitch;
     unsigned int dst_yoffset;
     int agp_possible;
@@ -451,7 +451,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
 
     Bpp = pDst->drawable.bitsPerPixel / 8;
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     /* Test for conditions for AGP Mastered Image Transfer (MIT). AGP memory
        needs to be available, the XVideo AGP needs to be enabled, the 
        framebuffer destination must be a multiple of 32 bytes, and the source
@@ -508,7 +508,7 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
             return TRUE;
         }
     }
-#endif /* XF86DRI */
+#endif /* SAVAGEDRI */
 
     /* If we reach here, AGP transfer is not possible, or failed to drmMap() */
     psav->sbd_offset = exaGetPixmapOffset(pDst);
diff --git a/src/savage_video.c b/src/savage_video.c
index 5f08a18..b5a6330 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -247,7 +247,7 @@ typedef struct {
    void         *video_planarmem;		/* opaque memory management information structure */
    CARD32       video_planarbuf; 		/* offset in video memory of planar YV12 buffer */
    
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
    Bool         tried_agp;			/* TRUE if AGP allocation has been tried */
    CARD32	agpBase;			/* Physical address of aperture base */
    CARD32	agpBufferOffset;		/* Offset of buffer in AGP memory, or 0 if unavailable */
@@ -1047,7 +1047,7 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
       /*SavageClipVWindow(pScrn);*/
  	SavageStreamsOff( pScrn );
 
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
 	if (pPriv->agpBufferMap != NULL) {
 	    SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
 
@@ -1978,7 +1978,7 @@ SavagePutImage(
 
     /* Check whether AGP buffers can be allocated. If not, fall back to ordinary
        upload to framebuffer (slower) */
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
     if (!pPriv->tried_agp && !psav->IsPCI && psav->drmFD > 0 && psav->DRIServerInfo != NULL) {
 	SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo;
         
@@ -2014,7 +2014,7 @@ SavagePutImage(
 	    pPriv->agpBufferOffset = 0;
 	}
     }
-#endif /* XF86DRI */
+#endif /* SAVAGEDRI */
 
 
     /* Buffer for final packed frame */
@@ -2060,7 +2060,7 @@ SavagePutImage(
 	offsetV += tmp;
 	nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
         if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0 && pPriv->video_planarbuf != 0) {
-#ifdef XF86DRI
+#ifdef SAVAGEDRI
             if (pPriv->agpBufferMap != NULL) {
 		/* Using copy to AGP memory */
 		SavageCopyPlanarDataBCI(
@@ -2073,7 +2073,7 @@ SavagePutImage(
 		    pPriv->agpBase + pPriv->agpBufferOffset,
 		    srcPitch, srcPitch2, dstPitch, nlines, npixels, TRUE);
             } else
-#endif /* XF86DRI */
+#endif /* SAVAGEDRI */
             {
 		/* Using ordinary copy to framebuffer */
 		SavageCopyPlanarDataBCI(

commit 05f74bd80018bc503ff5631b357fc0b02df6187f
Author: Andrew Turner <andrew@fubar.geek.nz>
Date:   Fri Oct 14 00:18:40 2011 +0200

    Merge almost identical code in SAVAGEInitVisualConfigs
    
    https://bugs.freedesktop.org/show_bug.cgi?id=9961
    
    Signed-off-by: Andrew Turner <andrew@fubar.geek.nz>
    [Tormod: Rename table to SAVAGEVisuals]
    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

diff --git a/src/savage_dri.c b/src/savage_dri.c
index 52a4b7c..414e724 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -53,6 +53,23 @@
 #include "savage_dri.h"
 #include "savage_sarea.h"
 
+static struct {
+   int bpp;
+   int redSize;
+   int greenSize;
+   int blueSize;
+   int alphaSize;
+   int redMask;
+   int greenMask;
+   int blueMask;
+   int alphaMask;
+   int depthSize;
+} SAVAGEVisuals[] = {
+   { 16, 5, 6, 5, 0, 0x0000F800, 0x000007E0, 0x0000001F, 0, 16 },
+   { 32, 8, 8, 8, 0, 0x00FF0000, 0x0000FF00, 0x000000FF, 0, 24 },
+   {  0, 0, 0, 0, 0,          0,          0,          0, 0,  0 }
+};
+
 static char SAVAGEKernelDriverName[] = "savage";
 static char SAVAGEClientDriverName[] = "savage";
 
@@ -93,7 +110,7 @@ static Bool SAVAGEInitVisualConfigs( ScreenPtr pScreen )
    __GLXvisualConfig *pConfigs = 0;
    SAVAGEConfigPrivPtr pSAVAGEConfigs = 0;
    SAVAGEConfigPrivPtr *pSAVAGEConfigPtrs = 0;
-   int i, db, depth, stencil, accum;
+   int i, db, stencil, accum, visNum;
 
    switch ( pScrn->bitsPerPixel ) {
    case 8:
@@ -101,6 +118,7 @@ static Bool SAVAGEInitVisualConfigs( ScreenPtr pScreen )
       break;
 
    case 16:
+   case 32:
       numConfigs = 8;
 
       pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig),
@@ -128,117 +146,32 @@ static Bool SAVAGEInitVisualConfigs( ScreenPtr pScreen )
 	 pSAVAGEConfigPtrs[i] = &pSAVAGEConfigs[i];
       }
 
-      i = 0;
-      depth = 1;
-      for ( accum = 0 ; accum <= 1 ; accum++ ) {
-         for ( stencil = 0 ; stencil <= 1 ; stencil++ ) {
-            for ( db = 1 ; db >= 0 ; db-- ) {
-               pConfigs[i].vid			= -1;
-               pConfigs[i].class		= -1;
-               pConfigs[i].rgba			= TRUE;
-               pConfigs[i].redSize		= 5;
-               pConfigs[i].greenSize		= 6;
-               pConfigs[i].blueSize		= 5;
-               pConfigs[i].alphaSize		= 0;
-               pConfigs[i].redMask		= 0x0000F800;
-               pConfigs[i].greenMask		= 0x000007E0;
-               pConfigs[i].blueMask		= 0x0000001F;
-               pConfigs[i].alphaMask		= 0;
-               if ( accum ) {
-                  pConfigs[i].accumRedSize	= 16;
-                  pConfigs[i].accumGreenSize	= 16;
-                  pConfigs[i].accumBlueSize	= 16;
-                  pConfigs[i].accumAlphaSize	= 0;
-               } else {
-                  pConfigs[i].accumRedSize	= 0;
-                  pConfigs[i].accumGreenSize	= 0;
-                  pConfigs[i].accumBlueSize	= 0;
-                  pConfigs[i].accumAlphaSize	= 0;
-               }
-               if ( db ) {
-                  pConfigs[i].doubleBuffer	= TRUE;
-               } else {
-                  pConfigs[i].doubleBuffer	= FALSE;
-	       }
-               pConfigs[i].stereo		= FALSE;
-               pConfigs[i].bufferSize		= 16;
-               if ( depth ) {
-                  pConfigs[i].depthSize		= 16;
-               } else {
-                  pConfigs[i].depthSize		= 0;
-	       }
-               if ( stencil ) {
-                  pConfigs[i].stencilSize	= 8;
-               } else {
-                  pConfigs[i].stencilSize	= 0;
-	       }
-               pConfigs[i].auxBuffers		= 0;
-               pConfigs[i].level		= 0;
-               if ( accum || stencil ) {
-		  pConfigs[i].visualRating	= GLX_SLOW_CONFIG;
-               } else {
-                  pConfigs[i].visualRating	= GLX_NONE;
-	       }
-               pConfigs[i].transparentPixel	= GLX_NONE;
-               pConfigs[i].transparentRed	= 0;
-               pConfigs[i].transparentGreen	= 0;
-               pConfigs[i].transparentBlue	= 0;
-               pConfigs[i].transparentAlpha	= 0;
-               pConfigs[i].transparentIndex	= 0;
-               i++;
-            }
-         }
-      }
-      if ( i != numConfigs ) {
-         xf86DrvMsg( pScrn->scrnIndex, X_ERROR,
-		     "[drm] Incorrect initialization of visuals\n" );
-         return FALSE;
-      }
-      break;
-
-   case 32:
-      numConfigs = 8;
-
-      pConfigs = (__GLXvisualConfig*)calloc( sizeof(__GLXvisualConfig),
-						numConfigs );
-      if ( !pConfigs ) {
-	 return FALSE;
+      for (visNum = 0; SAVAGEVisuals[visNum].bpp != 0; visNum++) {
+         if ( SAVAGEVisuals[visNum].bpp == pScrn->bitsPerPixel )
+            break;
       }
-
-      pSAVAGEConfigs = (SAVAGEConfigPrivPtr)calloc( sizeof(SAVAGEConfigPrivRec),
-						 numConfigs );
-      if ( !pSAVAGEConfigs ) {
-	 free( pConfigs );
-	 return FALSE;
-      }
-
-      pSAVAGEConfigPtrs = (SAVAGEConfigPrivPtr*)calloc( sizeof(SAVAGEConfigPrivPtr),
-						     numConfigs );
-      if ( !pSAVAGEConfigPtrs ) {
+      if ( SAVAGEVisuals[visNum].bpp == 0 ) {
 	 free( pConfigs );
 	 free( pSAVAGEConfigs );
-	 return FALSE;
-      }
-
-      for ( i = 0 ; i < numConfigs ; i++ ) {
-	 pSAVAGEConfigPtrs[i] = &pSAVAGEConfigs[i];
+         return FALSE;
       }
 
       i = 0;
       for ( accum = 0 ; accum <= 1 ; accum++ ) {
          for ( stencil = 0 ; stencil <= 1 ; stencil++ ) {
             for ( db = 1 ; db >= 0 ; db-- ) {
-               pConfigs[i].vid			= -1;
-               pConfigs[i].class		= -1;
-               pConfigs[i].rgba			= TRUE;
-               pConfigs[i].redSize		= 8;
-               pConfigs[i].greenSize		= 8;
-               pConfigs[i].blueSize		= 8;
-               pConfigs[i].alphaSize		= 0;
-               pConfigs[i].redMask		= 0x00FF0000;
-               pConfigs[i].greenMask		= 0x0000FF00;
-               pConfigs[i].blueMask		= 0x000000FF;
-               pConfigs[i].alphaMask		= 0;
+               pConfigs[i].vid		= -1;
+               pConfigs[i].class	= -1;
+               pConfigs[i].rgba		= TRUE;
+               pConfigs[i].redSize	= SAVAGEVisuals[visNum].redSize;
+               pConfigs[i].greenSize	= SAVAGEVisuals[visNum].greenSize;
+               pConfigs[i].blueSize	= SAVAGEVisuals[visNum].blueSize;
+               pConfigs[i].alphaSize	= SAVAGEVisuals[visNum].alphaSize;
+               pConfigs[i].redMask	= SAVAGEVisuals[visNum].redMask;
+               pConfigs[i].greenMask	= SAVAGEVisuals[visNum].greenMask;
+               pConfigs[i].blueMask	= SAVAGEVisuals[visNum].blueMask;
+               pConfigs[i].alphaMask	= SAVAGEVisuals[visNum].alphaMask;
+
                if ( accum ) {
                   pConfigs[i].accumRedSize	= 16;
                   pConfigs[i].accumGreenSize	= 16;
@@ -254,24 +187,27 @@ static Bool SAVAGEInitVisualConfigs( ScreenPtr pScreen )
                   pConfigs[i].doubleBuffer	= TRUE;
                } else {
                   pConfigs[i].doubleBuffer	= FALSE;
-	       }
+               }
                pConfigs[i].stereo		= FALSE;
-               pConfigs[i].bufferSize		= 32;
+               pConfigs[i].bufferSize		= pScrn->bitsPerPixel;
+               pConfigs[i].depthSize	= SAVAGEVisuals[visNum].depthSize;
                if ( stencil ) {
-		     pConfigs[i].depthSize	= 24;
-                     pConfigs[i].stencilSize	= 8;
-               }
-               else {
-                     pConfigs[i].depthSize	= 24;
-                     pConfigs[i].stencilSize	= 0;
+                  pConfigs[i].stencilSize	= 8;
+               } else {
+                  pConfigs[i].stencilSize	= 0;
                }
+
                pConfigs[i].auxBuffers		= 0;
                pConfigs[i].level		= 0;
-               if ( accum ) {
+
+               pConfigs[i].visualRating	= GLX_NONE;
+               if ( pScrn->bitsPerPixel == 16 ) {
+                  if ( accum || stencil ) {
+                     pConfigs[i].visualRating	= GLX_SLOW_CONFIG;
+                  }
+               } else if ( accum ) {
                   pConfigs[i].visualRating	= GLX_SLOW_VISUAL_EXT;
-               } else {
-                  pConfigs[i].visualRating	= GLX_NONE;
-	       }
+               }
                pConfigs[i].transparentPixel	= GLX_NONE;
                pConfigs[i].transparentRed	= 0;
                pConfigs[i].transparentGreen	= 0;

commit 0600b7279382c66445506fa98dc50299574a1abd
Author: Tormod Volden <debian.tormod@gmail.com>
Date:   Sun Dec 4 23:36:19 2011 +0100

    Avoid leading underscores in #include guards
    
    In a user header file, the macro name should not begin with `_'
    http://gcc.gnu.org/onlinedocs/cpp/Once_002dOnly-Headers.html
    
    Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

diff --git a/src/savage_bci.h b/src/savage_bci.h
index 174a26b..9d8d656 100644
--- a/src/savage_bci.h
+++ b/src/savage_bci.h
@@ -1,6 +1,6 @@
 
-#ifndef _S3BCI_H_
-#define _S3BCI_H_
+#ifndef S3BCI_H
+#define S3BCI_H
 
 
 /* BCI Control Register */
@@ -140,5 +140,4 @@
 	((yp) ? 1<<15 : 0) | \
 	((err) << 16))
 
-
-#endif /* _S3BCI_H_ */
+#endif /* S3BCI_H */
diff --git a/src/savage_common.h b/src/savage_common.h
index 9dbd3cb..9664304 100644
--- a/src/savage_common.h
+++ b/src/savage_common.h
@@ -23,8 +23,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef __SAVAGE_COMMON_H__
-#define __SAVAGE_COMMON_H__
+#ifndef SAVAGE_COMMON_H
+#define SAVAGE_COMMON_H
 
 #include <inttypes.h>
 
@@ -174,4 +174,4 @@ union drmSAVAGECmdHeader {
 	} clear1; /* SAVAGE_CMD_CLEAR data */
 };
 
-#endif /* __SAVAGE_COMMON_H__ */
+#endif /* SAVAGE_COMMON_H */
diff --git a/src/savage_dri.h b/src/savage_dri.h
index 214d985..36377c9 100644
--- a/src/savage_dri.h
+++ b/src/savage_dri.h
@@ -23,8 +23,8 @@
  */
 
 
-#ifndef __SAVAGE_DRI_H__
-#define __SAVAGE_DRI_H__
+#ifndef SAVAGE_DRI_H
+#define SAVAGE_DRI_H
 
 #include "drm.h"
 
@@ -73,4 +73,4 @@ typedef struct {
    drm_handle_t xvmcSurfHandle; /* ? */
 } SAVAGEDRIRec, *SAVAGEDRIPtr;
 
-#endif
+#endif /* SAVAGE_DRI_H */
diff --git a/src/savage_dripriv.h b/src/savage_dripriv.h
index 19e4487..4206a9f 100644
--- a/src/savage_dripriv.h
+++ b/src/savage_dripriv.h
@@ -22,8 +22,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef __SAVAGE_DRIPRIV_H__
-#define __SAVAGE_DRIPRIV_H__
+#ifndef SAVAGE_DRIPRIV_H
+#define SAVAGE_DRIPRIV_H
 
 #include "GL/glxint.h"
 
@@ -43,4 +43,4 @@ typedef struct {
   int dummy;
 } SAVAGEDRIContextRec, *SAVAGEDRIContextPtr;
 
-#endif
+#endif /* SAVAGE_DRIPRIV_H */
diff --git a/src/savage_drm.h b/src/savage_drm.h
index 62bd49b..7d624b5 100644
--- a/src/savage_drm.h
+++ b/src/savage_drm.h
@@ -22,11 +22,11 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef __SAVAGE_DRM_H__
-#define __SAVAGE_DRM_H__
+#ifndef SAVAGE_DRM_H
+#define SAVAGE_DRM_H
 
-#ifndef __SAVAGE_SAREA_DEFINES__
-#define __SAVAGE_SAREA_DEFINES__
+#ifndef SAVAGE_SAREA_DEFINES
+#define SAVAGE_SAREA_DEFINES
 
 #define DRM_SAVAGE_MEM_PAGE (1UL<<12)
 #define DRM_SAVAGE_MEM_WORK 32
@@ -96,7 +96,7 @@ typedef struct drm_savage_get_physcis_address
 #define SAVAGE_NR_TEX_REGIONS		16   /* num. of global texture manage list element*/
 #define SAVAGE_LOG_MIN_TEX_REGION_SIZE	16   /* each region 64K, Jiayo Hsu */
 
-#endif /* __SAVAGE_SAREA_DEFINES__ */
+#endif /* SAVAGE_SAREA_DEFINES */
 
 /* drm_tex_region_t define in drm.h */
 
@@ -245,4 +245,4 @@ typedef struct _drm_savage_blit {
 	int source_pitch, dest_pitch;
 } drm_savage_blit_t;
 
-#endif
+#endif /* SAVAGE_DRM_H */
diff --git a/src/savage_regs.h b/src/savage_regs.h
index 26cc2da..1a71c4e 100644
--- a/src/savage_regs.h
+++ b/src/savage_regs.h
@@ -1,6 +1,6 @@
 
-#ifndef _SAVAGE_REGS_H
-#define _SAVAGE_REGS_H
+#ifndef SAVAGE_REGS_H
+#define SAVAGE_REGS_H
 
 /* Copied and renamed from radeon_reg.h for AGP/PCI detection. */
 #define SAVAGE_STATUS_PCI_CONFIG            0x06
@@ -285,4 +285,4 @@ do {                                            \
 #define EC1_CENTER_ON	0x10
 #define EC1_EXPAND_ON	0x0c
 
-#endif /* _SAVAGE_REGS_H */
+#endif /* SAVAGE_REGS_H */
diff --git a/src/savage_sarea.h b/src/savage_sarea.h
index 1debc6d..e2ea3e5 100644
--- a/src/savage_sarea.h
+++ b/src/savage_sarea.h
@@ -23,11 +23,11 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef __SAVAGE_SAREA_H__
-#define __SAVAGE_SAREA_H__
+#ifndef SAVAGE_SAREA_H
+#define SAVAGE_SAREA_H
 
-#ifndef __SAVAGE_SAREA_DEFINES__
-#define __SAVAGE_SAREA_DEFINES__
+#ifndef SAVAGE_SAREA_DEFINES
+#define SAVAGE_SAREA_DEFINES
 
 /* 2 heaps (1 for card, 1 for agp), each divided into upto 128
  * regions, subject to a minimum region size of (1<<16) == 64k.
@@ -42,7 +42,7 @@
 #define SAVAGE_NR_TEX_REGIONS		16
 #define SAVAGE_LOG_MIN_TEX_REGION_SIZE	16
 
-#endif /* __SAVAGE_SAREA_DEFINES__ */


Reply to: