From 8754db77d8169e5ea506a963cebee1a651bcf094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 30 Nov 2009 13:17:52 +0100 Subject: [PATCH] EXA: Don't defragment offscreen memory at allocation time. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Keith Packard --- exa/exa_offscreen.c | 25 +------------------------ 1 file changed, 1 insertion(+), 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);