[Pixman] [PATCH 6/8] MIPS: disabled non 32-bit platforms

Nemanja Lukic nemanja.lukic at rt-rk.com
Mon Aug 19 07:16:54 PDT 2013


This patch add mechanism which allows optimizations to be run only
on 32-bit platforms.
---
 pixman/pixman-mips.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-mips.c b/pixman/pixman-mips.c
index a9f228a..eadf912 100644
--- a/pixman/pixman-mips.c
+++ b/pixman/pixman-mips.c
@@ -26,6 +26,7 @@
 #include "pixman-private.h"
 #include <string.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #ifdef USE_MIPS_DSPR2
 static const char *mips_dspr2_cores[] = {"MIPS 74K", NULL};
@@ -94,6 +95,8 @@ have_feature (const char **cores)
 pixman_implementation_t *
 _pixman_mips_get_implementations (pixman_implementation_t *imp)
 {
+    int long_bit;
+
 #ifdef USE_LOONGSON_MMI
     /* I really don't know if some Loongson CPUs don't have MMI. */
     if (!_pixman_disabled ("loongson-mmi") &&
@@ -101,6 +104,11 @@ _pixman_mips_get_implementations (pixman_implementation_t *imp)
 	imp = _pixman_implementation_create_mmx (imp);
 #endif
 
+    /* disable runtime detection for non 32-bit platforms */
+    long_bit = sysconf (_SC_LONG_BIT);
+    if (long_bit != 32)
+        return imp;
+
 #ifdef USE_MIPS32R2
     if (!_pixman_disabled ("mips32r2"))
     {
-- 
1.7.3



More information about the Pixman mailing list