diff options
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 70b7e35..626cb34 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; +} |