summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-08-30 16:43:10 +0000
committerEric Anholt <anholt@freebsd.org>2004-08-30 16:43:10 +0000
commitccaf332ce3a9393715317edd3b92420c27fc94eb (patch)
tree84d12f9403084d7042c3bea4c84e6e23672bef35
parent14b2db63e7ae0c0d356062cd15811484038f97d9 (diff)
Rather than initially place pixmaps in framebuffer based on a size
heuristic, delay the decision until the first kaaPixmapUse{Screen|Memory}, and put it in framebuffer if UseScreen was called. Provides a significant improvement in cairo speeds (100% speedup in cairogears here) and is likely to improve text performance as well.
-rw-r--r--hw/kdrive/src/kaa.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c
index ea2e5c738..84b8f4b25 100644
--- a/hw/kdrive/src/kaa.c
+++ b/hw/kdrive/src/kaa.c
@@ -51,12 +51,11 @@ int kaaPixmapPrivateIndex;
#define KAA_PIXMAP_SCORE_MOVE_IN 10
#define KAA_PIXMAP_SCORE_MAX 20
-#define KAA_PIXMAP_SCORE_INIT 0
#define KAA_PIXMAP_SCORE_MOVE_OUT -10
#define KAA_PIXMAP_SCORE_MIN -20
#define KAA_PIXMAP_SCORE_PINNED 1000
+#define KAA_PIXMAP_SCORE_INIT 1001
-#define MIN_OFFPIX_SIZE (4096)
void
kaaDrawableDirty (DrawablePtr pDrawable)
{
@@ -240,6 +239,11 @@ kaaPixmapUseScreen (PixmapPtr pPixmap)
if (pKaaPixmap->score == KAA_PIXMAP_SCORE_PINNED)
return;
+ if (pKaaPixmap->score == KAA_PIXMAP_SCORE_INIT) {
+ kaaMoveInPixmap(pPixmap);
+ pKaaPixmap->score = 0;
+ }
+
if (pKaaPixmap->score < KAA_PIXMAP_SCORE_MAX)
{
pKaaPixmap->score++;
@@ -258,6 +262,9 @@ kaaPixmapUseMemory (PixmapPtr pPixmap)
if (pKaaPixmap->score == KAA_PIXMAP_SCORE_PINNED)
return;
+ if (pKaaPixmap->score == KAA_PIXMAP_SCORE_INIT)
+ pKaaPixmap->score = 0;
+
if (pKaaPixmap->score > KAA_PIXMAP_SCORE_MIN)
{
pKaaPixmap->score--;
@@ -320,10 +327,6 @@ kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
pKaaPixmap->score = KAA_PIXMAP_SCORE_INIT;
pKaaPixmap->area = NULL;
-
- if (pKaaPixmap->score != KAA_PIXMAP_SCORE_PINNED &&
- (pPixmap->devKind * h) >= MIN_OFFPIX_SIZE)
- kaaPixmapAllocArea (pPixmap);
pKaaPixmap->dirty = FALSE;
return pPixmap;