summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am4
-rw-r--r--src/mga_dri.c6
-rw-r--r--src/mga_driver.c15
-rw-r--r--src/mga_storm.c22
4 files changed, 25 insertions, 22 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 79745d1..8227c05 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -55,6 +55,7 @@ mga_drv_la_SOURCES = \
mga_ucode.h \
mga_vga.c \
mga_video.c \
+ mga_storm.c \
compat-api.h
if DRI
@@ -71,6 +72,5 @@ endif
if XAA
mga_drv_la_SOURCES += \
- mga_arc.c \
- mga_storm.c
+ mga_arc.c
endif
diff --git a/src/mga_dri.c b/src/mga_dri.c
index 0154671..3923c04 100644
--- a/src/mga_dri.c
+++ b/src/mga_dri.c
@@ -922,13 +922,11 @@ static void MGADRIInitBuffersXAA(WindowPtr pWin, RegionPtr prgn,
}
#endif
-#ifdef USE_EXA
static void MGADRIInitBuffersEXA(WindowPtr pWin, RegionPtr prgn,
CARD32 index)
{
/* FIXME */
}
-#endif
#ifdef USE_XAA
/*
@@ -1078,13 +1076,11 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg,
}
#endif
-#ifdef USE_EXA
static void MGADRIMoveBuffersEXA(WindowPtr pParent, DDXPointRec ptOldOrg,
RegionPtr prgnSrc, CARD32 index)
{
/* FIXME */
}
-#endif
Bool MGADRIScreenInit( ScreenPtr pScreen )
{
@@ -1231,6 +1227,8 @@ Bool MGADRIScreenInit( ScreenPtr pScreen )
pDRIInfo->SwapContext = MGADRISwapContext;
}
+ pDRIInfo->InitBuffers = MGADRIInitBuffersEXA;
+ pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA;
#ifdef USE_EXA
if (pMga->Exa) {
pDRIInfo->InitBuffers = MGADRIInitBuffersEXA;
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 3db3a74..8c4bb9c 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -3398,11 +3398,7 @@ MGAScreenInit(SCREEN_INIT_ARGS_DECL)
mgaExaInit(pScreen);
else
#endif
-#ifdef XAA
MGAStormAccelInit(pScreen);
-#else
- ;
-#endif
}
xf86SetBackingStore(pScreen);
@@ -4184,14 +4180,3 @@ MGAG100BlackMagic(ScrnInfoPtr pScrn)
OUTREG(MGAREG_MACCESS, 1<<15);
usleep(10);
}
-
-#ifndef HAVE_XAA_H
-void MGAStormEngineInit( ScrnInfoPtr pScrn )
-{
-}
-
-void
-MGAStormSync(ScrnInfoPtr pScrn)
-{
-}
-#endif
diff --git a/src/mga_storm.c b/src/mga_storm.c
index c32caf4..fb0e7be 100644
--- a/src/mga_storm.c
+++ b/src/mga_storm.c
@@ -15,8 +15,10 @@
#include "xf86Pci.h"
/* Drivers that use XAA need this */
+#ifdef HAVE_XAA_H
#include "xaa.h"
#include "xaalocal.h"
+#endif
#include "xf86fbman.h"
#include "miline.h"
#include "servermd.h"
@@ -59,6 +61,7 @@ do { \
XAAMoveDWORDS((d),(s),(c)); \
} while (0)
+#ifdef HAVE_XAA_H
static void mgaSetupForSolidFill( ScrnInfoPtr pScrn, int color,
int rop, unsigned int planemask );
@@ -569,10 +572,13 @@ MGASubsequentCPUToScreenTexture (
#endif /* defined(RENDER) */
+#endif
Bool mgaAccelInit( ScreenPtr pScreen )
{
+#ifdef HAVE_XAA_H
XAAInfoRecPtr infoPtr;
+#endif
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
MGAPtr pMga = MGAPTR(pScrn);
int maxFastBlitMem, maxlines;
@@ -583,8 +589,10 @@ Bool mgaAccelInit( ScreenPtr pScreen )
pMga->ScratchBuffer = malloc(((pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel) + 127) >> 3);
if(!pMga->ScratchBuffer) return FALSE;
+#ifdef HAVE_XAA_H
pMga->AccelInfoRec = infoPtr = XAACreateInfoRec();
if(!infoPtr) return FALSE;
+#endif
pMga->RenderTime = 0;
pMga->LinearScratch = 0;
@@ -617,6 +625,7 @@ Bool mgaAccelInit( ScreenPtr pScreen )
pMga->AtypeNoBLK = MGAAtypeNoBLK;
}
+#ifdef HAVE_XAA_H
/* fill out infoPtr here */
infoPtr->Flags = PIXMAP_CACHE |
OFFSCREEN_PIXMAPS |
@@ -782,6 +791,8 @@ Bool mgaAccelInit( ScreenPtr pScreen )
pMga->MaxFastBlitY = maxFastBlitMem / (pScrn->displayWidth * pMga->CurrentLayout.bitsPerPixel / 8);
}
+#endif
+
switch (pMga->Chipset) {
case PCI_CHIP_MGAG200_SE_A_PCI:
case PCI_CHIP_MGAG200_SE_B_PCI:
@@ -917,6 +928,7 @@ Bool mgaAccelInit( ScreenPtr pScreen )
}
+#ifdef HAVE_XAA_H
for (i = 0; i < pScrn->numEntities; i++) {
if (xf86IsEntityShared(pScrn->entityList[i])) {
infoPtr->RestoreAccelState = mgaRestoreAccelState;
@@ -949,9 +961,13 @@ Bool mgaAccelInit( ScreenPtr pScreen )
#endif /* defined(RENDER) */
return(XAAInit(pScreen, infoPtr));
+#else
+ return TRUE;
+#endif
}
+#ifdef HAVE_XAA_H
/* Support for multiscreen */
static void mgaRestoreAccelState(ScrnInfoPtr pScrn)
{
@@ -994,7 +1010,7 @@ static void mgaRestoreAccelState(ScrnInfoPtr pScrn)
OUTREG(MGAREG_YBOT, 0x007FFFFF); /* maxPixelPointer */
pMga->AccelFlags &= ~CLIPPER_ON;
}
-
+#endif
CARD32 MGAAtype[16] = {
MGADWG_RPL | 0x00000000, MGADWG_RSTR | 0x00080000,
@@ -1080,9 +1096,11 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn )
opmode &= ~0x30000;
#endif
+#ifdef HAVE_XAA_H
pMga->SetupForSolidFill = mgaSetupForSolidFill;
pMga->SubsequentSolidFillRect = mgaSubsequentSolidFillRect;
pMga->RestoreAccelState = mgaRestoreAccelState;
+#endif
pMga->fifoCount = 0;
@@ -1155,6 +1173,7 @@ void MGAStormEngineInit( ScrnInfoPtr pScrn )
}
+#ifdef HAVE_XAA_H
static void
MGASetClippingRectangle(
ScrnInfoPtr pScrn,
@@ -2534,3 +2553,4 @@ MGAFillCacheBltRects(
SET_SYNC_FLAG(infoRec);
}
+#endif