pixman: Branch 'master' - 3 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Tue Sep 23 04:48:37 PDT 2008


 TODO                   |    4 +--
 pixman/pixman-access.c |    2 -
 pixman/pixman-pict.c   |    4 ++-
 pixman/pixman-sse2.c   |    4 +--
 pixman/pixman-utils.c  |   52 +++++++++++++++++++++++++++++++------------------
 5 files changed, 41 insertions(+), 25 deletions(-)

New commits:
commit 1c5de7b05831b3d66821707276b71974a232f5c7
Author: David Müller <dave.mueller at gmx.ch>
Date:   Tue Sep 23 07:45:51 2008 -0400

    Move _mm_empty() to correct place
    
    The "fbComposeSetupSSE2()" function is guarding most of its code
    depending on the capabilities of the CPU, but unfortunately the call
    to "_mm_empty()" is not part of this code path but executed
    unconditionally.  This results in a "illegal instruction" crash on
    non-MMX / non-SSE capable CPUs caused by the the "emms" instruction
    (embedded in "_mm_empty()").
    
    Fix bug 17729.

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 0f36436..6890f5f 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -2357,11 +2357,11 @@ fbComposeSetupSSE2(void)
         pixman_composeFunctions.combineC[PIXMAN_OP_ADD] = sse2CombineAddC;
 
         pixman_composeFunctions.combineMaskU = sse2CombineMaskU;
+
+	_mm_empty();
     }
 
     initialized = TRUE;
-
-    _mm_empty();
 }
 
 
commit aadcc7f011004794cf88c126641ef8258183878f
Author: Søren Sandmann Pedersen <sandmann at daimi.au.dk>
Date:   Sun Sep 21 11:01:07 2008 -0400

    Update TODO

diff --git a/TODO b/TODO
index 47b9bc9..6abeb0b 100644
--- a/TODO
+++ b/TODO
@@ -4,8 +4,6 @@
 
       - Use of fbCompositeOver_x888x8x8888sse2()
 
-      - Use pixmanFillsse2 and pixmanBltsse2
-
   - Update the RLEASING file
 
   - Things to keep in mind if breaking ABI:
@@ -178,6 +176,8 @@
 
 done:
 
+- Use pixmanFillsse2 and pixmanBltsse2
+
 - Be consistent about calling sse2 sse2
 
 - Rename "SSE" to "MMX_EXTENSIONS". (Deleted mmx extensions).
commit 9cb60e142bad01fd54cb7e6f3fa2504ddc87a7da
Author: Søren Sandmann Pedersen <sandmann at daimi.au.dk>
Date:   Sun Sep 21 11:00:33 2008 -0400

    Make use of SSE2 blt/fill in more places

diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index d01f8bd..b47ba16 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -51,7 +51,7 @@
 	int offset1 = stride < 0 ? \
 		offset0 + ((-stride) >> 1) * ((pict->height) >> 1) : \
 		offset0 + (offset0 >> 2)
