pixman: Branch '0.26' - 9 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Thu Oct 25 07:45:41 PDT 2012


 configure.ac                     |    3 +--
 pixman/pixman-combine.c.template |    4 ++--
 pixman/pixman-fast-path.c        |    7 ++++---
 pixman/pixman-image.c            |    4 ++--
 pixman/pixman-inlines.h          |    2 +-
 pixman/pixman-matrix.c           |    2 +-
 pixman/pixman-mmx.c              |   15 ++++++++++++---
 test/blitters-test.c             |    2 +-
 8 files changed, 24 insertions(+), 15 deletions(-)

New commits:
commit 8ebf42cbd835daac6db14ca7046c966ca36fd127
Author: Matt Turner <mattst88 at gmail.com>
Date:   Sun Sep 30 11:59:23 2012 -0700

    iwmmxt: Don't define dummy _mm_empty for >=gcc-4.8
    
    Definition was not present in <4.8.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55451

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index febf95a..e678ce5 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -51,7 +51,7 @@
 #define CHECKPOINT()
 #endif
 
-#ifdef USE_ARM_IWMMXT
+#if defined USE_ARM_IWMMXT && __GNUC__ == 4 && __GNUC_MINOR__ < 8
 /* Empty the multimedia state. For some reason, ARM's mmintrin.h doesn't provide this.  */
 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _mm_empty (void)
commit b763db601d9866119d1b5b11f9a1cbfb336e4bc2
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Sat Sep 15 03:13:09 2012 -0400

    Fix for infinite-loop test
    
    The infinite loop detected by "affine-test 212944861" is caused by an
    overflow in this expression:
    
        max_x = pixman_fixed_to_int (vx + (width - 1) * unit_x) + 1;
    
    where (width - 1) * unit_x doesn't fit in a signed int. This causes
    max_x to be too small so that this:
    
        src_width = 0
    
        while (src_width < REPEAT_NORMAL_MIN_WIDTH && src_width <= max_x)
            src_width += src_image->bits.width;
    
    results in src_width being 0. Later on when src_width is used for
    repeat calculations, we get the infinite loop.
    
    By casting unit_x to int64_t, the expression no longer overflows and
    affine-test 212944861 and infinite-loop no longer loop forever.

diff --git a/pixman/pixman-inlines.h b/pixman/pixman-inlines.h
index 3532867..66c998e 100644
--- a/pixman/pixman-inlines.h
+++ b/pixman/pixman-inlines.h
@@ -844,7 +844,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
     {												\
 	vx = v.vector[0];									\
 	repeat (PIXMAN_REPEAT_NORMAL, &vx, pixman_int_to_fixed(src_image->bits.width));		\
-	max_x = pixman_fixed_to_int (vx + (width - 1) * unit_x) + 1;				\
+	max_x = pixman_fixed_to_int (vx + (width - 1) * (int64_t)unit_x) + 1;			\
 												\
 	if (src_image->bits.width < REPEAT_NORMAL_MIN_WIDTH)					\
 	{											\
commit 9da5584d51890e87a5f58e64c2e7581ae72799a5
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Thu Sep 20 21:43:24 2012 -0400

    Fix bugs in pixman-image.c
    
    In the checks for whether the transforms are rotation matrices "-1"
    and "1" were used instead of the correct -pixman_fixed_1 and
    pixman_fixed_1.
    
    Fixes test suite failure for rotate-test.

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 8599a1e..c58792f 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -301,9 +301,9 @@ compute_image_info (pixman_image_t *image)
 		pixman_fixed_t m01 = image->common.transform->matrix[0][1];
 		pixman_fixed_t m10 = image->common.transform->matrix[1][0];
 
-		if (m01 == -1 && m10 == 1)
+		if (m01 == -pixman_fixed_1 && m10 == pixman_fixed_1)
 		    flags |= FAST_PATH_ROTATE_90_TRANSFORM;
-		else if (m01 == 1 && m10 == -1)
+		else if (m01 == pixman_fixed_1 && m10 == -pixman_fixed_1)
 		    flags |= FAST_PATH_ROTATE_270_TRANSFORM;
 	    }
 	}
commit 575b138d0c76e8363e29d75f867a7aaea5498a4d
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Wed Sep 19 12:04:11 2012 -0400

    Fix bugs in component alpha combiners for separable PDF operators
    
    In general, the component alpha version of an operator is supposed to
    do this:
    
           - multiply source with mask in all channels
           - multiply mask with source alpha in all channels
           - compute the regular operator in all channels using the
             mask value whenever source alpha is called for
    
    The first two steps are usually accomplished with the function
    combine_mask_ca(), but for operators where source alpha is not used,
    such as SRC, ADD and OUT, the simpler function
    combine_mask_value_ca(), which doesn't compute the new mask values,
    can be used.
    
    However, the PDF blend modes generally *do* make use of source alpha,
    so they can't use combine_mask_value_ca() as they do now. They have to
    use combine_mask_ca().
    
    This patch fixes this in combine_multiply_ca() and the CA combiners
    generated by PDF_SEPARABLE_BLEND_MODE.

diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template
index cd008d9..50d2b0a 100644
--- a/pixman/pixman-combine.c.template
+++ b/pixman/pixman-combine.c.template
@@ -489,7 +489,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
 	comp4_t r = d;
 	comp4_t dest_ia = ALPHA_c (~d);
 
-	combine_mask_value_ca (&s, &m);
+	combine_mask_ca (&s, &m);
 
 	UNcx4_MUL_UNcx4_ADD_UNcx4_MUL_UNc (r, ~m, s, dest_ia);
 	UNcx4_MUL_UNcx4 (d, s);
