xserver/hw/kdrive/src kaa.c, 1.30, 1.31 kaa.h, 1.4, 1.5 kaapict.c, 1.10, 1.11 kpict.c, 1.7, 1.8

Eric Anholt xserver-commit at pdx.freedesktop.org
Sat Jul 3 02:16:32 PDT 2004


Committed by: anholt

Update of /cvs/xserver/xserver/hw/kdrive/src
In directory pdx:/tmp/cvs-serv4996/hw/kdrive/src

Modified Files:
	kaa.c kaa.h kaapict.c kpict.c 
Log Message:
Add a "dirty" flag to the pixmap private.  Clear it when setting up an
offscreen pixmap area, and set it when any rendering occurs.  When
moving a pixmap out of offscreen, don't read data back if it wasn't
dirtied (compared to the system memory copy).


Index: kaa.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaa.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- kaa.c	29 Jun 2004 20:37:50 -0000	1.30
+++ kaa.c	3 Jul 2004 09:16:30 -0000	1.31
@@ -57,6 +57,21 @@
 #define KAA_PIXMAP_SCORE_PINNED	    1000
 
 #define MIN_OFFPIX_SIZE		(4096)
+void
+kaaDrawableDirty (DrawablePtr pDrawable)
+{
+    PixmapPtr pPixmap;
+    KaaPixmapPrivPtr pKaaPixmap;
+
+    if (pDrawable->type == DRAWABLE_WINDOW)
+	pPixmap = (*pDrawable->pScreen->GetWindowPixmap)((WindowPtr) pDrawable);
+    else
+	pPixmap = (PixmapPtr)pDrawable;
+
+    pKaaPixmap = KaaGetPixmapPriv(pPixmap);
+    if (pKaaPixmap != NULL)
+	pKaaPixmap->dirty = TRUE;
+}
 
 static void
 kaaPixmapSave (ScreenPtr pScreen, KdOffscreenArea *area)
@@ -74,8 +89,6 @@
 		  pPixmap->drawable.width,
 		  pPixmap->drawable.height));
 		  
-    KdCheckSync (pPixmap->drawable.pScreen);
-
     src_pitch = pPixmap->devKind;
     dst_pitch = pKaaPixmap->devKind;
 
@@ -86,7 +99,12 @@
     pPixmap->devPrivate.ptr = dst;
     pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
     pKaaPixmap->area = NULL;
-    
+
+    if (!pKaaPixmap->dirty)
+	return;
+
+    KdCheckSync (pPixmap->drawable.pScreen);
+
     bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch;
 
     i = pPixmap->drawable.height;
@@ -152,6 +170,7 @@
 {
     ScreenPtr	pScreen = pPixmap->drawable.pScreen;
     KaaScreenPriv (pScreen);
+    KaaPixmapPriv (pPixmap);
     int dst_pitch, src_pitch, bytes;
     unsigned char *dst, *src;
     int i;
@@ -168,7 +187,9 @@
     
     if (!kaaPixmapAllocArea (pPixmap))
 	return;
-    
+
+    pKaaPixmap->dirty = FALSE;
+
     if (pKaaScr->info->UploadToScreen)
     {
 	if (pKaaScr->info->UploadToScreen(pPixmap, src, src_pitch))
@@ -301,6 +322,8 @@
     if (pKaaPixmap->score != KAA_PIXMAP_SCORE_PINNED &&
 	(pPixmap->devKind * h) >= MIN_OFFPIX_SIZE)
 	kaaPixmapAllocArea (pPixmap);
+    pKaaPixmap->dirty = FALSE;
+
     return pPixmap;
 }
 
@@ -437,6 +460,7 @@
 	}
     }
     (*pKaaScr->info->DoneSolid) ();
+    kaaDrawableDirty (pDrawable);
     KdMarkSync(pDrawable->pScreen);
 }
 
