aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/exa/exa_offscreen.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-02 17:33:15 +0000
committermarha <marha@users.sourceforge.net>2009-12-02 17:33:15 +0000
commit314d225f3a60cc0ea63c292a2c2ffe3609e7c739 (patch)
tree181562a86ee74db9182bd9b60d258d3fed6642ee /xorg-server/exa/exa_offscreen.c
parent4ac4a5b7ce8cc8f195d69a42da10d386eaa5c056 (diff)
downloadvcxsrv-314d225f3a60cc0ea63c292a2c2ffe3609e7c739.tar.gz
vcxsrv-314d225f3a60cc0ea63c292a2c2ffe3609e7c739.tar.bz2
vcxsrv-314d225f3a60cc0ea63c292a2c2ffe3609e7c739.zip
Xserver git update
Diffstat (limited to 'xorg-server/exa/exa_offscreen.c')
-rw-r--r--xorg-server/exa/exa_offscreen.c37
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;
}