pixman: Branch 'master'

Pekka Paalanen pq at kemper.freedesktop.org
Wed Sep 9 01:46:10 PDT 2015


 pixman/pixman-implementation.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 812c9c9758e1503bd1725af9c6fe9ede6a467506
Author: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Date:   Tue Sep 8 13:35:33 2015 +0300

    implementation: add PIXMAN_DISABLE=wholeops
    
    Add a new option to PIXMAN_DISABLE: "wholeops". This option disables all
    whole-operation fast paths regardless of implementation level, except
    the general path (general_composite_rect).
    
    The purpose is to add a debug option that allows us to test optimized
    iterator paths specifically. With this, it is possible to see if:
    - fast paths mask bugs in iterators
    - compare fast paths with iterator paths for performance
    
    The effect was tested on x86_64 by running:
    $ PIXMAN_DISABLE='' ./test/lowlevel-blt-bench over_8888_8888
    $ PIXMAN_DISABLE='wholeops' ./test/lowlevel-blt-bench over_8888_8888
    
    In the first case time is spent in sse2_composite_over_8888_8888(), and
    in the latter in sse2_combine_over_u().
    
    Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
    Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>

diff --git a/pixman/pixman-implementation.c b/pixman/pixman-implementation.c
index 5884054..2c7de4c 100644
--- a/pixman/pixman-implementation.c
+++ b/pixman/pixman-implementation.c
@@ -380,6 +380,11 @@ _pixman_disabled (const char *name)
     return FALSE;
 }
 
+static const pixman_fast_path_t empty_fast_path[] =
+{
+    { PIXMAN_OP_NONE }
+};
+
 pixman_implementation_t *
 _pixman_choose_implementation (void)
 {
@@ -397,5 +402,16 @@ _pixman_choose_implementation (void)
 
     imp = _pixman_implementation_create_noop (imp);
 
+    if (_pixman_disabled ("wholeops"))
+    {
+        pixman_implementation_t *cur;
+
+        /* Disable all whole-operation paths except the general one,
+         * so that optimized iterators are used as much as possible.
+         */
+        for (cur = imp; cur->fallback; cur = cur->fallback)
+            cur->fast_paths = empty_fast_path;
+    }
+
     return imp;
 }


More information about the xorg-commit mailing list