@@ -496,6 +520,7 @@
 		    pbox, nbox, dx, dy, reverse, upsidedown, 
 		    bitplane, closure);
     }
+    kaaDrawableDirty (pDstDrawable);
 }
 
 static RegionPtr
@@ -605,6 +630,7 @@
 	}
     }
     (*pKaaScr->info->DoneSolid) ();
+    kaaDrawableDirty (pDrawable);
     KdMarkSync(pDrawable->pScreen);
 }
     
@@ -635,6 +661,7 @@
 	fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2,
 			   fbAnd (GXcopy, fg, pm),
 			   fbXor (GXcopy, fg, pm));
+	kaaDrawableDirty (pDrawable);
 	return;
     }
     for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); 
@@ -667,6 +694,7 @@
 				 partX2 + xoff, partY2 + yoff);
     }
     (*pKaaScr->info->DoneSolid) ();
+    kaaDrawableDirty (pDrawable);
     KdMarkSync(pDrawable->pScreen);
 }
 
@@ -754,6 +782,7 @@
     }
 
     KdCheckSync (pDrawable->pScreen);
+    kaaDrawableDirty (pDrawable);
     
     ppci = ppciInit;
     while (nglyph--)
@@ -919,6 +948,7 @@
 	fbFillRegionSolid (pDrawable, pRegion, 0,
 			   fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
     }
+    kaaDrawableDirty (pDrawable);
 }
 
 static void

Index: kaa.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaa.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kaa.h	17 May 2004 07:19:49 -0000	1.4
+++ kaa.h	3 Jul 2004 09:16:30 -0000	1.5
@@ -43,6 +43,7 @@
     int		    score;
     int		    devKind;
     DevUnion	    devPrivate;
+    Bool	    dirty;
 } KaaPixmapPrivRec, *KaaPixmapPrivPtr;
 
 extern int kaaScreenPrivateIndex;
@@ -55,6 +56,9 @@
 void
 kaaPixmapUseMemory (PixmapPtr pPixmap);
 
+void
+kaaDrawableDirty(DrawablePtr pDrawable);
+
 Bool
 kaaDrawableIsOffscreen (DrawablePtr pDrawable);
 

Index: kaapict.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kaapict.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- kaapict.c	10 Jun 2004 19:22:58 -0000	1.10
+++ kaapict.c	3 Jul 2004 09:16:30 -0000	1.11
@@ -296,6 +296,7 @@
 
     (*pKaaScr->info->DoneSolid) ();
     KdMarkSync(pDst->pDrawable->pScreen);
+    kaaDrawableDirty (pDst->pDrawable);
 
     REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;
@@ -382,6 +383,7 @@
     
     (*pKaaScr->info->DoneBlend) ();
     KdMarkSync(pDst->pDrawable->pScreen);
+    kaaDrawableDirty (pDst->pDrawable);
 
     REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;
@@ -503,6 +505,7 @@
 
     (*pKaaScr->info->DoneComposite) ();
     KdMarkSync(pDst->pDrawable->pScreen);
+    kaaDrawableDirty (pDst->pDrawable);
 
     REGION_UNINIT(pDst->pDrawable->pScreen, &region);
     return 1;

Index: kpict.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/src/kpict.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- kpict.c	20 May 2004 05:27:03 -0000	1.7
+++ kpict.c	3 Jul 2004 09:16:30 -0000	1.8
@@ -45,6 +45,7 @@
 		  CARD16     height)
 {
     KdCheckSync (pDst->pDrawable->pScreen);
+    kaaDrawableDirty (pDst->pDrawable);
     fbComposite (op,
 		 pSrc,
 		 pMask,
@@ -66,6 +67,7 @@
 			  int		y_off)
 {
     KdCheckSync (pMask->pDrawable->pScreen);
+    kaaDrawableDirty (pMask->pDrawable);
     fbRasterizeTrapezoid (pMask, trap, x_off, y_off);
 }
 




More information about the xserver-commit mailing list