[Pixman] [PATCH 2/2] Buffer override support for bilinear and x8r8g8b8/r5g6b5/a8 iterators
Siarhei Siamashka
siarhei.siamashka at gmail.com
Sun Sep 1 09:53:40 PDT 2013
By providing the new "offer_buffer" iterator method, redundant
memcpy combiners are now avoided for compositing with SRC
operator in some cases. One good example is src_0565_8888.
Running lowlevel-blt-bench on Intel Core-i7 860 @2.8GHz:
before: src_0565_8888 = L1: 931.54 L2: 888.93 M:638.34
after: src_0565_8888 = L1:1031.66 L2:1003.42 M:871.54
The simple fast paths, which exist only to convert between a8r8g8b8
and the other formats, can also be dropped in the future.
---
pixman/pixman-fast-path.c | 14 ++++++++------
pixman/pixman-mmx.c | 6 +++---
pixman/pixman-sse2.c | 6 +++---
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 2608268..bf32ac3 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -2475,6 +2475,7 @@ fast_bilinear_cover_iter_init (pixman_iter_t *iter, const pixman_iter_info_t *it
info->line1.y = -1;
info->line1.buffer = &(info->data[width]);
+ iter->offer_buffer = _pixman_iter_accept_buffer_offers;
iter->get_scanline = fast_fetch_bilinear_cover;
iter->fini = bilinear_cover_iter_fini;
@@ -2499,17 +2500,18 @@ fail:
static const pixman_iter_info_t fast_iters[] =
{
{ PIXMAN_r5g6b5, IMAGE_FLAGS, ITER_NARROW | ITER_SRC,
- _pixman_iter_init_bits_stride, fast_fetch_r5g6b5, NULL },
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers,
+ fast_fetch_r5g6b5, NULL },
+
+ { PIXMAN_r5g6b5, FAST_PATH_STD_DEST_FLAGS,
+ ITER_NARROW | ITER_DEST | ITER_IGNORE_RGB | ITER_IGNORE_ALPHA,
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers,
+ fast_dest_fetch_noop, fast_write_back_r5g6b5 },
{ PIXMAN_r5g6b5, FAST_PATH_STD_DEST_FLAGS,
ITER_NARROW | ITER_DEST,
_pixman_iter_init_bits_stride,
fast_fetch_r5g6b5, fast_write_back_r5g6b5 },
-
- { PIXMAN_r5g6b5, FAST_PATH_STD_DEST_FLAGS,
- ITER_NARROW | ITER_DEST | ITER_IGNORE_RGB | ITER_IGNORE_ALPHA,
- _pixman_iter_init_bits_stride,
- fast_dest_fetch_noop, fast_write_back_r5g6b5 },
{ PIXMAN_a8r8g8b8,
(FAST_PATH_STANDARD_FLAGS |
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index c94d282..4ccd3ab 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3929,13 +3929,13 @@ mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
static const pixman_iter_info_t mmx_iters[] =
{
{ PIXMAN_x8r8g8b8, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, mmx_fetch_x8r8g8b8, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, mmx_fetch_x8r8g8b8, NULL
},
{ PIXMAN_r5g6b5, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, mmx_fetch_r5g6b5, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, mmx_fetch_r5g6b5, NULL
},
{ PIXMAN_a8, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, mmx_fetch_a8, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, mmx_fetch_a8, NULL
},
{ PIXMAN_null },
};
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index dde9235..539096c 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -6347,13 +6347,13 @@ sse2_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
static const pixman_iter_info_t sse2_iters[] =
{
{ PIXMAN_x8r8g8b8, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, sse2_fetch_x8r8g8b8, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, sse2_fetch_x8r8g8b8, NULL
},
{ PIXMAN_r5g6b5, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, sse2_fetch_r5g6b5, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, sse2_fetch_r5g6b5, NULL
},
{ PIXMAN_a8, IMAGE_FLAGS, ITER_NARROW,
- _pixman_iter_init_bits_stride, sse2_fetch_a8, NULL
+ _pixman_iter_init_bits_stride_and_accept_buffer_offers, sse2_fetch_a8, NULL
},
{ PIXMAN_null },
};
--
1.8.1.5
More information about the Pixman
mailing list