xserver-xorg-video-savage: Changes to 'upstream-unstable'
configure.ac | 6 -
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 +--
20 files changed, 187 insertions(+), 200 deletions(-)
New commits:
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__ */
+#endif /* SAVAGE_SAREA_DEFINES */
typedef struct {
/* LRU lists for texture memory in agp space and on the card.
@@ -55,4 +55,4 @@ typedef struct {
int ctxOwner;
} SAVAGESAREAPrivRec, *SAVAGESAREAPrivPtr;
-#endif /* __SAVAGE_SAREA_H__ */
+#endif /* SAVAGE_SAREA_H */
diff --git a/src/savage_streams.h b/src/savage_streams.h
index ad16ad7..9968a1a 100644
--- a/src/savage_streams.h
+++ b/src/savage_streams.h
@@ -1,6 +1,5 @@
-#ifndef __SAVAGE_STREAMS_H__
-
-# define __SAVAGE_STREAMS_H__
+#ifndef SAVAGE_STREAMS_H
+#define SAVAGE_STREAMS_H
/**************************************
S3 streams processor
@@ -220,4 +219,4 @@
#define SSTREAMS_MODE(bpp) (bpp > 16 ? (bpp > 24 ? STREAMS_MODE32 :\
STREAMS_MODE24) : STREAMS_MODE16)
-#endif /*__SAVAGE_STREAMS_H__*/
+#endif /* SAVAGE_STREAMS_H */
diff --git a/src/savage_vbe.h b/src/savage_vbe.h
index 9b06e0c..45d4a51 100644
--- a/src/savage_vbe.h
+++ b/src/savage_vbe.h
@@ -12,8 +12,8 @@ versions as being modified.
This software has NO WARRANTY. Use it at your own risk.
*/
-#ifndef _SAVAGEVBE_H
-#define _SAVAGEVBE_H
+#ifndef SAVAGEVBE_H
+#define SAVAGEVBE_H
/*
* Common BIOS functions
@@ -161,4 +161,4 @@ struct vbe_palette_entry
unsigned char align;
} __attribute__ ((packed));
-#endif
+#endif /* SAVAGEVBE_H */
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>
diff --git a/src/savage_dri.c b/src/savage_dri.c
index 6464ffa..52a4b7c 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -34,7 +34,6 @@
#include "xaalocal.h"
#include "xaarop.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86fbman.h"
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 0592232..447beec 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -56,6 +56,7 @@
#include "xf86xv.h"
#include "savage_driver.h"
+#include "savage_pciids.h"
#include "savage_regs.h"
#include "savage_bci.h"
#include "savage_streams.h"
diff --git a/src/savage_driver.h b/src/savage_driver.h
index 1737362..6c6dda8 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -55,7 +55,6 @@
#include "xf86Resources.h"
#endif
#include "xf86Pci.h"
-#include "xf86PciInfo.h"
#include "xf86_OSproc.h"
#include "xf86Cursor.h"
#include "mipointer.h"
diff --git a/src/savage_hwmc.c b/src/savage_hwmc.c
index 905ef87..ed881b4 100644
--- a/src/savage_hwmc.c
+++ b/src/savage_hwmc.c
@@ -29,7 +29,6 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#include "compiler.h"
-#include "xf86PciInfo.h"
#include "xf86Pci.h"
#include "xf86fbman.h"
#include "regionstr.h"
diff --git a/src/savage_i2c.c b/src/savage_i2c.c
index d8eb46b..b5739a2 100644
--- a/src/savage_i2c.c
+++ b/src/savage_i2c.c
@@ -32,11 +32,6 @@ in this Software without prior written authorization from the XFree86 Project.
#include "xf86_OSproc.h"
#include "compiler.h"
-#include "xf86Pci.h"
-#include "xf86PciInfo.h"
-
-#include "vgaHW.h"
-
#include "savage_driver.h"
static void
diff --git a/src/savage_pciids.h b/src/savage_pciids.h
new file mode 100644
index 0000000..cad5172
--- /dev/null
+++ b/src/savage_pciids.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2011 X.Org Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef SAVAGE_PCIIDS_H
+#define SAVAGE_PCIIDS_H
+
+#define PCI_CHIP_SAVAGE3D 0x8A20
+#define PCI_CHIP_SAVAGE3D_MV 0x8A21
+#define PCI_CHIP_SAVAGE4 0x8A22
+#define PCI_CHIP_PROSAVAGE_PM 0x8A25
+#define PCI_CHIP_PROSAVAGE_KM 0x8A26
Reply to: