xserver/hw/kdrive/src kaa.c,1.32,1.33

Eric Anholt xserver-commit at pdx.freedesktop.org
Mon Aug 30 09:43:13 PDT 2004


Committed by: anholt

Update of /cvs/xserver/xserver/hw/kdrive/src
In directory gabe:/tmp/cvs-serv4853/hw/kdrive/src

Modified Files:
	kaa.c 
Log Message:
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.


Index: kaa.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaa.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- kaa.c	26 Jul 2004 17:14:26 -0000	1.32
+++ kaa.c	30 Aug 2004 16:43:10 -0000	1.33
@@ -51,12 +51,11 @@
 
 #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 @@
     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 @@
     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 @@
 	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;



More information about the xserver-commit mailing list