summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fufutos <fufutos610@hotmail.com>2006-04-18 00:18:39 +0300
committerLuc Verhaegen <libv@skynet.be>2006-04-18 00:04:04 +0200
commit01ccfe2d302e5a63adc2ede998fe83829852e259 (patch)
tree7c065593d8c422a555667a1f788b1adf787b0700
parent146348d0b4a40b27b18c27912b07c7a40f3aa269 (diff)
Consolidate ATIInitializeAcceleration() with ATIMach64AccelInit().
-rw-r--r--src/Makefile.am3
-rw-r--r--src/atiaccel.c64
-rw-r--r--src/atiaccel.h34
-rw-r--r--src/atimach64accel.c40
-rw-r--r--src/atimach64accel.h2
-rw-r--r--src/atiscreen.c39
6 files changed, 50 insertions, 132 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c739559..c834eda 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,7 @@ mach64_drv_la_LTLIBRARIES = mach64_drv.la
mach64_drv_la_LDFLAGS = -module -avoid-version
mach64_drv_ladir = @moduledir@/drivers
mach64_drv_la_SOURCES = \
- atioption.c atividmem.c atiaccel.c atiadjust.c \
+ atioption.c atividmem.c atiadjust.c \
atiaudio.c aticlock.c aticonfig.c aticonsole.c aticursor.c atidac.c \
atidecoder.c atidsp.c atii2c.c atilock.c atimach64.c atimach64accel.c \
atimach64cursor.c atimach64i2c.c atimach64io.c atimach64xv.c \
@@ -58,7 +58,6 @@ mach64_drv_la_SOURCES = \
$(ATIMISC_EXA_SOURCES)
EXTRA_DIST = \
- atiaccel.h \
atiadjust.h \
atiaudio.h \
atibank.h \
diff --git a/src/atiaccel.c b/src/atiaccel.c
deleted file mode 100644
index 4e16464..0000000
--- a/src/atiaccel.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.13 2003/04/24 21:19:22 tsi Exp $ */
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- * DRI support by:
- * Leif Delgass <ldelgass@retinalburn.net>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "atiaccel.h"
-#include "atimach64accel.h"
-#include "atistruct.h"
-
-#ifdef USE_XAA
-/*
- * ATIInitializeAcceleration --
- *
- * This function is called to initialise both the framebuffer manager and XAA
- * on a screen.
- */
-Bool
-ATIInitializeAcceleration
-(
- ScreenPtr pScreen,
- ScrnInfoPtr pScreenInfo,
- ATIPtr pATI
-)
-{
- if (pATI->OptionAccel) {
- if (!(pATI->pXAAInfo = XAACreateInfoRec()))
- return FALSE;
-
- ATIMach64AccelInit(pATI, pATI->pXAAInfo);
- }
-
- if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
- return TRUE;
-
- XAADestroyInfoRec(pATI->pXAAInfo);
- pATI->pXAAInfo = NULL;
- return FALSE;
-}
-#endif /* USE_XAA */
diff --git a/src/atiaccel.h b/src/atiaccel.h
deleted file mode 100644
index 9d598bf..0000000
--- a/src/atiaccel.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.5 2003/04/23 21:51:27 tsi Exp $ */
-/*
- * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of Marc Aurele La France not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Marc Aurele La France makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as-is" without express or implied warranty.
- *
- * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
- * EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef ___ATIACCEL_H___
-#define ___ATIACCEL_H___ 1
-
-#include "atipriv.h"
-
-#include "xf86str.h"
-#include "xf86fbman.h"
-
-extern Bool ATIInitializeAcceleration(ScreenPtr, ScrnInfoPtr, ATIPtr);
-
-#endif /* ___ATIACCEL_H___ */
diff --git a/src/atimach64accel.c b/src/atimach64accel.c
index f567358..dead1a1 100644
--- a/src/atimach64accel.c
+++ b/src/atimach64accel.c
@@ -911,13 +911,19 @@ ATIMach64SubsequentColorExpandScanline
* This function fills in structure fields needed for acceleration on Mach64
* variants.
*/
-int
-ATIMach64AccelInit
-(
- ATIPtr pATI,
- XAAInfoRecPtr pXAAInfo
-)
+Bool
+ATIMach64AccelInit(ScreenPtr pScreen)
{
+ ScrnInfoPtr pScreenInfo = xf86Screens[pScreen->myNum];
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+ XAAInfoRecPtr pXAAInfo;
+
+ pXAAInfo = XAACreateInfoRec();
+ if (!pXAAInfo)
+ return FALSE;
+
+ pATI->pXAAInfo = pXAAInfo;
+
/* This doesn't seem quite right... */
if (pATI->XModifier == 1)
{
@@ -989,15 +995,21 @@ ATIMach64AccelInit
ATIMach64SubsequentColorExpandScanline;
/* The engine does not support the following primitives for 24bpp */
- if (pATI->XModifier != 1)
- return ATIMach64MaxY;
+ if (pATI->XModifier == 1) {
- /* Solid lines */
- pXAAInfo->SetupForSolidLine = ATIMach64SetupForSolidLine;
- pXAAInfo->SubsequentSolidHorVertLine = ATIMach64SubsequentSolidHorVertLine;
- pXAAInfo->SubsequentSolidBresenhamLine =
- ATIMach64SubsequentSolidBresenhamLine;
+ /* Solid lines */
+ pXAAInfo->SetupForSolidLine = ATIMach64SetupForSolidLine;
+ pXAAInfo->SubsequentSolidHorVertLine = ATIMach64SubsequentSolidHorVertLine;
+ pXAAInfo->SubsequentSolidBresenhamLine =
+ ATIMach64SubsequentSolidBresenhamLine;
+ }
+
+ if (!XAAInit(pScreen, pATI->pXAAInfo)) {
+ XAADestroyInfoRec(pATI->pXAAInfo);
+ pATI->pXAAInfo = NULL;
+ return FALSE;
+ }
- return ATIMach64MaxY;
+ return TRUE;
}
#endif /* USE_XAA */
diff --git a/src/atimach64accel.h b/src/atimach64accel.h
index 2917b7a..7cfcdaa 100644
--- a/src/atimach64accel.h
+++ b/src/atimach64accel.h
@@ -36,7 +36,7 @@
extern Bool ATIMach64ExaInit(ScreenPtr);
#endif
#ifdef USE_XAA
-extern int ATIMach64AccelInit(ATIPtr, XAAInfoRecPtr);
+extern Bool ATIMach64AccelInit(ScreenPtr);
#endif
extern void ATIMach64Sync(ScrnInfoPtr);
diff --git a/src/atiscreen.c b/src/atiscreen.c
index d4489e3..e6b4cf0 100644
--- a/src/atiscreen.c
+++ b/src/atiscreen.c
@@ -34,7 +34,6 @@
#include <string.h>
#include "atichip.h"
-#include "atiaccel.h"
#include "aticonsole.h"
#include "aticursor.h"
#include "atidac.h"
@@ -536,33 +535,39 @@ ATIScreenInit
#ifdef USE_XAA
- /* Memory manager setup */
+ if (!pATI->useEXA) {
+
+ /* Memory manager setup */
#ifdef XF86DRI_DEVEL
- if (pATI->directRenderingEnabled)
- {
- if (!pATI->useEXA && !ATIMach64SetupMemXAA(iScreen, pScreen))
- return FALSE;
- } else
+ if (pATI->directRenderingEnabled)
+ {
+ if (!ATIMach64SetupMemXAA(iScreen, pScreen))
+ return FALSE;
+ } else
#endif /* XF86DRI_DEVEL */
- {
- if (!pATI->useEXA && !ATIMach64SetupMemXAA_NoDRI(iScreen, pScreen))
+ {
+ if (!ATIMach64SetupMemXAA_NoDRI(iScreen, pScreen))
+ return FALSE;
+ }
+
+ /* Setup acceleration */
+
+ if (pATI->OptionAccel && !ATIMach64AccelInit(pScreen))
return FALSE;
}
- /* Setup acceleration */
-
- if (!pATI->useEXA && !ATIInitializeAcceleration(pScreen, pScreenInfo, pATI))
- return FALSE;
-
#endif /* USE_XAA */
#ifdef USE_EXA
- /* EXA initializes both memory manager and acceleration here */
+ if (pATI->useEXA) {
- if (pATI->useEXA && !ATIMach64ExaInit(pScreen))
- return FALSE;
+ /* EXA setups both memory manager and acceleration here */
+
+ if (pATI->OptionAccel && !ATIMach64ExaInit(pScreen))
+ return FALSE;
+ }
#endif /* USE_EXA */