Age | Commit message (Collapse) | Author | Files | Lines |
|
This test program tries to use as many rarely-used features as
possible, including alpha maps, accessor functions, oddly-sized
images, strange transformations, conical gradients, etc.
The hope is to provoke crashes or irregular behavior in pixman.
|
|
That way we can detect if someone attempts to allocate a negative size
and abort instead of just returning NULL and segfaulting later.
|
|
That way it can be used with palettes that are not statically
allocated, without causing valgrind issues.
|
|
|
|
Test the gradients with various transformations, and test cases where
the gradients are specified with two identical points.
|
|
This function enables floating point traps if possible.
|
|
Also move the ARRAY_LENGTH macro into utils.h so it can be used elsewhere.
|
|
The temporary scanline buffer allocated on stack was declared
as uint8_t array. As a result, the compiler was free to select
any arbitrary alignment for it (even though there is typically
no reason to use really weird alignments here and the stack is
normally at least 4 bytes aligned on most platforms). Having
improper alignment is non-portable and can impact performance
or even make the code misbehave depending on the target platform.
Using uint64_t type for this array should ensure that any possible
memory accesses done by pixman code are going to be handled correctly
(pixman-combine64.c can access this buffer via uint64_t * pointer).
Some alignment related problem was reported in:
http://lists.freedesktop.org/archives/pixman/2010-November/000747.html
|
|
With this optimization added, pixman assisted conversion from
non-premultiplied to premultiplied alpha format is now fully
NEON optimized (both with and without R/B color components
swapping in the process).
|
|
|
|
Not all types of operations can be skipped when having transparent
solid source or transparent solid mask. Add an extra flags parameter
for providing this information to the wrappers.
|
|
|
|
|
|
Provides a minor performance improvement by using pipelining and hiding
instructions latencies. Also do not clobber d0-d3 registers (source
image pixels) while doing calculations in order to allow the use of
the same macro for add_n_8_8888 fast path later.
Benchmark from ARM Cortex-A8 @500MHz:
== before ==
add_8888_8888_8888 = L1: 95.94 L2: 42.27 M: 25.60 (121.09%)
HT: 14.54 VT: 13.13 R: 12.77 RT: 4.49 (48Kops/s)
add_8888_8_8888 = L1: 104.51 L2: 57.81 M: 36.06 (106.62%)
HT: 19.24 VT: 16.45 R: 14.71 RT: 4.80 (51Kops/s)
== after ==
add_8888_8888_8888 = L1: 106.66 L2: 47.82 M: 27.32 (129.30%)
HT: 15.44 VT: 13.96 R: 12.86 RT: 4.48 (48Kops/s)
add_8888_8_8888 = L1: 107.72 L2: 61.02 M: 38.26 (113.16%)
HT: 19.48 VT: 16.72 R: 14.82 RT: 4.80 (51Kops/s)
|
|
|
|
|
|
Renamed suppementary macros from 'over_n_8_0565' to 'over_8888_8_0565',
because they can actually support all variants of this operation:
over_8888_8_0565/over_n_8_0565/over_8888_n_0565.
Also 'over_8888_8_0565' now uses more optimized common code instead of its
own variant, improving performance a bit. Even though this operation is
still memory bandwidth limited, scaled variants of these fast paths may
put more stress on CPU later.
Benchmarked on ARM Cortex-A8 @500MHz:
== before ==
over_8888_8_0565 = L1: 67.10 L2: 53.82 M: 44.70 (105.17%)
HT: 18.73 VT: 16.91 R: 14.25 RT: 4.80 (52Kops/s)
== after ==
over_8888_8_0565 = L1: 77.83 L2: 58.14 M: 44.82 (105.52%)
HT: 20.58 VT: 17.44 R: 15.05 RT: 4.88 (52Kops/s)
|
|
|
|
Code rearranged to get better instructions scheduling for ARM Cortex-A8/A9.
Now it is ~30% faster for the pixel data in L1 cache and makes better use
of memory bandwidth when running at lower clock frequencies (ex. 500MHz).
Also register d24 (pixels from the mask image) is now not clobbered by
supplementary macros, which allows to reuse them for the other variants
of compositing operations later.
Benchmark from ARM Cortex-A8 @500MHz:
== before ==
over_n_8_0565 = L1: 63.90 L2: 63.15 M: 60.97 ( 73.53%)
HT: 28.89 VT: 24.14 R: 21.33 RT: 6.78 ( 67Kops/s)
== after ==
over_n_8_0565 = L1: 82.64 L2: 75.19 M: 71.52 ( 84.14%)
HT: 30.49 VT: 25.56 R: 22.36 RT: 6.89 ( 68Kops/s)
|
|
This macro hides the implementation details of pixels fetching
for the mask image just like 'fetch_src_pixblock' does for the
source image. This provides more possibilities for reusing the
same code blocks in different compositing functions.
This patch does not introduce any functional changes and the
resulting code in the compiled object file is exactly the same.
|
|
|
|
Can be used as one of the solutions to fix bug
https://bugs.freedesktop.org/show_bug.cgi?id=31604
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
One gets rid of this accordingly:
| autoreconf -vfi
| autoreconf: Entering directory `.'
| autoreconf: configure.ac: not using Gettext
| autoreconf: running: aclocal --force
| configure.ac:61: warning: AC_INIT: not a literal: "pixman@lists.freedesktop.org"
| autoreconf: configure.ac: tracing
| configure.ac:61: warning: AC_INIT: not a literal: "pixman@lists.freedesktop.org"
Signed-off-by: Cyril Brulebois <kibi@debian.org>
|
|
|
|
|
|
There are versions for all combinations of x8r8g8b8/a8r8g8b8 and
pad/repeat/none/normal repeat modes. The bulk of each function is an
inline function that takes a format and a repeat mode as parameters.
|
|
Conical gradients are completely opaque if all of their stops are
opaque and the repeat mode is not 'none'.
|
|
Radial gradients are "conical", thus they can have some non-opaque
parts even if all of their stops are completely opaque.
To guarantee that a radial gradient is actually opaque, it needs to
also have one of the two circles containing the other one. In this
case when extrapolating, the whole plane is completely covered (as
explained in the comment in pixman-radial-gradient.c).
|
|
|
|
The performance improvement is only in the ballpark of 5% when
compared against C code built with a reasonably good compiler
(gcc 4.5.1). But gcc 4.4 produces approximately 30% slower code
here, so assembly optimization makes sense to avoid dependency
on the compiler quality and/or optimization options.
Benchmark from ARM11:
== before ==
op=1, src_fmt=10020565, dst_fmt=10020565, speed=34.86 MPix/s
== after ==
op=1, src_fmt=10020565, dst_fmt=10020565, speed=36.62 MPix/s
Benchmark from ARM Cortex-A8:
== before ==
op=1, src_fmt=10020565, dst_fmt=10020565, speed=89.55 MPix/s
== after ==
op=1, src_fmt=10020565, dst_fmt=10020565, speed=94.91 MPix/s
|
|
Benchmark from ARM Cortex-A8 @720MHz:
== before ==
op=1, src_fmt=10020565, dst_fmt=20028888, speed=8.99 MPix/s
== after ==
op=1, src_fmt=10020565, dst_fmt=20028888, speed=76.98 MPix/s
== unscaled ==
op=1, src_fmt=10020565, dst_fmt=20028888, speed=137.78 MPix/s
|
|
Benchmark from ARM Cortex-A8 @720MHz:
== before ==
op=1, src_fmt=20028888, dst_fmt=10020565, speed=42.51 MPix/s
== after ==
op=1, src_fmt=20028888, dst_fmt=10020565, speed=55.61 MPix/s
== unscaled ==
op=1, src_fmt=20028888, dst_fmt=10020565, speed=117.99 MPix/s
|
|
Benchmark from ARM Cortex-A8 @720MHz:
== before ==
op=3, src_fmt=20028888, dst_fmt=10020565, speed=10.29 MPix/s
== after ==
op=3, src_fmt=20028888, dst_fmt=10020565, speed=36.36 MPix/s
== unscaled ==
op=3, src_fmt=20028888, dst_fmt=10020565, speed=79.40 MPix/s
|
|
Benchmark from ARM Cortex-A8 @720MHz:
== before ==
op=3, src_fmt=20028888, dst_fmt=20028888, speed=12.73 MPix/s
== after ==
op=3, src_fmt=20028888, dst_fmt=20028888, speed=28.75 MPix/s
== unscaled ==
op=3, src_fmt=20028888, dst_fmt=20028888, speed=53.03 MPix/s
|
|
Interleaving the use of NEON registers helps to avoid some stalls
in NEON pipeline and provides a small performance improvement.
|
|
This template can be used to instantiate scaled fast path functions
by providing main loop code and calling NEON assembly optimized
scanline processing functions from it. Another macro can be used
to simplify adding entries to fast path tables.
|
|
Now it is possible to generate scanline processing functions
for the case when the source image is scaled with NEAREST filter.
Only 16bpp and 32bpp pixel formats are supported for now. But the
others can be also added later when needed. All the existing NEON
fast path functions should be quite easy to reuse for implementing
fast paths which can work with scaled source images.
|
|
Added a special macro 'pixld_src' which is now responsible for fetching
pixels from the source image. Right now it just passes all its arguments
directly to 'pixld' macro, but it can be used in the future to provide
a special pixel fetcher for implementing nearest scaling.
The 'pixld_src' has a lot of arguments which define its behavior. But
for each particular fast path implementation, we already know NEON
registers allocation and how many pixels are processed in a single block.
That's why a higher level macro 'fetch_src_pixblock' is also introduced
(it's easier to use because it has no arguments) and used everywhere
in 'pixman-arm-neon-asm.S' instead of VLD instructions.
This patch does not introduce any functional changes and the resulting code
in the compiled object file is exactly the same.
|
|
This was mostly harmless and had no effect on little endian systems.
But wrong vector element size is at least inconsistent and also
can theoretically cause problems on big endian ARM systems.
|
|
There is attribute 'constructor' supported since gcc 2.7 which allows
to have a constructor function for library initialization. This eliminates
an extra branch for each composite operation and also helps to avoid
complains from race condition detection tools like helgrind.
The other compilers may or may not support this attribute properly.
Ideally, the compilers should fail to compile the code with unknown
attribute, so the configure check should do the right job. But in
reality the problems are surely possible. Fortunately such problems
should be quite easy to find because NULL pointer dereference should
happen almost immediately if the constructor fails to run.
clang 2.7:
supports __attribute__((constructor)) properly and pretends to be gcc
tcc 0.9.25:
ignores __attribute__((constructor)), but does not pretend to be gcc
|
|
It serves no purpose anymore now that the source_class_t field is gone.
|
|
GCC assumes that input variables in inline assembly are fully consumed
before any output variable is written. This means it may allocate the
variables in the same register unless the output variables are marked
as early-clobber.
From Jeremy Huddleston:
I noticed a problem building pixman with clang and reported it to
the clang developers. They responded back with a comment about
the inline asm in pixman-mmx.c and suggested a fix:
"""
Incidentally, Jeremy, in the asm that reads
__asm__ (
"movq %7, %0\n"
"movq %7, %1\n"
"movq %7, %2\n"
"movq %7, %3\n"
"movq %7, %4\n"
"movq %7, %5\n"
"movq %7, %6\n"
: "=y" (v1), "=y" (v2), "=y" (v3),
"=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7)
: "y" (vfill));
all the output operands except the last one should be marked as
earlyclobber ("=&y"). This is working by accident with gcc.
"""
Cc: jeremyhu@apple.com
Reviewed-by: Matt Turner <mattst88@gmail.com>
|
|
There used to be a bug in the X server where it would rely on
out-of-bounds accesses when it was asked to composite with a
window as the source. It would create a pixman image pointing
to some bogus position in memory, but then set a clip region
to the position where the actual bits were.
Due to a bug in old versions of pixman, where it would not clip
against the image bounds when a clip region was set, this would
actually work. So when the pixman bug was fixed, a workaround was
added to allow certain out-of-bound accesses.
However, the 1.6 X server is so old now that we can remove this
workaround. This does mean that if you update pixman to 0.22 or later,
you will need to use a 1.7 X server or later.
|
|
Somehow the patch from [1] was not applied correctly, fixing that.
1. http://lists.cairographics.org/archives/cairo/2010-September/020826.html
|
|
Also put the copyright text into a C comment for easier cut and paste.
|
|
The previous bump to 0.20.1 was a mistake; it belongs on the 0.20 branch.
|
|
|
|
|
|
|