xf86-video-intel: src/i915_render.c

Dave Airlie airlied at kemper.freedesktop.org
Thu Aug 16 00:26:27 PDT 2007


 src/i915_render.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

New commits:
diff-tree 2231cdcd8f1ee81b3e59cc5e3a325c22ee0f40e4 (from a69db6f7fe1703b473e5c1d1e0088ccc203f4d5a)
Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Aug 16 17:15:54 2007 +1000

    i915: add support for render to a8

diff --git a/src/i915_render.c b/src/i915_render.c
index 7f25d90..7546dfd 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -155,16 +155,9 @@ static Bool i915_get_dest_format(Picture
     case PICT_x1r5g5b5:
         *dst_format = COLR_BUF_ARGB1555;
         break;
-    /* COLR_BUF_8BIT is special for YUV surfaces.  While we may end up being
-     * able to use it depending on how the hardware implements it, disable it
-     * for now while we don't know what exactly it does (what channel does it
-     * read from?
-     */
-    /*
     case PICT_a8:
         *dst_format = COLR_BUF_8BIT;
         break;
-    */
     case PICT_a4r4g4b4:
     case PICT_x4r4g4b4:
 	*dst_format = COLR_BUF_ARGB4444;
@@ -313,6 +306,7 @@ i915_prepare_composite(int op, PicturePt
     I830Ptr pI830 = I830PTR(pScrn);
     CARD32 dst_format, dst_offset, dst_pitch;
     CARD32 blendctl;
+    int out_reg = FS_OC;
 
     IntelEmitInvarientState(pScrn);
     *pI830->last_3d = LAST_3D_RENDER;
@@ -412,6 +406,9 @@ i915_prepare_composite(int op, PicturePt
 	ADVANCE_LP_RING();
     }
 
+    if (dst_format == COLR_BUF_8BIT)
+	out_reg = FS_U0;
+
     FS_BEGIN();
 
     /* Declare the registers necessary for our program.  I don't think the
@@ -432,7 +429,7 @@ i915_prepare_composite(int op, PicturePt
 
     if (!pMask) {
 	/* No mask, so move to output color */
-	i915_fs_mov(FS_OC, i915_fs_operand_reg(FS_R0));
+	i915_fs_mov(out_reg, i915_fs_operand_reg(FS_R0));
     } else {
 	/* Load the pMaskPicture texel */
 	i915_fs_texld(FS_R1, FS_S1, FS_T1);
@@ -453,17 +450,20 @@ i915_prepare_composite(int op, PicturePt
 	    PICT_FORMAT_RGB(pMaskPicture->format))
 	{
 	    if (i915_blend_op[op].src_alpha) {
-		i915_fs_mul(FS_OC, i915_fs_operand(FS_R0, W, W, W, W),
+		i915_fs_mul(out_reg, 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_mul(out_reg, 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_mul(out_reg, i915_fs_operand_reg(FS_R0),
 			i915_fs_operand(FS_R1, W, W, W, W));
 	}
     }
+    if (dst_format == COLR_BUF_8BIT)
+	i915_fs_mov(FS_OC, i915_fs_operand(out_reg, W, W, W, W));
+
     FS_END();
 
     return TRUE;


More information about the xorg-commit mailing list