xf86-video-intel: src/i915_render.c

Zhenyu Wang zhen at kemper.freedesktop.org
Tue Aug 28 06:58:52 PDT 2007


 src/i915_render.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
diff-tree 0fdbf64b34e4114c2b89d696b268b9c7464f1efd (from 3411eb0dbae470b910af3116a4ab960c821b9b20)
Author: Zhenyu Wang <zhenyu.z.wang at intel.com>
Date:   Tue Aug 28 21:56:21 2007 +0800

    Fix i915 a8 color buffer blending
    
    From spec, i915 engine uses green channel when reading from 8bit
    color buffer for blending, and also writes back green channel.
    Fix blend factor in dest alpha case by using dest color instead.
    Now rendercheck can pass a8 tests.

diff --git a/src/i915_render.c b/src/i915_render.c
index 7546dfd..ca85bf7 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -123,6 +123,17 @@ static CARD32 i915_get_blend_cntl(int op
             sblend = BLENDFACT_ZERO;
     }
 
+    /* i915 engine reads 8bit color buffer into green channel in cases
+       like color buffer blending .etc, and also writes back green channel.
+       So with dst_alpha blend we should use color factor. See spec on
+       "8-bit rendering" */
+    if ((dst_format == PICT_a8) && i915_blend_op[op].dst_alpha) {
+        if (sblend == BLENDFACT_DST_ALPHA)
+            sblend = BLENDFACT_DST_COLR;
+        else if (sblend == BLENDFACT_INV_DST_ALPHA)
+            sblend = BLENDFACT_INV_DST_COLR;
+    }
+
     /* If the source alpha is being used, then we should only be in a case
      * where the source blend factor is 0, and the source blend value is the
      * mask channels multiplied by the source picture's alpha.


More information about the xorg-commit mailing list