[Pixman] [PATCH 2/8] Add implementation type to pixman_implementation_t

Taekyun Kim podain77 at gmail.com
Mon Sep 19 07:08:20 PDT 2011


From: Taekyun Kim <tkq.kim at samsung.com>

It might be useful to know the type of an implementation. We can
gather profile data or control priority of individual composite
function.
---
 pixman/pixman-arm-neon.c  |    1 +
 pixman/pixman-arm-simd.c  |    2 ++
 pixman/pixman-fast-path.c |    1 +
 pixman/pixman-general.c   |    1 +
 pixman/pixman-mmx.c       |    2 ++
 pixman/pixman-private.h   |   38 +++++++++++++++++++++++++-------------
 pixman/pixman-sse2.c      |    1 +
 7 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c
index effb50b..e5c6769 100644
--- a/pixman/pixman-arm-neon.c
+++ b/pixman/pixman-arm-neon.c
@@ -502,6 +502,7 @@ _pixman_implementation_create_arm_neon (pixman_implementation_t *fallback)
 
     imp->blt = arm_neon_blt;
     imp->fill = arm_neon_fill;
+    imp->type = PIXMAN_IMPLEMENTATION_ARM_NEON;
 
     return imp;
 }
diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c
index 3d19bfa..73bc39e 100644
--- a/pixman/pixman-arm-simd.c
+++ b/pixman/pixman-arm-simd.c
@@ -428,5 +428,7 @@ _pixman_implementation_create_arm_simd (pixman_implementation_t *fallback)
 {
     pixman_implementation_t *imp = _pixman_implementation_create (fallback, arm_simd_fast_paths);
 
+    imp->type = PIXMAN_IMPLEMENTATION_ARM_SIMD;
+
     return imp;
 }
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index bbdc8e8..1431b4d 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1983,6 +1983,7 @@ _pixman_implementation_create_fast_path (pixman_implementation_t *fallback)
     pixman_implementation_t *imp = _pixman_implementation_create (fallback, c_fast_paths);
 
     imp->fill = fast_path_fill;
+    imp->type = PIXMAN_IMPLEMENTATION_C_FAST_PATH;
 
     return imp;
 }
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index 2ccdfcd..b1a32b0 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -258,6 +258,7 @@ _pixman_implementation_create_general (void)
     imp->fill = general_fill;
     imp->src_iter_init = general_src_iter_init;
     imp->dest_iter_init = general_dest_iter_init;
+    imp->type = PIXMAN_IMPLEMENTATION_GENERAL;
 
     return imp;
 }
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 697ec4c..47d8bdd 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3161,6 +3161,8 @@ _pixman_implementation_create_mmx (pixman_implementation_t *fallback)
     imp->blt = mmx_blt;
     imp->fill = mmx_fill;
 
+    imp->type = PIXMAN_IMPLEMENTATION_MMX;
+
     return imp;
 }
 
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index a25897d..4541bcd 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -432,21 +432,33 @@ typedef struct
     pixman_composite_func_t func;
 } pixman_fast_path_t;
 
+typedef enum
+{
+    PIXMAN_IMPLEMENTATION_UNKNOWN,
+    PIXMAN_IMPLEMENTATION_GENERAL,
+    PIXMAN_IMPLEMENTATION_C_FAST_PATH,
+    PIXMAN_IMPLEMENTATION_SSE2,
+    PIXMAN_IMPLEMENTATION_MMX,
+    PIXMAN_IMPLEMENTATION_ARM_SIMD,
+    PIXMAN_IMPLEMENTATION_ARM_NEON,
+} pixman_implementation_type_t;
+
 struct pixman_implementation_t
 {
-    pixman_implementation_t *	toplevel;
-    pixman_implementation_t *	delegate;
-    const pixman_fast_path_t *	fast_paths;
-
-    pixman_blt_func_t		blt;
-    pixman_fill_func_t		fill;
-    pixman_iter_init_func_t     src_iter_init;
-    pixman_iter_init_func_t     dest_iter_init;
-
-    pixman_combine_32_func_t	combine_32[PIXMAN_N_OPERATORS];
-    pixman_combine_32_func_t	combine_32_ca[PIXMAN_N_OPERATORS];
-    pixman_combine_64_func_t	combine_64[PIXMAN_N_OPERATORS];
-    pixman_combine_64_func_t	combine_64_ca[PIXMAN_N_OPERATORS];
+    pixman_implementation_type_t    type;
+    pixman_implementation_t *	    toplevel;
+    pixman_implementation_t *	    delegate;
+    const pixman_fast_path_t *	    fast_paths;
+
+    pixman_blt_func_t		    blt;
+    pixman_fill_func_t		    fill;
+    pixman_iter_init_func_t	    src_iter_init;
+    pixman_iter_init_func_t	    dest_iter_init;
+
+    pixman_combine_32_func_t	    combine_32[PIXMAN_N_OPERATORS];
+    pixman_combine_32_func_t	    combine_32_ca[PIXMAN_N_OPERATORS];
+    pixman_combine_64_func_t	    combine_64[PIXMAN_N_OPERATORS];
+    pixman_combine_64_func_t	    combine_64_ca[PIXMAN_N_OPERATORS];
 };
 
 uint32_t
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 6689c53..2be0a73 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5796,6 +5796,7 @@ _pixman_implementation_create_sse2 (pixman_implementation_t *fallback)
     imp->fill = sse2_fill;
 
     imp->src_iter_init = sse2_src_iter_init;
+    imp->type = PIXMAN_IMPLEMENTATION_SSE2;
 
     return imp;
 }
-- 
1.7.1



More information about the Pixman mailing list