diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-11-30 13:17:52 +0100 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-11-30 08:37:06 -0800 |
commit | 8754db77d8169e5ea506a963cebee1a651bcf094 (patch) | |
tree | 7c718389044958c81b8f0f076954876be88bc85a /exa/exa_offscreen.c | |
parent | 0e555a1033e5deed1db8582ca075455a6a2d4228 (diff) |
EXA: Don't defragment offscreen memory at allocation time.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 .
Offscreen memory allocation can occur from various places, and apparently
doing defragmentation from at least some of them can confuse some driver
acceleration code.
There's still the regular background defragmentation in the WakeupHandler,
which should manage to keep fragmentation at a reasonable level.
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'exa/exa_offscreen.c')
-rw-r--r-- | exa/exa_offscreen.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c index acdf439f1..e3a9ab2f6 100644 --- a/exa/exa_offscreen.c +++ b/exa/exa_offscreen.c @@ -169,7 +169,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align, { ExaOffscreenArea *area; ExaScreenPriv (pScreen); - int real_size = 0, free_total = 0, largest_avail = 0; + int real_size = 0, largest_avail = 0; #if DEBUG_OFFSCREEN static int number = 0; ErrorF("================= ============ allocating a new pixmap %d\n", ++number); @@ -208,33 +208,10 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align, if (real_size <= area->size) break; - free_total += area->size; - if (area->size > largest_avail) largest_avail = area->size; } - if (!area && free_total >= size) { - CARD32 now = GetTimeInMillis(); - - /* Don't defragment more than once per second, to avoid adding more - * overhead than we're trying to prevent - */ - if (abs((INT32) (now - pExaScr->lastDefragment)) > 1000) { - area = ExaOffscreenDefragment(pScreen); - pExaScr->lastDefragment = now; - - if (area) { - /* adjust size to match alignment requirement */ - real_size = size + (area->base_offset + area->size - size) % align; - - /* does it fit? */ - if (real_size > area->size) - area = NULL; - } - } - } - if (!area) { area = exaFindAreaToEvict(pExaScr, size, align); |