pixman: Branch 'yuv-porting' - 5 commits
Alan Hourihane
alanh at kemper.freedesktop.org
Thu Oct 18 09:33:53 PDT 2007
README | 26 ++++++++++++++++++++++++++
configure.ac | 43 ++++++++++++++++++++++++++++++++++++++-----
pixman/pixman-compose.c | 8 ++++----
pixman/pixman-mmx.c | 4 ----
pixman/pixman.h | 2 +-
5 files changed, 69 insertions(+), 14 deletions(-)
New commits:
commit 85bccce4d863b99be4b9ce62a8ac7d95f0acab3d
Merge: 8aa38d2... 2853243...
Author: Alan Hourihane <alanh at tungstengraphics.com>
Date: Thu Oct 18 17:33:43 2007 +0100
Merge branch 'master' of git+ssh://git.freedesktop.org/git/pixman into yuv-porting
Conflicts:
pixman/pixman-compose.c
pixman/pixman.h
diff --cc pixman/pixman-compose.c
index 8dd0714,4c73822..ef49850
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@@ -4189,10 -4093,10 +4189,10 @@@ static void fbFetchExternalAlpha(bits_i
static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits;
- int stride;
+ int32_t stride;
storeProc store = storeProcForPicture(pict);
const pixman_indexed_t * indexed = pict->indexed;
-
+
bits = pict->bits;
stride = pict->rowstride;
bits += y*stride;
@@@ -4259,9 -4163,9 +4259,9 @@@ PIXMAN_COMPOSITE_RECT_GENERAL (const Fb
unsigned int srcClass = SOURCE_IMAGE_CLASS_UNKNOWN;
unsigned int maskClass = SOURCE_IMAGE_CLASS_UNKNOWN;
uint32_t *bits;
- int stride;
+ int32_t stride;
int xoff, yoff;
-
+
if (data->op == PIXMAN_OP_CLEAR)
fetchSrc = NULL;
else if (IS_SOURCE_IMAGE (data->src))
diff --cc pixman/pixman.h
index 3b9601c,7b93214..604e4a8
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@@ -454,11 -452,7 +454,11 @@@ typedef enum
/* 1bpp formats */
PIXMAN_a1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_A,1,0,0,0),
- PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0)
+ PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0),
+
+/* YUV formats */
+ PIXMAN_yuy2 = PIXMAN_FORMAT(16,PIXMAN_TYPE_YUY2,0,0,0,0),
- PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0),
++ PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0)
} pixman_format_code_t;
/* Constructors */
commit 28532430efeb4a1aba8f3e30a790531d2a9e1472
Author: Søren Sandmann <sandmann at redhat.com>
Date: Wed Oct 17 20:01:27 2007 -0400
Only compile with -msse on x86-64.
diff --git a/configure.ac b/configure.ac
index 5bb6c27..fded892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,10 +86,10 @@ if test "x$GCC" = "xyes"; then
dnl ===========================================================================
dnl Check for MMX
-MMX_CFLAGS="-mmmx -msse -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
have_mmx_intrinsics=no
-AC_MSG_CHECKING(For MMX/SSE intrinsics in the compiler)
+AC_MSG_CHECKING(whether to use MMX intrinsics)
xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MMX_CFLAGS"
AC_COMPILE_IFELSE([
@@ -97,10 +97,8 @@ AC_COMPILE_IFELSE([
#error "Need GCC >= 3.4 for MMX intrinsics"
#endif
#include <mmintrin.h>
-#include <xmmintrin.h>
int main () {
__m64 v = _mm_cvtsi32_si64 (1);
- v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
return _mm_cvtsi64_si32 (v);
}], have_mmx_intrinsics=yes)
CFLAGS=$xserver_save_CFLAGS
@@ -111,11 +109,46 @@ if test $have_mmx_intrinsics = yes ; then
else
MMX_CFLAGS=
fi
-AC_SUBST(MMX_CFLAGS)
AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
+dnl =======================================================
+
+dnl GCC 4.2 when compiling with -msse will generate SSE instructions
+dnl on its own. This means anything compiled with -mss can only be
+dnl run after a runtime check for SSE. Unfortunately, since we still
+dnl need to support MMX-but-not-SSE (such as the OLPC), this means we
+dnl can only use SSE when compiling for x86-64 (where SSE is always
+dnl supported).
+
+have_sse_intrinsics=no
+AC_MSG_CHECKING(whether to use SSE intrinsics)
+xserver_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -msse $MMX_CFLAGS"
+
+AC_COMPILE_IFELSE([
+#if !defined(__amd64__) && !defined(__x86_64__)
+#error "Need x86-64 for SSE"
+#endif
+#include <mmintrin.h>
+#include <xmmintrin.h>
+int main () {
+ __m64 v = _mm_cvtsi32_si64 (1);
+ v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
+ return _mm_cvtsi64_si32 (v);
+}], have_sse_intrinsics=yes)
+CFLAGS=$xserver_save_CFLAGS
+AC_MSG_RESULT($have_sse_intrinsics)
+
+if test $have_sse_intrinsics = yes ; then
+ AC_DEFINE(USE_SSE, 1, [use SSE compiler intrinsics])
+ MMX_CFLAGS="-msse $MMX_CFLAGS"
+fi
+
+AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
+
dnl ========================================================
+AC_SUBST(MMX_CFLAGS)
PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index be79124..52061c7 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -35,10 +35,6 @@
#ifdef USE_MMX
-#if defined(__amd64__) || defined(__x86_64__)
-#define USE_SSE
-#endif
-
#include <mmintrin.h>
#ifdef USE_SSE
#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
commit ab6743b17074dfedffb0ee32fe2e37cad03769bf
Author: Søren Sandmann <sandmann at redhat.com>
Date: Wed Oct 17 19:20:55 2007 -0400
Make stride signed in various places. This should fix some the
crashers that people have reported in bug 12398.
diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c
index 1e91864..4c73822 100644
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@ -2880,7 +2880,7 @@ static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t
static void fbFetch(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
fetchProc fetch = fetchProcForPicture(pict);
const pixman_indexed_t * indexed = pict->indexed;
@@ -3560,7 +3560,7 @@ static void pixmanFetchSourcePict(source_image_t * pict, int x, int y, int width
static void fbFetchTransformed(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
fetchPixelProc fetch;
pixman_vector_t v;
pixman_vector_t unit;
@@ -4093,7 +4093,7 @@ static void fbFetchExternalAlpha(bits_image_t * pict, int x, int y, int width, u
static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
storeProc store = storeProcForPicture(pict);
const pixman_indexed_t * indexed = pict->indexed;
@@ -4107,7 +4107,7 @@ static void fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buff
static void fbStoreExternalAlpha(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits, *alpha_bits;
- uint32_t stride, astride;
+ int32_t stride, astride;
int ax, ay;
storeProc store;
storeProc astore;
@@ -4163,7 +4163,7 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
unsigned int srcClass = SOURCE_IMAGE_CLASS_UNKNOWN;
unsigned int maskClass = SOURCE_IMAGE_CLASS_UNKNOWN;
uint32_t *bits;
- uint32_t stride;
+ int32_t stride;
int xoff, yoff;
if (data->op == PIXMAN_OP_CLEAR)
commit aca8b610d9ab178fcbcfa4a44d87e52aa7918ea4
Author: Søren Sandmann <sandmann at redhat.com>
Date: Wed Oct 17 18:43:13 2007 -0400
Remove comma from enumerator list. Bug 12621, reported by Matt Kraai.
diff --git a/pixman/pixman.h b/pixman/pixman.h
index a22dfd9..7b93214 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -452,7 +452,7 @@ typedef enum {
/* 1bpp formats */
PIXMAN_a1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_A,1,0,0,0),
- PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0),
+ PIXMAN_g1 = PIXMAN_FORMAT(1,PIXMAN_TYPE_GRAY,0,0,0,0)
} pixman_format_code_t;
/* Constructors */
commit 089c3e6ad00105b2f9a1118d15b4f381653ea6ff
Author: Søren Sandmann <sandmann at redhat.com>
Date: Wed Oct 17 18:40:28 2007 -0400
Add README file based on text from Bjorn Lindquist
diff --git a/README b/README
index e69de29..94b830c 100644
--- a/README
+++ b/README
@@ -0,0 +1,26 @@
+pixman is a library that provides low-level pixel manipulation
+features such as image compositing and trapezoid rasterization.
+
+Please submit bugs & patches to the libpixman bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=libpixman
+
+All questions regarding this software should be directed to either the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+or the cairo mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/cairo
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/pixman
+
+ http://gitweb.freedesktop.org/?p=pixman;a=summary
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
More information about the xorg-commit
mailing list