diff options
-rw-r--r-- | src/atiaccel.c | 47 | ||||
-rw-r--r-- | src/atiaccel.h | 2 | ||||
-rw-r--r-- | src/atimach64xv.c | 52 |
3 files changed, 51 insertions, 50 deletions
diff --git a/src/atiaccel.c b/src/atiaccel.c index 11c39c79..a1f09aaa 100644 --- a/src/atiaccel.c +++ b/src/atiaccel.c @@ -63,51 +63,4 @@ 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; -} #endif /* USE_XAA */ diff --git a/src/atiaccel.h b/src/atiaccel.h index d31335b1..44861236 100644 --- a/src/atiaccel.h +++ b/src/atiaccel.h @@ -30,6 +30,4 @@ extern Bool ATIInitializeAcceleration(ScreenPtr, ScrnInfoPtr, ATIPtr); -extern FBLinearPtr ATIResizeOffscreenLinear(ScreenPtr, FBLinearPtr, int); - #endif /* ___ATIACCEL_H___ */ diff --git a/src/atimach64xv.c b/src/atimach64xv.c index 444cb53a..83846856 100644 --- a/src/atimach64xv.c +++ b/src/atimach64xv.c @@ -27,7 +27,6 @@ #include <string.h> #include "ati.h" -#include "atiaccel.h" #include "atichip.h" #include "atimach64accel.h" #include "atimach64io.h" @@ -1522,6 +1521,57 @@ ATIMach64CloseXVideo REGION_UNINIT(pScreen, &pATI->VideoClip); } +/* Functions for offscreen memory management */ + +#ifdef USE_XAA +static 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; +} +#endif /* USE_XAA */ + static pointer ATIMach64XVMemAlloc ( |