diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:36 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:36 +0000 |
commit | 73105e438e90f950249cb265ba99001d4db3dc60 (patch) | |
tree | add0e49232de50548191a4243ed0d32cc91d1ec5 /src/atiaccel.c | |
parent | 0a53864f9581196604d04fd28b4e94a9b0b73d18 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'src/atiaccel.c')
-rw-r--r-- | src/atiaccel.c | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/src/atiaccel.c b/src/atiaccel.c index 70b7e355..626cb34e 100644 --- a/src/atiaccel.c +++ b/src/atiaccel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.11 2003/01/01 19:16:30 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.13 2003/04/24 21:19:22 tsi Exp $ */ /* * Copyright 2001 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -23,7 +23,7 @@ #include "atiaccel.h" #include "atiadapter.h" -#include "atimach64.h" +#include "atimach64accel.h" #include "atistruct.h" /* @@ -65,6 +65,11 @@ ATIInitializeAcceleration #endif /* AVOID_CPIO */ { + /* + * 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) @@ -79,3 +84,50 @@ ATIInitializeAcceleration pATI->pXAAInfo = NULL; return FALSE; } + +FBLinearPtr +ATIResizeOffscreenLinear +( + ScreenPtr pScreen, + FBLinearPtr pLinear, + int Size +) +{ + if (Size <= 0) + { + xf86FreeOffscreenLinear(pLinear); + return NULL; + } + + if (pLinear) + { + if ((pLinear->size >= Size) || + xf86ResizeOffscreenLinear(pLinear, Size)) + { + pLinear->MoveLinearCallback = NULL; + pLinear->RemoveLinearCallback = NULL; + return pLinear; + } + + xf86FreeOffscreenLinear(pLinear); + } + + pLinear = xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL); + + if (!pLinear) + { + int maxSize; + + xf86QueryLargestOffscreenLinear(pScreen, &maxSize, 16, + PRIORITY_EXTREME); + + if (maxSize < Size) + return NULL; + + xf86PurgeUnlockedOffscreenAreas(pScreen); + pLinear = + xf86AllocateOffscreenLinear(pScreen, Size, 16, NULL, NULL, NULL); + } + + return pLinear; +} |