summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Fufutos <fufutos610@hotmail.com>2006-04-17 23:28:22 +0300
committerLuc Verhaegen <libv@skynet.be>2006-04-18 00:04:04 +0200
commit146348d0b4a40b27b18c27912b07c7a40f3aa269 (patch)
treef78da8207b8912ba5058e70d22a6385b7c2cc16c
parent7ded5ee34bca34174d0beb9236df976d04336afb (diff)
Move memory manager setup for XAA with no DRI from atiaccel.c to atiscreen.c
along with memory manager setup for XAA with DRI.
-rw-r--r--src/atiaccel.c29
-rw-r--r--src/atiscreen.c51
2 files changed, 47 insertions, 33 deletions
diff --git a/src/atiaccel.c b/src/atiaccel.c
index 1ba7ceb..4e16464 100644
--- a/src/atiaccel.c
+++ b/src/atiaccel.c
@@ -47,38 +47,11 @@ ATIInitializeAcceleration
ATIPtr pATI
)
{
- int maxScanlines = 32767, maxPixelArea, PixelArea;
-
if (pATI->OptionAccel) {
if (!(pATI->pXAAInfo = XAACreateInfoRec()))
return FALSE;
- maxScanlines = ATIMach64AccelInit(pATI, pATI->pXAAInfo);
- }
-
-#ifndef AVOID_CPIO
-
- if (!pATI->BankInfo.BankSize)
-
-#endif /* AVOID_CPIO */
-
-#ifdef XF86DRI_DEVEL
-
- /* If DRI is enabled, we've already set up the FB manager in ATIScreenInit */
- if (!pATI->directRenderingEnabled)
-
-#endif /* XF86DRI_DEVEL */
- {
- /*
- * Note: If PixelArea exceeds the engine's maximum, the excess is
- * never used, even though it would be useful for such things
- * as XVideo buffers.
- */
- maxPixelArea = maxScanlines * pScreenInfo->displayWidth;
- PixelArea = pScreenInfo->videoRam * 1024 * 8 / pATI->bitsPerPixel;
- if (PixelArea > maxPixelArea)
- PixelArea = maxPixelArea;
- xf86InitFBManagerArea(pScreen, PixelArea, 2);
+ ATIMach64AccelInit(pATI, pATI->pXAAInfo);
}
if (!pATI->OptionAccel || XAAInit(pScreen, pATI->pXAAInfo))
diff --git a/src/atiscreen.c b/src/atiscreen.c
index 0ad7555..d4489e3 100644
--- a/src/atiscreen.c
+++ b/src/atiscreen.c
@@ -123,6 +123,47 @@ ATIMinBits
}
#ifdef USE_XAA
+static Bool
+ATIMach64SetupMemXAA_NoDRI
+(
+ int iScreen,
+ ScreenPtr pScreen
+)
+{
+ ScrnInfoPtr pScreenInfo = xf86Screens[iScreen];
+ ATIPtr pATI = ATIPTR(pScreenInfo);
+
+ int maxScanlines = ATIMach64MaxY;
+ int maxPixelArea, PixelArea;
+
+#ifndef AVOID_CPIO
+
+ if (!pATI->BankInfo.BankSize)
+
+#endif /* AVOID_CPIO */
+
+#ifdef XF86DRI_DEVEL
+
+ /* If DRI is enabled, we've already set up the FB manager in ATIScreenInit */
+ if (!pATI->directRenderingEnabled)
+
+#endif /* XF86DRI_DEVEL */
+ {
+ /*
+ * Note: If PixelArea exceeds the engine's maximum, the excess is
+ * never used, even though it would be useful for such things
+ * as XVideo buffers.
+ */
+ maxPixelArea = maxScanlines * pScreenInfo->displayWidth;
+ PixelArea = pScreenInfo->videoRam * 1024 * 8 / pATI->bitsPerPixel;
+ if (PixelArea > maxPixelArea)
+ PixelArea = maxPixelArea;
+ xf86InitFBManagerArea(pScreen, PixelArea, 2);
+ }
+
+ return TRUE;
+}
+
#ifdef XF86DRI_DEVEL
/*
* Memory layour for XAA with DRI (no local_textures):
@@ -498,19 +539,19 @@ ATIScreenInit
/* Memory manager setup */
#ifdef XF86DRI_DEVEL
-
if (pATI->directRenderingEnabled)
{
if (!pATI->useEXA && !ATIMach64SetupMemXAA(iScreen, pScreen))
return FALSE;
- }
-
+ } else
#endif /* XF86DRI_DEVEL */
+ {
+ if (!pATI->useEXA && !ATIMach64SetupMemXAA_NoDRI(iScreen, pScreen))
+ return FALSE;
+ }
/* Setup acceleration */
- /* If direct rendering is not enabled, the framebuffer memory
- * manager is initialized by this function call */
if (!pATI->useEXA && !ATIInitializeAcceleration(pScreen, pScreenInfo, pATI))
return FALSE;