diff options
author | marha <marha@users.sourceforge.net> | 2009-12-02 19:35:37 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-12-02 19:35:37 +0000 |
commit | 8f2c5e2f41f211bed814be2889da16fc43e6f147 (patch) | |
tree | e1f2715f63544d39302d6daa2cb0d4f53d295ebc /xorg-server/exa/exa_offscreen.c | |
parent | b404fe88bb87f42267cab4682b81f38cc442e617 (diff) | |
parent | 314d225f3a60cc0ea63c292a2c2ffe3609e7c739 (diff) | |
download | vcxsrv-8f2c5e2f41f211bed814be2889da16fc43e6f147.tar.gz vcxsrv-8f2c5e2f41f211bed814be2889da16fc43e6f147.tar.bz2 vcxsrv-8f2c5e2f41f211bed814be2889da16fc43e6f147.zip |
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/exa/exa_offscreen.c')
-rw-r--r-- | xorg-server/exa/exa_offscreen.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/xorg-server/exa/exa_offscreen.c b/xorg-server/exa/exa_offscreen.c index eb53b2a30..e3a9ab2f6 100644 --- a/xorg-server/exa/exa_offscreen.c +++ b/xorg-server/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); @@ -522,7 +499,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen) return NULL; pExaDstPix = ExaGetPixmapPriv (pDstPix); - pExaDstPix->offscreen = TRUE; + pExaDstPix->use_gpu_copy = TRUE; for (area = pExaScr->info->offScreenAreas->prev; area != pExaScr->info->offScreenAreas; @@ -531,7 +508,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen) ExaOffscreenArea *prev = area->prev; PixmapPtr pSrcPix; ExaPixmapPrivPtr pExaSrcPix; - Bool save_offscreen; + Bool save_use_gpu_copy; int save_pitch; if (area->state != ExaOffscreenAvail || @@ -576,10 +553,10 @@ ExaOffscreenDefragment (ScreenPtr pScreen) continue; } - save_offscreen = pExaSrcPix->offscreen; + save_use_gpu_copy = pExaSrcPix->use_gpu_copy; save_pitch = pSrcPix->devKind; - pExaSrcPix->offscreen = TRUE; + pExaSrcPix->use_gpu_copy = TRUE; pSrcPix->devKind = pExaSrcPix->fb_pitch; pDstPix->drawable.width = pSrcPix->drawable.width; @@ -589,7 +566,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen) pDstPix->drawable.bitsPerPixel = pSrcPix->drawable.bitsPerPixel; if (!pExaScr->info->PrepareCopy (pSrcPix, pDstPix, -1, -1, GXcopy, ~0)) { - pExaSrcPix->offscreen = save_offscreen; + pExaSrcPix->use_gpu_copy = save_use_gpu_copy; pSrcPix->devKind = save_pitch; area = prev; continue; @@ -646,7 +623,7 @@ ExaOffscreenDefragment (ScreenPtr pScreen) #endif pExaSrcPix->fb_ptr = pExaDstPix->fb_ptr; - pExaSrcPix->offscreen = save_offscreen; + pExaSrcPix->use_gpu_copy = save_use_gpu_copy; pSrcPix->devKind = save_pitch; } |