From 96602cd2be49c0c04895a29ad797f2ac7e3e2cbe Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 10 Nov 2009 11:19:00 +0000 Subject: [PATCH] i915: Do not force the incoming source alpha to 1. RENDER specifies that textures are extended with the clear colour in the EXTEND_NONE case. By forcing the border colour to contain 1, we were padding with black instead. This is a long standing bug that causes numerous failure in cairo and has been frequently bemoaned about in bugzilla. https://bugs.freedesktop.org/show_bug.cgi?id=17933 x8r8g8b8 doesn't sample alpha=0 outside surface bounds However, one consequence of this is that we now must trust the incoming source alpha for x8r8g8b8 surfaces (and similar ignored alpha formats). We workaround this by ensuring that we fill the outgoing alpha channel with 1 for such targets, but we must also rely on the X server to fill the alpha channel on incoming RGB images. Signed-off-by: Chris Wilson --- src/i915_render.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/i915_render.c b/src/i915_render.c index f64e031..8d8fde4 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -446,7 +446,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); int op = intel->i915_render_state.op; - PicturePtr source_picture = intel->render_source_picture; PicturePtr mask_picture = intel->render_mask_picture; PicturePtr dest_picture = intel->render_dest_picture; PixmapPtr mask = intel->render_mask; @@ -600,10 +599,6 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) i915_fs_texldp(FS_R0, FS_S0, FS_T0); } - /* If the texture lacks an alpha channel, force the alpha to 1. */ - if (PICT_FORMAT_A(source_picture->format) == 0) - i915_fs_mov_masked(FS_R0, MASK_W, i915_fs_operand_one()); - src_reg = FS_R0; } @@ -653,7 +648,9 @@ static void i915_emit_composite_setup(ScrnInfoPtr scrn) } } if (dst_format == COLR_BUF_8BIT) - i915_fs_mov(FS_OC, i915_fs_operand(out_reg, W, W, W, W)); + i915_fs_mov(FS_OC, i915_fs_operand(out_reg, W, W, W, W)); + if (PICT_FORMAT_A(dest_picture->format) == 0) + i915_fs_mov_masked(FS_OC, MASK_W, i915_fs_operand_one()); FS_END(); } -- 1.6.5.2