-/* Note n trailing semicolon on the above macro; if it's there, then
+/* Note no trailing semicolon on the above macro; if it's there, then
  * the typical usage of YV12_SETUP(pict); will have an extra trailing ;
  * that some compilers will interpret as a statement -- and then any further
  * variable declarations will cause an error.
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index f9b574e..070b190 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1428,7 +1428,7 @@ static const FastPathInfo mmx_fast_paths[] =
     { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8,  PIXMAN_null,	PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8,  PIXMAN_null,	PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 },
     { PIXMAN_OP_SRC, PIXMAN_r5g6b5,    PIXMAN_null,     PIXMAN_r5g6b5,   fbCompositeCopyAreammx, 0 },
-    { PIXMAN_OP_SRC, PIXMAN_b5g6r5,    PIXMAN_null,     PIXMAN_b5g6r5,   fbCompositeCopyAreammx, 0 },
+    { PIXMAN_OP_SRC, PIXMAN_b5g6r5,    PIXMAN_null,     PIXMAN_b5g6r5,   fbCompositeCopyAreammx, 0 },    
     { PIXMAN_OP_IN,  PIXMAN_a8,        PIXMAN_null,     PIXMAN_a8,       fbCompositeIn_8x8mmx,   0 },
     { PIXMAN_OP_IN,  PIXMAN_solid,     PIXMAN_a8,	PIXMAN_a8,	 fbCompositeIn_nx8x8mmx, 0 },
     { PIXMAN_OP_NONE },
@@ -1501,6 +1501,8 @@ static const FastPathInfo sse2_fast_paths[] =
 
     { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8,  PIXMAN_null,     PIXMAN_a8r8g8b8, fbCompositeCopyAreasse2,               0 },
     { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8,  PIXMAN_null,     PIXMAN_a8b8g8r8, fbCompositeCopyAreasse2,               0 },
+    { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8,  PIXMAN_null,     PIXMAN_x8r8g8b8, fbCompositeCopyAreasse2,		0 },
+    { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8,  PIXMAN_null,	PIXMAN_x8b8g8r8, fbCompositeCopyAreasse2,		0 },
     { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8,  PIXMAN_null,     PIXMAN_x8r8g8b8, fbCompositeCopyAreasse2,               0 },
     { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8,  PIXMAN_null,     PIXMAN_x8b8g8r8, fbCompositeCopyAreasse2,               0 },
     { PIXMAN_OP_SRC, PIXMAN_r5g6b5,    PIXMAN_null,     PIXMAN_r5g6b5,   fbCompositeCopyAreasse2,               0 },
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index 21d9a2f..22f522b 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -29,6 +29,7 @@
 
 #include "pixman-private.h"
 #include "pixman-mmx.h"
+#include "pixman-sse2.h"
 
 PIXMAN_EXPORT pixman_bool_t
 pixman_transform_point_3d (pixman_transform_t *transform,
@@ -73,6 +74,14 @@ pixman_blt (uint32_t *src_bits,
 	    int dst_x, int dst_y,
 	    int width, int height)
 {
+#ifdef USE_SSE2
+    if (pixman_have_sse2())
+    {
+	return pixmanBltsse2 (src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
+			      src_x, src_y, dst_x, dst_y, width, height);
+    }
+    else
+#endif
 #ifdef USE_MMX
     if (pixman_have_mmx())
     {
@@ -171,28 +180,33 @@ pixman_fill (uint32_t *bits,
 	    x, y, width, height, stride, bpp, xor);
 #endif
 
+#ifdef USE_SSE2
+    if (pixman_have_sse2() && pixmanFillsse2 (bits, stride, bpp, x, y, width, height, xor))
+	return TRUE;
+#endif
+
 #ifdef USE_MMX
-    if (!pixman_have_mmx() || !pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor))
+    if (pixman_have_mmx() && pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor))
+	return TRUE;
 #endif
+    
+    switch (bpp)
     {
-	switch (bpp)
-	{
-	case 8:
-	    pixman_fill8 (bits, stride, x, y, width, height, xor);
-	    break;
-
-	case 16:
-	    pixman_fill16 (bits, stride, x, y, width, height, xor);
-	    break;
-
-	case 32:
-	    pixman_fill32 (bits, stride, x, y, width, height, xor);
-	    break;
-
-	default:
-	    return FALSE;
-	    break;
-	}
+    case 8:
+	pixman_fill8 (bits, stride, x, y, width, height, xor);
+	break;
+	
+    case 16:
+	pixman_fill16 (bits, stride, x, y, width, height, xor);
+	break;
+	
+    case 32:
+	pixman_fill32 (bits, stride, x, y, width, height, xor);
+	break;
+	
+    default:
+	return FALSE;
+	break;
     }
 
     return TRUE;


More information about the xorg-commit mailing list