rpms/xorg-x11-server/devel exa-1tmu-masked-blends-3.patch, NONE, 1.1.2.1 xorg-x11-server.spec, 1.170.2.6, 1.170.2.7

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Oct 6 20:04:54 UTC 2006


Author: ajackson

Update of /cvs/dist/rpms/xorg-x11-server/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1480

Modified Files:
      Tag: private-1_2-branch
	xorg-x11-server.spec 
Added Files:
      Tag: private-1_2-branch
	exa-1tmu-masked-blends-3.patch 
Log Message:
* Fri Oct 6 2006 Adam Jackson <ajackson at redhat.com> 1.1.99.4-0.4.olpc1
- Move built-in fonts patch to base patch set.
- Add EXA two-pass masked blends experiment.


exa-1tmu-masked-blends-3.patch:
 exa_render.c |   89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 89 insertions(+)

--- NEW FILE exa-1tmu-masked-blends-3.patch ---
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 9affb9f..fe23cb4 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -542,6 +542,83 @@
     return 1;
 }
 
+/**
+ * exaTrySingleTextureCompositeHelper implements non-component-alpha masked
+ * blends for single-TMU cards, or cards with no texturing but with an
+ * alpha blending blit.  Essentially, copy pSrc to a scratch, In it with
+ * the mask, and then op that onto pDst.
+ *
+ * XXX not complete because:
+ * - no idea if the x/y's are right
+ * - might need miComputeCompositeRegion too
+ * - creating fresh scratches for this feels really expensive
+ */
+static int
+exaTrySingleTextureCompositeHelper(CARD8 op,
+				   PicturePtr pSrc,
+				   PicturePtr pMask,
+				   PicturePtr pDst,
+				   INT16 xSrc,
+				   INT16 ySrc,
+				   INT16 xMask,
+				   INT16 yMask,
+				   INT16 xDst,
+				   INT16 yDst,
+				   CARD16 width,
+				   CARD16 height)
+{
+    ScreenPtr pScreen = pDst->pDrawable->pScreen;
+    PixmapPtr pPix = NULL;
+    PicturePtr pScratch = NULL;
+    RegionRec region;
+    int error, ret = -1;
+    ExaScreenPriv(pScreen);
+    Bool (*CheckComposite)(int, PicturePtr, PicturePtr, PicturePtr);
+
+    if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+				   xSrc, ySrc, xMask, yMask, xDst, yDst,
+				   width, height))
+	return 1;
+    miTranslateRegion(&region, -xDst, -yDst);
+
+    pPix = pScreen->CreatePixmap(pScreen, pDst->pDrawable->width,
+				 pDst->pDrawable->height, 32);
+    if (!pPix)
+	goto out;
+
+    pScratch = CreatePicture(0, &pPix->drawable,
+			     PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8),
+			     0, NULL, serverClient, &error);
+    if (!pScratch)
+	goto out;
+
+    CheckComposite = pExaScr->info->CheckComposite;
+    if (CheckComposite &&
+	(!CheckComposite(PictOpSrc, pSrc, NULL, pScratch) ||
+	 !CheckComposite(PictOpInReverse, pMask, NULL, pScratch) ||
+	 !CheckComposite(op, pScratch, NULL, pDst)))
+	goto out;
+
+    exaComposite(PictOpSrc, pSrc, NULL, pScratch, xSrc, ySrc, 0, 0, 0, 0,
+		 pPix->drawable.width, pPix->drawable.height);
+
+    exaComposite(PictOpInReverse, pMask, NULL, pScratch, xMask, yMask, 0, 0,
+		 xSrc, ySrc, width, height);
+
+    pScratch->pCompositeClip = ®ion;
+    exaComposite(op, pScratch, NULL, pDst, 0, 0, 0, 0, xDst, yDst,
+		 width, height);
+
+    ret = 1;
+
+out:
+    if (pScratch)
+	FreePicture(pScratch, pScratch->id);
+    if (pPix)
+	pScreen->DestroyPixmap(pPix);
+    return ret;
+}
+
 void
 exaComposite(CARD8	op,
 	     PicturePtr pSrc,
@@ -655,6 +732,18 @@
 	    if (ret == 1)
 		goto done;
 	}
+
+	/*
+	 * For single-TMU or alpha-blit hardware, decompose one op with mask
+	 * into two ops without.
+	 */
+	if (ret == -1 && pMask) {
+	    ret = exaTrySingleTextureCompositeHelper(op, pSrc, pMask, pDst,
+						     xSrc, ySrc, xMask, yMask,
+						     xDst, yDst, width, height);
+	    if (ret == 1)
+		goto done;
+	}
     }
 
     if (ret != 0) {


Index: xorg-x11-server.spec
===================================================================
RCS file: /cvs/dist/rpms/xorg-x11-server/devel/xorg-x11-server.spec,v
retrieving revision 1.170.2.6
retrieving revision 1.170.2.7
diff -u -r1.170.2.6 -r1.170.2.7
--- xorg-x11-server.spec	6 Oct 2006 19:51:59 -0000	1.170.2.6
+++ xorg-x11-server.spec	6 Oct 2006 20:04:52 -0000	1.170.2.7
@@ -719,6 +719,7 @@
 %changelog
 * Fri Oct 6 2006 Adam Jackson <ajackson at redhat.com> 1.1.99.4-0.4.olpc1
 - Move built-in fonts patch to base patch set.
+- Add EXA two-pass masked blends experiment.
 
 * Fri Oct 6 2006 Adam Jackson <ajackson at redhat.com> 1.1.99.3-0.3.olpc1
 - OLPC: Remove scanpci from the install so rpm doesn't include it, and




More information about the fedora-cvs-commits mailing list