Age | Commit message (Collapse) | Author | Files | Lines |
|
This function returns the name of the given format code, which is
useful for printing out debug information. The function is written as
a switch without a default value so that the compiler will warn if new
formats are added in the future. The fake formats used in the fast
path tables are also recognized.
The function is used in alpha_map.c, where it replaces an existing
format_name() function, and in blitters-test.c, affine-test.c, and
scaling-test.c.
|
|
This function returns the name of the given operator, which is useful
for printing out debug information. The function is done as a switch
without a default value so that the compiler will warn if new
operators are added in the future.
The function is used in affine-test.c, scaling-test.c, and
blitters-test.c.
|
|
Wallclock time for running pixman "make check" (compile time not included):
----------------------------+----------------+-----------------------------+
| old PRNG (LCG) | new PRNG (Bob Jenkins) |
Processor type +----------------+------------+----------------+
| gcc 4.5 | gcc 4.5 | gcc 4.7 (simd) |
----------------------------+----------------+------------+----------------+
quad Intel Core i7 @2.8GHz | 0m49.494s | 0m43.722s | 0m37.560s |
dual ARM Cortex-A15 @1.7GHz | 5m8.465s | 4m37.375s | 3m45.819s |
IBM Cell PPU @3.2GHz | 23m0.821s | 20m38.316s | 16m37.513s |
----------------------------+----------------+------------+----------------+
But some tests got a particularly large boost. For example benchmarking and
profiling blitters-test on Core i7:
=== before ===
$ time ./blitters-test
real 0m10.907s
user 0m55.650s
sys 0m0.000s
70.45% blitters-test blitters-test [.] create_random_image
15.81% blitters-test blitters-test [.] compute_crc32_for_image_internal
2.26% blitters-test blitters-test [.] _pixman_implementation_lookup_composite
1.07% blitters-test libc-2.15.so [.] _int_free
0.89% blitters-test libc-2.15.so [.] malloc_consolidate
0.87% blitters-test libc-2.15.so [.] _int_malloc
0.75% blitters-test blitters-test [.] combine_conjoint_general_u
0.61% blitters-test blitters-test [.] combine_disjoint_general_u
0.40% blitters-test blitters-test [.] test_composite
0.31% blitters-test libc-2.15.so [.] _int_memalign
0.31% blitters-test blitters-test [.] _pixman_bits_image_setup_accessors
0.28% blitters-test libc-2.15.so [.] malloc
=== after ===
$ time ./blitters-test
real 0m3.655s
user 0m20.550s
sys 0m0.000s
41.77% blitters-test.n blitters-test.new [.] compute_crc32_for_image_internal
15.77% blitters-test.n blitters-test.new [.] prng_randmemset_r
6.15% blitters-test.n blitters-test.new [.] _pixman_implementation_lookup_composite
3.09% blitters-test.n libc-2.15.so [.] _int_free
2.68% blitters-test.n libc-2.15.so [.] malloc_consolidate
2.39% blitters-test.n libc-2.15.so [.] _int_malloc
2.27% blitters-test.n blitters-test.new [.] create_random_image
2.22% blitters-test.n blitters-test.new [.] combine_conjoint_general_u
1.52% blitters-test.n blitters-test.new [.] combine_disjoint_general_u
1.40% blitters-test.n blitters-test.new [.] test_composite
1.02% blitters-test.n blitters-test.new [.] prng_srand_r
1.00% blitters-test.n blitters-test.new [.] _pixman_image_validate
0.96% blitters-test.n blitters-test.new [.] _pixman_bits_image_setup_accessors
0.90% blitters-test.n libc-2.15.so [.] malloc
|
|
The 'lcg' prefix is going to be misleading if we replace
PRNG algorithm.
|
|
Comment out some formats in blitters-test that are going to rely on
floating point in some upcoming patches.
|
|
In general, the component alpha version of an operator is supposed to
do this:
- multiply source with mask in all channels
- multiply mask with source alpha in all channels
- compute the regular operator in all channels using the
mask value whenever source alpha is called for
The first two steps are usually accomplished with the function
combine_mask_ca(), but for operators where source alpha is not used,
such as SRC, ADD and OUT, the simpler function
combine_mask_value_ca(), which doesn't compute the new mask values,
can be used.
However, the PDF blend modes generally *do* make use of source alpha,
so they can't use combine_mask_value_ca() as they do now. They have to
use combine_mask_ca().
This patch fixes this in combine_multiply_ca() and the CA combiners
generated by PDF_SEPARABLE_BLEND_MODE.
|
|
This way it can be used in other tests.
|
|
We need to compute floor (a/b * 255 + 0.5), not floor (a / b * 255),
so add b/2 to the numerator in the DIV_UNc() macro.
|
|
In pixman-fast-path.c: (1 << 31) - 1 causes a signed overflow, so
change to (1U << n) - 1.
In pixman-image.c: The check for whether m10 == -m01 will overflow
when -m01 == INT_MIN. Instead just check whether the variables are 1
and -1.
In pixman-utils.c: When the depth of the topmost channel is 0, we can
end up shifting by 32.
In blitters-test.c: Replicating the mask would end up shifting more
than 32.
In region-contains-test.c: Computing the average of two large integers
could overflow. Instead add half the difference between them to the
first integer.
In stress-test.c: Masking the value in fake_reader() would sometimes
shift by 32. Instead just use the most significant bits instead of
the least significant.
All these issues were found by the IOC tool:
http://embed.cs.utah.edu/ioc/
|
|
In the macros for the PDF blend modes, two comp1_t variables are
multiplied together and then used as if the result were a
comp4_t. When comp1_t is a uint8_t, this is fine because they are
promoted to int, and the product of two uint8_ts fits in an
int. However, when comp1_t is uint16, the product does not necessarily
fit in an int, so casts are necessary.
Fix for bug 43906, reported by Siarhei Siamashka.
|
|
This patch has been generated by the following Coccinelle semantic patch:
// Use the ARRAY_LENGTH() macro when possible
//
// Replace open-coded array length computations with the
// ARRAY_LENGTH() macro
@@
type T;
T[] E;
@@
- (sizeof(E)/sizeof(T))
+ ARRAY_LENGTH (E)
|
|
All the tests are linked to libutil, hence it makes sence to always
include utils.h and reuse what it provides (config.h inclusion, access
to private pixman APIs, ARRAY_LENGTH, ...).
|
|
To test that reductions of BILINEAR->NEAREST for identity
transformations happen correctly, occasionally use a bilinear filter
in blitters test.
|
|
The win32 build system does not generate config.h and correctly runs
the compiler without defining HAVE_CONFIG_H. Nevertheless some files
include config.h without checking for its availability, breaking the
build from a clean directory:
test\utils.h(2) : fatal error C1083: Cannot open include file:
'config.h': No such file or directory
...
|
|
Move the eight most common formats to the top of the list of image
formats and make create_random_image() much more likely to select one
of those eight formats.
This should help catch more bugs in SIMD optimized operations.
|
|
|
|
There is no reason to pass in the bpp as an argument; it can be gotten
directly from the image.
|
|
Green Hills Software MULTI compiler was producing a number
of warnings due to incorrect uses of int instead of the correct
corresponding pixman_*_t type.
|
|
|
|
The first broken optimization is that it checks "a != 0x00" where it
should check "s != 0x00". The other is that it skips the computation
when alpha is 0xff. That is wrong because in the formula:
min (1, (1 - Aa)/Ab)
the render specification states that if Ab is 0, the quotient is
defined to positive infinity. That is the case even if (1 - Aa) is 0.
|
|
The aligned_malloc() routine will be used in more than one test utility.
At least, a low-level blitter benchmark needs it. Therefore, let's make
this function a part of common test utilities code.
|
|
Added a pair of macros which can help to detect corruption
of floating point registers after a function call. This may
happen if _mm_empty() call is forgotten in MMX/SSE2 fast
path code, or ARM NEON assembly optimized function
forgets to save/restore d8-d15 registers before use.
|
|
|
|
Indexed formats are mapped to a8r8g8b8 with full precision, so when
expanding we shouldn't correct for the width of the channels
|
|
The palettes for indexed formats must satisfy the condition that if
some index maps to a color C, then the 15 bit version of that color
must map back to the index. This ensures that the destination operator
is always a no-op, which seems like a reasonable assumption to make.
|
|
For gray formats the palettes are indexed by luminance, not RGB, so we
can't use the color storers for gray too.
|
|
|
|
|
|
The indexed formats have 0 bits of alpha, but can't be considered
opaque because there may be non-opaque colors in the palette.
|
|
In some cases we end up trying to use the STORE_4 macro with an 8 bit
values, which resulted in other pixels getting overwritten. Fix this
by always masking off the low 4 bits.
This fixes blitters-test on big-endian machines.
|
|
These formats work fine, they just need to have a palette set.
|
|
|
|
|
|
Pointed out by scottmc2@gmail.com in bug 25137.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When masking out the x bits, blitter-test would make the incorrect
assumption that the they were always in the topmost position. This is
not correct for formats of type PIXMAN_TYPE_BGRA.
|
|
Fall back to malloc() in blitters-test.c if we don't.
|
|
At this point, the SIMD, SSE2, MMX and general implementations all
agree.
|
|
|
|
|
|
The crashes and valgrind issues are all fixed at this point.
|
|
allocations in order in order to make reproducibility
of alignment sensitive bugs more deterministic
Also testing of masks is reenabled
|
|
|
|
The code and overall method is mostly based on scaling-test. This one
focuses on trying to stress as many different color formats and types
of composition operations as possible.
This is an initial implementation which may need more tuning. Also
not all color format and operator combinations are actually used.
When cpu specific optimizations are disabled, this test provides
identical deterministic results on x86, PPC and ARM.
Script blitters-test-bisect.rb now works in non-stop mode, until
it finds any problem. This allows to run it for example overnight
in order to test a lot more variants of pixman calls and increase
chances of detecting problems in pixman. Just like with scaling-test,
running blitters-test binary alone with no command line arguments
runs a small predefined number of tests and compares checksum
with a reference value for quick verification.
|