@@ -546,7 +546,7 @@ combine_multiply_ca (pixman_implementation_t *imp,
 	    comp1_t ida = ~da;						\
 	    comp4_t result;						\
             								\
-	    combine_mask_value_ca (&s, &m);				\
+	    combine_mask_ca (&s, &m);					\
             								\
 	    result = d;							\
 	    UNcx4_MUL_UNcx4_ADD_UNcx4_MUL_UNc (result, ~m, s, ida);     \
diff --git a/test/blitters-test.c b/test/blitters-test.c
index feea308..54d1e40 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -424,6 +424,6 @@ main (int argc, const char *argv[])
     }
 
     return fuzzer_test_main("blitters", 2000000,
-			    0xA364B5BF,
+			    0x3E1DD2E8,
 			    test_composite, argc, argv);
 }
commit 3bfd70c8692bd4aa0f07a024e4942655a51f1ca3
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Wed Sep 19 19:46:13 2012 -0400

    Fix bug in fast_composite_scaled_nearest()
    
    The fast_composite_scaled_nearest() function can be called when the
    format is x8b8g8r8. In that case pixels fetched in fetch_nearest()
    need to have their alpha channel set to 0xff.
    
    Fixes test suite failure in scaling-test.
    
    Reviewed-by: Matt Turner <mattst88 at gmail.com>

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index ac60ec2..586f367 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1416,7 +1416,7 @@ fetch_nearest (pixman_repeat_t src_repeat,
 {
     if (repeat (src_repeat, &x, src_width))
     {
-	if (format == PIXMAN_x8r8g8b8)
+	if (format == PIXMAN_x8r8g8b8 || format == PIXMAN_x8b8g8r8)
 	    return *(src + x) | 0xff000000;
 	else
 	    return *(src + x);
commit 538e571920677a0dd376511eca29cfbf75c3613c
Author: Sebastian Bauer <mail at sebastianbauer.info>
Date:   Tue Jul 31 07:30:32 2012 +0200

    Use angle brackets form of including config.h

diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c
index 8d0d973..90856cb 100644
--- a/pixman/pixman-matrix.c
+++ b/pixman/pixman-matrix.c
@@ -25,7 +25,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
 #include <math.h>
commit d1bd9094ac2208e806cfdf551c6efeb02ff5c7d3
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Jul 9 06:58:59 2012 -0400

    Make pixman-mmx.c compile on x86-32 without optimization
    
    When not optimizing, write _mm_shuffle_pi16() as a statement
    expression with inline assembly. That way we avoid
    __builtin_ia32_pshufw(), which is only available when compiling with
    -msse, while still allowing the non-optimizing gcc to understand that
    the second argument is a compile time constant.
    
    Tested-by: Knut Petersen <knut_petersen at t-online.de>

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 1a014fd..febf95a 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -104,8 +104,17 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N)
     return ret;
 }
 #  else
-#   define _mm_shuffle_pi16(A, N) \
-    ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N)))
+#   define _mm_shuffle_pi16(A, N)					\
+    ({									\
+	__m64 ret;							\
+									\
+	asm ("pshufw %2, %1, %0\n\t"					\
+	     : "=y" (ret)						\
+	     : "y" (A), "K" ((const int8_t)N)				\
+	);								\
+									\
+	ret;								\
+    })
 #  endif
 # endif
 #endif
commit f3412c60333b33075da83fc276b70e4e913bb8f1
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Sun Jul 1 16:59:53 2012 -0400

    Use a compile-time constant for the "K" constraint in the MMX detection.
    
    When compiling with -O0, gcc doesn't understand that in
    
         signed char x = 0;
    
         ...
    
         asm ("...",
         	  : "K" (x));
    
    x is constant. Fix this by using an immediate constant instead of a
    variable.

diff --git a/configure.ac b/configure.ac
index 911e527..e685443 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,12 +351,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 int main () {
     __m64 v = _mm_cvtsi32_si64 (1);
     __m64 w;
-    signed char x = 0;
 
     /* Some versions of clang will choke on K */
     asm ("pshufw %2, %1, %0\n\t"
         : "=y" (w)
-        : "y" (v), "K" (x)
+        : "y" (v), "K" (5)
     );
 
     return _mm_cvtsi64_si32 (v);
commit 09a4b1ac881b47481cf64bef75a0394f52a8e3ce
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Sun Jul 1 06:54:06 2012 -0400

    In fast_composite_tiled_repeat() don't clone images with a palette
    
    In fast_composite_tiled_repeat() if the source image is less than a
    certain constant width, a clone is created which is then
    pre-repeated. However, the source image's palette, if it has one, is
    not cloned, so for indexed images, the pre-repeating would crash.
    
    Fix this by not doing any pre-repeating for images with a palette set.

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 0a134ed..ac60ec2 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1238,8 +1238,9 @@ fast_composite_tiled_repeat (pixman_implementation_t *imp,
 
 	src_bpp = PIXMAN_FORMAT_BPP (src_image->bits.format);
 
-	if (src_image->bits.width < REPEAT_MIN_WIDTH &&
-	    (src_bpp == 32 || src_bpp == 16 || src_bpp == 8))
+	if (src_image->bits.width < REPEAT_MIN_WIDTH		&&
+	    (src_bpp == 32 || src_bpp == 16 || src_bpp == 8)	&&
+	    !src_image->bits.indexed)
 	{
 	    sx = src_x;
 	    sx = MOD (sx, src_image->bits.width);


More information about the xorg-commit mailing list