Change EXA so that exaMoveOutPixmap() retains the framebuffer copy of the

pixmap, and damage is tracked so that a later exaMoveInPixmap won't
    result in an upload if no upload is necessary. This will likely improve
    the performance of the "Always" migration scheme significantly, and is
    a step in the path to more exact damage tracking between framebuffer
    and system memory.
This commit is contained in:
Eric Anholt 2006-03-16 18:43:55 +00:00
commit 14aafc258c
4 changed files with 276 additions and 167 deletions

View file

@ -86,7 +86,7 @@ exaGetPixmapSize(PixmapPtr pPix)
pExaPixmap = ExaGetPixmapPriv(pPix);
if (pExaPixmap != NULL)
return pExaPixmap->size;
return pExaPixmap->fb_size;
return 0;
}
@ -139,13 +139,25 @@ exaDestroyPixmap (PixmapPtr pPixmap)
pPixmap->drawable.height));
/* Free the offscreen area */
exaOffscreenFree (pPixmap->drawable.pScreen, pExaPixmap->area);
pPixmap->devPrivate = pExaPixmap->devPrivate;
pPixmap->devKind = pExaPixmap->devKind;
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
}
return fbDestroyPixmap (pPixmap);
}
static int
exaLog2(int val)
{
int bits;
if (!val)
return 0;
for (bits = 0; val != 0; bits++)
val >>= 1;
return bits - 1;
}
/**
* exaCreatePixmap() creates a new pixmap.
*
@ -170,6 +182,8 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
return NULL;
pExaPixmap = ExaGetPixmapPriv(pPixmap);
bpp = pPixmap->drawable.bitsPerPixel;
/* Glyphs have w/h equal to zero, and may not be migrated. See exaGlyphs. */
if (!w || !h)
pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
@ -177,6 +191,24 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
pExaPixmap->score = EXA_PIXMAP_SCORE_INIT;
pExaPixmap->area = NULL;
pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
pExaPixmap->sys_pitch = pPixmap->devKind;
pExaPixmap->fb_ptr = NULL;
if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
else
pExaPixmap->fb_pitch = w * bpp / 8;
pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
pExaScr->info->pixmapPitchAlign);
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
if (pExaPixmap->fb_pitch > 32767) {
fbDestroyPixmap(pPixmap);
return NULL;
}
pExaPixmap->dirty = FALSE;
return pPixmap;