[Pixman] [PATCH 08/12] MIPS: DSPr1: Added support for run-time detection
Nemanja Lukic
nemanja.lukic at rt-rk.com
Sun Sep 8 15:52:47 PDT 2013
---
pixman/pixman-mips-dspr1.c | 12 ++++++++++++
pixman/pixman-mips.c | 24 ++++++++++++++++++++++--
pixman/pixman-private.h | 5 +++++
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/pixman/pixman-mips-dspr1.c b/pixman/pixman-mips-dspr1.c
index c0e8583..638d993 100644
--- a/pixman/pixman-mips-dspr1.c
+++ b/pixman/pixman-mips-dspr1.c
@@ -168,3 +168,15 @@ static const pixman_fast_path_t mips_dspr1_fast_paths[] =
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, mips_composite_add_8888_8888),
{ PIXMAN_OP_NONE },
};
+
+pixman_implementation_t *
+_pixman_implementation_create_mips_dspr1 (pixman_implementation_t *fallback)
+{
+ pixman_implementation_t *imp =
+ _pixman_implementation_create (fallback, mips_dspr1_fast_paths);
+
+ imp->blt = mips_dspr1_blt;
+ imp->fill = mips_dspr1_fill;
+
+ return imp;
+}
diff --git a/pixman/pixman-mips.c b/pixman/pixman-mips.c
index e9cf2e9..a9f228a 100644
--- a/pixman/pixman-mips.c
+++ b/pixman/pixman-mips.c
@@ -31,6 +31,11 @@
static const char *mips_dspr2_cores[] = {"MIPS 74K", NULL};
#endif
+#ifdef USE_MIPS_DSPR1
+static const char *mips_dspr1_cores[] = {"MIPS 1004K", "MIPS 74K", "MIPS 34K",
+ "MIPS 24KE", NULL};
+#endif
+
#ifdef USE_MIPS32R2
static const char *mips32r2_cores[] = {"MIPS 1004K", "MIPS 74K", "MIPS 34K",
"MIPS 24K", "MIPS 4Kc", "MIPS 4Km",
@@ -43,8 +48,8 @@ static const char *mips32r2_cores[] = {"MIPS 1004K", "MIPS 74K", "MIPS 34K",
static const char *mips_loongson_cores[] = {"Loongson", NULL};
#endif
-#if defined(USE_MIPS_DSPR2) || defined(USE_MIPS32R2) || \
- defined(USE_LOONGSON_MMI)
+#if defined(USE_MIPS_DSPR2) || defined(USE_MIPS_DSPR1) || \
+ defined(USE_MIPS32R2) || defined(USE_LOONGSON_MMI)
static pixman_bool_t
have_feature (const char **cores)
@@ -111,6 +116,21 @@ _pixman_mips_get_implementations (pixman_implementation_t *imp)
}
#endif
+#ifdef USE_MIPS_DSPR1
+ if (!_pixman_disabled ("mips-dspr1"))
+ {
+ int already_compiling_everything_for_dspr1 = 0;
+#if defined(__mips_dsp) && (__mips_dsp_rev >= 1)
+ already_compiling_everything_for_dspr1 = 1;
+#endif
+ if (already_compiling_everything_for_dspr1 ||
+ have_feature (mips_dspr1_cores))
+ {
+ imp = _pixman_implementation_create_mips_dspr1 (imp);
+ }
+ }
+#endif
+
#ifdef USE_MIPS_DSPR2
if (!_pixman_disabled ("mips-dspr2"))
{
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 1aacb8d..cce4cc5 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -608,6 +608,11 @@ pixman_implementation_t *
_pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback);
#endif
+#ifdef USE_MIPS_DSPR1
+pixman_implementation_t *
+_pixman_implementation_create_mips_dspr1 (pixman_implementation_t *fallback);
+#endif
+
#ifdef USE_MIPS32R2
pixman_implementation_t *
_pixman_implementation_create_mips32r2 (pixman_implementation_t *fallback);
--
1.7.3
More information about the Pixman
mailing list