[xserver-commit] xserver/hw/kdrive/mach64 mach64video.c,1.16,1.17

Keith Packard xserver-commit@pdx.freedesktop.org
Mon, 10 Nov 2003 12:35:07 -0800


Committed by: keithp

Update of /cvs/xserver/xserver/hw/kdrive/mach64
In directory pdx:/tmp/cvs-serv4090/hw/kdrive/mach64

Modified Files:
	mach64video.c 
Log Message:
	* hw/kdrive/mach64/mach64video.c: (mach64PaintRegion),
	(mach64PutImage), (mach64ReputImage):
	* hw/kdrive/src/koffscreen.c: (KdOffscreenAlloc):
	* hw/kdrive/src/kxv.c: (KdXVRegetVideo), (KdXVReputVideo),
	(KdXVReputImage), (KdXVPutStill), (KdXVGetStill), (KdXVPutImage):
	* hw/kdrive/src/kxv.h:
	Fix KdXv interface to pass drawable down so that bits can be
	put into drawable pixmap rather than directly into the frame buffer.
	Rewrite logic in kdoffscreen to make space for new allocations,
	now deals correctly with locked areas.


Index: mach64video.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/mach64/mach64video.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mach64video.c	2 Nov 2003 19:56:10 -0000	1.16
+++ mach64video.c	10 Nov 2003 20:35:05 -0000	1.17
@@ -327,9 +327,8 @@
 }
 
 static void
-mach64PaintRegion (ScreenPtr pScreen, RegionPtr pRgn, Pixel fg)
+mach64PaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
 {
-    WindowPtr	pRoot = WindowTable[pScreen->myNum];
     GCPtr	pGC;
     CARD32    	val[2];
     xRectangle	*rects, *r;
@@ -342,15 +341,15 @@
     r = rects;
     while (nBox--)
     {
-	r->x = pBox->x1;
-	r->y = pBox->y1;
+	r->x = pBox->x1 - pDraw->x;
+	r->y = pBox->y1 - pDraw->y;
 	r->width = pBox->x2 - pBox->x1;
 	r->height = pBox->y2 - pBox->y1;
 	r++;
 	pBox++;
     }
     
-    pGC = GetScratchGC (pRoot->drawable.depth, pScreen);
+    pGC = GetScratchGC (pDraw->depth, pDraw->pScreen);
     if (!pGC)
 	goto bail1;
     
@@ -358,9 +357,9 @@
     val[1] = IncludeInferiors;
     ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
     
-    ValidateGC (&pRoot->drawable, pGC);
+    ValidateGC (pDraw, pGC);
     
-    (*pGC->ops->PolyFillRect) (&pRoot->drawable, pGC, 
+    (*pGC->ops->PolyFillRect) (pDraw, pGC, 
 			       REGION_NUM_RECTS (pRgn), rects);
 
     FreeScratchGC (pGC);
@@ -571,6 +570,7 @@
 
 static int
 mach64PutImage(KdScreenInfo	    *screen, 
+	       DrawablePtr	    pDraw,
 	       short		    src_x,
 	       short		    src_y,
 	       short		    drw_x,
@@ -778,7 +778,7 @@
     if (!REGION_EQUAL (screen->pScreen, &pPortPriv->clip, clipBoxes))
     {
 	REGION_COPY (screen->pScreen, &pPortPriv->clip, clipBoxes);
-	mach64PaintRegion (screen->pScreen, &pPortPriv->clip, pPortPriv->colorKey);
+	mach64PaintRegion (pDraw, &pPortPriv->clip, pPortPriv->colorKey);
     }
 
     pPortPriv->videoOn = TRUE;
@@ -880,6 +880,7 @@
 
 static int
 mach64ReputImage (KdScreenInfo	    *screen,
+		  DrawablePtr	    pDraw,
 		  short		    drw_x,
 		  short		    drw_y,
 		  RegionPtr	    clipBoxes,
@@ -898,7 +899,7 @@
 	if (!REGION_EQUAL (screen->pScreen, &pPortPriv->clip, clipBoxes))
 	{
 	    REGION_COPY (screen->pScreen, &pPortPriv->clip, clipBoxes);
-	    mach64PaintRegion (screen->pScreen, &pPortPriv->clip, pPortPriv->colorKey);
+	    mach64PaintRegion (pDraw, &pPortPriv->clip, pPortPriv->colorKey);
 	}
 	return Success;
     }