diff options
author | George Sapountzis <gsap7@yahoo.gr> | 2006-10-28 19:29:12 +0300 |
---|---|---|
committer | George Sapountzis <gsap7@yahoo.gr> | 2007-02-05 19:31:52 +0200 |
commit | bc3b222b57d7edf7bdce00a53e8abd9047c314a4 (patch) | |
tree | 7e75c6099ced5b9f46856042b37b8e1e22d394ba /src/atimach64xv.c | |
parent | d876889add41c8052d4f3feaa21ddf384f5a7054 (diff) |
Consolidate atiaccel.c w/ atimach64accel.c, part 1.
Move ATIResizeOffscreenLinear() from atiaccel.c to atimach64xv.c and make it
static. It is only used by XV memory management functions.
Diffstat (limited to 'src/atimach64xv.c')
-rw-r--r-- | src/atimach64xv.c | 52 |
1 files changed, 51 insertions, 1 deletions
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 ( |