From: Zack Rusin Date: Sat, 10 Oct 2009 08:45:41 +0000 (-0400) Subject: st/xorg: fix and enable by default xrender acceleration X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89bb33fb20e69d9fa5325da10abf31d61d51d371;p=mesa.git st/xorg: fix and enable by default xrender acceleration src in mask was broken --- diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index 54b9ecaba1a..90283fe6af5 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -320,7 +320,7 @@ boolean xorg_composite_bind_state(struct exa_context *exa, pDstPicture, pSrc, pMask, pDst); setup_constant_buffers(exa, pDst); - return FALSE; + return TRUE; } void xorg_composite(struct exa_context *exa, diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 29785c0040c..af76d6690f5 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -506,7 +506,7 @@ ExaComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDst); #if DEBUG_PRINT - debug_printf("\tExaComposite\n"); + debug_printf("\tExaComposite(src[%d,%d], mask=[%d, %d], dst=[%d, %d], dim=[%d, %d])\n", srcX, srcY, maskX, maskY, dstX, dstY, width, height); #endif xorg_composite(exa, priv, srcX, srcY, maskX, maskY, @@ -525,6 +525,9 @@ ExaCheckComposite(int op, #if DEBUG_PRINT debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n", op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); +#endif +#if DISABLE_ACCEL + accelerated = FALSE; #endif return accelerated; } diff --git a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c index 8ce06e374a9..8c9b674b4b6 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c +++ b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c @@ -67,9 +67,19 @@ src_in_mask(struct ureg_program *ureg, struct ureg_src src, struct ureg_src mask) { - /* MUL dst, src, mask.wwww */ +#if 0 + /* MUL dst, src, mask.a */ ureg_MUL(ureg, dst, src, ureg_scalar(mask, TGSI_SWIZZLE_W)); +#else + /* MOV dst, src */ + /* MUL dst.a, src.a, mask.a */ + ureg_MOV(ureg, dst, src); + ureg_MUL(ureg, + ureg_writemask(dst, TGSI_WRITEMASK_W), + ureg_scalar(src, TGSI_SWIZZLE_W), + ureg_scalar(mask, TGSI_SWIZZLE_W)); +#endif } static struct ureg_src @@ -271,7 +281,7 @@ create_vs(struct pipe_context *pipe, if (has_mask) { src = ureg_DECL_vs_input(ureg, input_slot++); - dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 2); + dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 1); ureg_MOV(ureg, dst, src); }