summaryrefslogtreecommitdiff
path: root/src/i915_render.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-08-16 17:15:54 +1000
committerDave Airlie <airlied@redhat.com>2007-08-16 17:15:54 +1000
commit2231cdcd8f1ee81b3e59cc5e3a325c22ee0f40e4 (patch)
treeb49c1df54383377136cc9aca2bf2d6dfa4207d10 /src/i915_render.c
parenta69db6f7fe1703b473e5c1d1e0088ccc203f4d5a (diff)
i915: add support for render to a8
Diffstat (limited to 'src/i915_render.c')
-rw-r--r--src/i915_render.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index 7f25d90a..7546dfd7 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -155,16 +155,9 @@ static Bool i915_get_dest_format(PicturePtr pDstPicture, CARD32 *dst_format)
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, PicturePtr pSrcPicture,
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, PicturePtr pSrcPicture,
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, PicturePtr pSrcPicture,
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, PicturePtr pSrcPicture,
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;