xf86-video-intel: Branch 'exa' - 2 commits - src/i830_exa.c src/i915_exa_render.c

Zhenyu Wang zhen at kemper.freedesktop.org
Tue Sep 19 05:26:09 EEST 2006


 src/i830_exa.c        |   10 ++++------
 src/i915_exa_render.c |   24 ++++++++++++++++--------
 2 files changed, 20 insertions(+), 14 deletions(-)

New commits:
diff-tree e3ab89b0327ef6ff790ab53bba29c721aef032cd (from 37429c3ecb97df8faf0f3f56128d7a2b22eb8a5e)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 19 10:27:36 2006 +0800

    shader program fix for component alpha set
    
    If CA is set and blend op needs src alpha, the src
    value is not needed and should be (src.A * mask.X).
    This is found in handling exa magic two pass composite.

diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 62b2507..3bc2c0b 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -473,15 +473,23 @@ I915EXAPrepareComposite(int op, PictureP
 	if (PICT_FORMAT_A(pMaskPicture->format) == 0)
 	    i915_fs_mov_masked(FS_R1, MASK_W, i915_fs_operand_one());
 
-	/* If component alpha is set in the mask, then we need to provide
-	 * the source alpha component (channelwise multiplication) as the
-	 * output color.  If it isn't set, then we need to provide the
-	 * source value component, which is the multipliction of the source
-	 * by the mask alpha.
+	/* If component alpha is set in the mask and the blend operation
+	 * uses the source alpha, then we know we don't need the source
+	 * value (otherwise we would have hit a fallback earlier), so we
+	 * provide the source alpha (src.A * mask.X) as output color.
+	 * Conversely, if CA is set and we don't need the source alpha, then
+	 * we produce the source value (src.X * mask.X) and the source alpha
+	 * is unused..  Otherwise, we provide the non-CA source value
+	 * (src.X * mask.A).
 	 */
-	if (pMaskPicture->componentAlpha && pDstPicture->format != PICT_a8) {
-	    i915_fs_mul(FS_OC, i915_fs_operand_reg(FS_R0),
-			i915_fs_operand_reg(FS_R1));
+	if (pMaskPicture->componentAlpha) {
+	    if (I915BlendOp[op].src_alpha) {
+		i915_fs_mul(FS_OC, i915_fs_operand(FS_R0, W, W, W, W),
+			    i915_fs_operand_reg(FS_R1));
+	    } else {
+		i915_fs_mul(FS_OC, i915_fs_operand_reg(FS_R0),
+			    i915_fs_operand_reg(FS_R1));
+	    }
 	} else {
 	    i915_fs_mul(FS_OC, i915_fs_operand_reg(FS_R0),
 			i915_fs_operand(FS_R1, W, W, W, W));
diff-tree 37429c3ecb97df8faf0f3f56128d7a2b22eb8a5e (from bd758030a6a59af32f9d73655cb691e018e94a7d)
Author: Wang Zhenyu <zhenyu.z.wang at intel.com>
Date:   Tue Sep 19 10:08:31 2006 +0800

    misc cleanup

diff --git a/src/i830_exa.c b/src/i830_exa.c
index c633747..a1c7546 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -197,8 +197,8 @@ I830EXASolid(PixmapPtr pPixmap, int x1, 
 	    OUT_RING(XY_COLOR_BLT_CMD);
 
 	OUT_RING(pI830->BR[13]);
-	OUT_RING((y1 << 16) | x1);
-	OUT_RING((y2 << 16) | x2);
+	OUT_RING((y1 << 16) | (x1 & 0xffff));
+	OUT_RING((y2 << 16) | (x2 & 0xffff));
 	OUT_RING(offset);
 	OUT_RING(pI830->BR[16]);
 	ADVANCE_LP_RING();
@@ -255,12 +255,11 @@ I830EXACopy(PixmapPtr pDstPixmap, int sr
     ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
     int dst_x2, dst_y2;
-    unsigned int src_off, dst_off;
+    unsigned int dst_off;
 
     dst_x2 = dst_x1 + w;
     dst_y2 = dst_y1 + h;
 
-    src_off = pI830->copy_src_off;
     dst_off = exaGetPixmapOffset(pDstPixmap);
 
     {
@@ -278,7 +277,7 @@ I830EXACopy(PixmapPtr pDstPixmap, int sr
 	OUT_RING(dst_off);
 	OUT_RING((src_y1 << 16) | (src_x1 & 0xffff));
 	OUT_RING(pI830->copy_src_pitch);
-	OUT_RING(src_off);
+	OUT_RING(pI830->copy_src_off);
 
 	ADVANCE_LP_RING();
     }
@@ -298,7 +297,6 @@ static void
 IntelEXAComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
 		 int dstX, int dstY, int w, int h)
 {
-	/* should be same like I830Composite */
     ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
     int srcXend, srcYend, maskXend, maskYend;



More information about the xorg-commit mailing list