Compare commits

...

137 Commits

Author SHA1 Message Date
Dylan Aïssi
b85678a8de debian/copyright: Convert to machine-readable format 2025-07-31 22:22:45 +02:00
Timo Aaltonen
7d26aad890 releasing package pixman version 0.44.0-3 2024-11-09 11:03:01 +02:00
Timo Aaltonen
07627e9f31 Replace timeout bump patch by using a multiplier option instead. Thanks, Aurelien Jarno! (Closes: #1086999) 2024-11-09 11:02:51 +02:00
Timo Aaltonen
dc43d37962 releasing package pixman version 0.44.0-2 2024-11-08 09:58:31 +02:00
Timo Aaltonen
c05da7d917 patches: Increase test timeout 120->240s. (Closes: #1086999) 2024-11-08 09:53:41 +02:00
Timo Aaltonen
e55fd151a2 releasing package pixman version 0.44.0-1 2024-11-07 16:48:34 +02:00
Timo Aaltonen
7d5149536f rules: Drop obsolete dbgsym-migration. 2024-11-07 15:54:27 +02:00
Timo Aaltonen
2ad078304f control: Migrate to pkgconf. 2024-11-07 15:53:40 +02:00
Timo Aaltonen
7cca9d2d9a symbols: Updated. 2024-11-07 15:45:25 +02:00
Timo Aaltonen
c8cb00a5ad control, rules: Build with meson. 2024-11-07 15:45:17 +02:00
Timo Aaltonen
b87363cd49 patches: Refresh patch. 2024-11-07 14:31:18 +02:00
Timo Aaltonen
2e58ff85bd version bump 2024-11-07 14:30:41 +02:00
Timo Aaltonen
31b00cc770 Merge branch 'upstream-unstable' into debian-unstable 2024-11-07 14:29:36 +02:00
Matt Turner
ae6646f159 Pre-release version bump to 0.44.0 2024-11-05 11:51:31 -05:00
Lance Arsenault
126d61e796 pixman: Add library destructor
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/111
2024-11-05 04:31:04 +00:00
f wasil
a987256be8 Fixed memory leak in tests 2024-11-05 03:39:54 +00:00
f wasil
0e424031bd RISC-V floating point operations 2024-10-30 03:39:37 +00:00
Changqing Li
643f098a39 pixman-combine-float.c: fix inlining failed error
Refer [1], always-inline is not suggested to be used if you have indirect
calls. so replace force_inline with inline to fix error like:
In function ‘combine_inner’,
    inlined from ‘combine_soft_light_ca_float’ at ../pixman/pixman-combine-float.c:655:511:
../pixman/pixman-combine-float.c:655:211: error: inlining failed in call to ‘always_inline’ ‘combine_soft_light_c’: function not considered for inlining

Test with gcc-9 and gcc-14, both works well

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115679

Signed-off-by: Changqing Li <changqing.li@windriver.com>
2024-10-30 01:34:41 +00:00
Marek Pikuła
90f9cf1726
ci: Disable coverage for arm-v5 and mipsel targets
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-21 16:49:50 +02:00
Marek Pikuła
bc2ec45d3b
ci: Add auto_cancel policy
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-21 16:49:41 +02:00
Marek Pikuła
de59d1a9fb
ci: Don't execute failing jobs
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-21 16:49:40 +02:00
Marek Pikuła
15336dc7cd
ci: Pin gcovr version to 7.x
Temporary version pin of gcovr due to errors in coverage report
generation when running with newly released version 8.x.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-21 13:17:47 +02:00
Marek Pikuła
0476eda33a
ci: Remove MESON_TESTTHREADS workaround
https://github.com/mesonbuild/meson/pull/13604 got merged and released
with Meson 1.6.0, which we already use in the Docker images, so the
workaround can be dropped.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-21 13:17:25 +02:00
Marek Pikuła
11e51bc72f
ci: Disable OpenMP for Win32 target
OpenMP introduces random stack overflow errors for 32-bit Windows
target.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-10-14 16:12:44 +02:00
Marek Pikuła
277f485a9c
ci: Add missing ":failing" suffix for linux-ppc job
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-27 00:22:55 +02:00
Marek Pikuła
126b083142
ci: Add option to use different version of LLVM
Some targets require different version of LLVM, so now it's possible to
set it in the target's environment. Mind that the highest available
version depends on the base Debian image.

The change bumps LLVM version for all Linux targets:
- by default from 14 to 16,
- from 16 to 18 for riscv64 (based on Sid; for now, LLVM 19 doesn't have
  libomp packaged),
- mipsel stays at 14 as there seem to be some missing packages for
  higher versions.

Windows targets stay the same, as they use a different source of LLVM
(MinGW-compatible, which is currently version 18).

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-27 00:22:54 +02:00
Marek Pikuła
a3d297fa46
ci: riscv64: Verify if tests run on target without RVV
To ensure that the runtime discovery works correctly, and RVV code is
disabled for target without RVV extension.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-26 23:33:52 +02:00
Marek Pikuła
9176847f1d
ci: riscv64: Don't force enable RVV globally
RVV compilation will be enabled for RVV implementation alone, similar to
other platforms. This prevents introducing autovectorized code in the
main library, thus making pixman compatible with RISC-V targets without
RVV.
2024-09-26 23:33:52 +02:00
Marek Pikuła
76b133f293
ci: Fix active target rule for Docker stage
If rule condition for selectively running Docker image builds was ill
formed. It resulted in build of all images even when not all targets
were selected with ACTIVE_TARGET_PATTERN variable.
2024-09-26 21:54:21 +02:00
Marek Pikuła
b7ac7cd122
ci: Fix Docker image source for MRs
If the MR doesn't modify the Docker context, the pipeline should use the
image from upstream.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-25 20:20:08 +02:00
Marek Pikuła
ffa5645a2d
ci: Add support for Windows on ARM
It uses LLVM MinGW pre-built toolchain, and wine-arm64 base Docker image
from Linaro.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-03 18:21:02 +02:00
Marek Pikuła
51dcfb8027
ci: Add support for LLVM for Windows targets
It uses LLVM MinGW project to get the precompiled LLVM toolchain for
cross-compilation.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-03 18:21:01 +02:00
Marek Pikuła
c0ee08aab0
ci: Add LLVM support to the CI workflow
Add support for LLVM for all targets. Mind that in the current state,
some targets fail either build or test stage. For the time being, these
jobs are marked with `:failing` job name suffix.

Relevant issues:
- https://gitlab.freedesktop.org/pixman/pixman/-/issues/105
- https://gitlab.freedesktop.org/pixman/pixman/-/issues/106
- https://gitlab.freedesktop.org/pixman/pixman/-/issues/107
- https://gitlab.freedesktop.org/pixman/pixman/-/issues/108
- https://gitlab.freedesktop.org/pixman/pixman/-/issues/109
2024-09-03 18:21:00 +02:00
Marek Pikuła
44927bf1e1
ci: Unify build and test stage as job templates
This commit unifies codecov and pltcov build and test stages as single
parametrizable GitLab job templates. This cleans up the pipeline flow in
preparation for LLVM support in the pipeline.

Each target has now a Meson cross file, even when using a native
compiler, so that the job template can be better generalized. This also
allows to move architecture-specific build configuration to the cross
file instead of using the additional Meson flags in the job declaration.
2024-09-03 18:20:59 +02:00
Marek Pikuła
19b1a98e8d
ci: Unify Docker image as multi-stage build
This commit merges codecov and pltcov Dockerfiles into a single,
multi-stage Dockerfile. This results in more streamlined Docker image
builds with some common layers which can be reused by multiple images.

Also, by making a common Dockerfile, all common dependencies have the
same exact description, which decreases disparity between different
images for all the supported architectures. Mind that package version
disparity cannot be prevented 100%, as different base images may be used
for different architectures (e.g., Debian Sid for riscv64 instead of
Bookworm).

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-03 18:20:58 +02:00
Marek Pikuła
028213b588
ci: Unify target enable flag
It replaces CODE- and PLT- specific target enable variables. It is a
ground work for unification of codecov and pltcov flows.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-03 18:20:57 +02:00
Marek Pikuła
05b5ecd934
ci: Use env files instead of awk script
It makes per-targe environment declaration more extensible, as it's
possible now to set custom env variables only for the selected target
for the entire pipeline workflow in a centralized way.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-09-03 18:20:56 +02:00
Julia DeMille
726d77f6fe mmx: Fix compilation with clang-cl 2024-09-03 00:35:47 +00:00
Marek Pikuła
0cb4fbe324
ci: Fix Docker change detection
There was a missing wildcard for Docker directory
change detection, so basically this rule was not
checked correctly.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-21 18:46:07 +02:00
Marek Pikuła
4047a553d9
ci: Add platform coverage targets
Platform coverage checks if the code builds and executes properly for
architectures that are not officially supported by Debian. They don't
contribute to general code coverage report but provide a valuable
insight if all supported platforms are working correctly.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-20 18:05:44 +02:00
Marek Pikuła
cbf9d7e0d3
ci: Add architecture coverage Docker images
Add images providing an environment for architecture coverage tests.
There is a separate build for Linux and Windows, as the Windows image is
really large compared to Linux one. It decreases the execution time of
both targets, as the images needed to be pulled by runners are smaller.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-16 20:15:30 +02:00
Marek Pikuła
c35e47bd88
ci: Increase granularity of Docker build selection
Now, it's possible to selectively disable Docker image builds. Before,
it was only possible to disable build/test jobs for a given
architecture.
2024-08-16 20:10:21 +02:00
Marek Pikuła
e7ef051a6d
ci: Build and test on the supported platforms
This commit introduces a build and test CI workflow, which tests the
correctness of execution for nearly all configurations supported by
pixman. The notable exception is ARM iWMMXt, which is omitted as it's
soon to be deprecated as mentioned in #98.

The build and test stage is separated, as a single build can be used to
test multiple configurations for a given platform (e.g., MMX, SSE2,
SSSE3 for x86).

Execution is performed using multi-arch Docker images built in the
`docker` stage. The important thing to note is that the runner needs to
have a relatively recent version of Docker and QEMU, and needs to have
the qemu-user-static+binfmt execution enabled.

Once all tests are complete, coverage reports are merged together in the
`summary` stage. Then the result can be used in a GitLab-native coverage
report summary.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-16 20:04:49 +02:00
Marek Pikuła
2d35a8769c
mips: Add option to force MIPS CPU feature discovery
Used to force feature discovery in CI where /proc/cpuinfo is unreliable.
It can happen, e.g., if executed in qemu-user-static mode.

For such a build, MIPS-specific features need to be manually disabled by
using `PIXMAN_DISABLE` env variable.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-16 20:03:29 +02:00
Marek Pikuła
15af6fd0bc
mips: Widen CPU family check for DSPr2
DSPr2 can be available for targets other than mips32. Some distros
(e.g., Debian) don't support mips32 but still support mipsel. Extending
the check enables use of such images for testing.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-16 20:03:28 +02:00
Marek Pikuła
a7263190c2
ci: Add multiarch Docker image build
The image is used in CI pipeline to build and test on different
architectures.

This commit introduces more extensible GitLab CI scheme borrowed from
qemu project.

Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-16 20:03:19 +02:00
Marek Pikuła
b753a6f49b
mips: Fix a typo in mips_dspr2_flags
Signed-off-by: Marek Pikuła <m.pikula@partner.samsung.com>
2024-08-14 14:13:07 +02:00
Even Rouault
6410ec79bd pixman-combine-float.c: fix typo in MAKE_NON_SEPARABLE_PDF_COMBINERS()
There's a copy&paste typo updating sc.g twice when there's a mask
2024-08-14 02:48:25 +00:00
Marco Trevisan
5b8e928139 pixman-region: Make translate a no-op when using 0 offsets
This avoids callers to have to optimize this codepath, in case this scenario happens.
And definitely it may happen when the function is not explicitly called.
2024-08-14 02:41:08 +00:00
Matt Turner
2e29b7c43d iwmmxt: Drop support
In all likelyhood unused for at least many years, and possibly ever.

Support is deprecated and will be removed in gcc-15. See deprecation
notice in https://gcc.gnu.org/gcc-13/changes.html

Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/98
2024-08-13 13:51:36 -04:00
Peter Hutterer
e5f8efc4c7 ci: add workflow rules to allow for MR pipelines
See
https://gitlab.freedesktop.org/freedesktop/freedesktop/-/wikis/GitLab-CI#for-project-developers
2024-08-07 09:59:34 +10:00
Bill Roberts
7ed0f8d04d
aarch64: support PAC and BTI
Enable Pointer Authentication Codes (PAC) and Branch Target
Identification (BTI) support for ARM 64 targets.

PAC works by signing the LR with either an A key or B key and verifying
the return address. There are quite a few instructions capable of doing
this, however, the Linux ARM ABI is to use hint compatible instructions
that can be safely NOP'd on older hardware and can be assembled and
linked with older binutils. This limits the instruction set to paciasp,
pacibsp, autiasp and autibsp. Instructions prefixed with pac are for
signing and instructions prefixed with aut are for signing. Both
instructions are then followed with an a or b to indicate which signing
key they are using. The keys can be controlled using
-mbranch-protection=pac-ret for the A key and
-mbranch-protection=pac-ret+b-key for the B key.

BTI works by marking all call and jump positions with bti c and bti
j instructions. If execution control transfers to an instruction other
than a BTI instruction, the execution is killed via SIGILL. Note that
to remove one instruction, the aforementioned pac instructions will
also work as a BTI landing pad for bti c usages.

For BTI to work, all object files linked for a unit of execution,
whether an executable or a library must have the GNU Notes section of
the ELF file marked to indicate BTI support. This is so loader/linkers
can apply the proper permission bits (PROT_BRI) on the memory region.

PAC can also be annotated in the GNU ELF notes section, but it's not
required for enablement, as interleaved PAC and non-pac code works as
expected since it's the callee that performs all the checking. The
linker follows the same rules as BTI for discarding the PAC flag from
the GNU Notes section.

Testing was done under the following CFLAGS and CXXFLAGS for all
combinations:
1. -mbranch-protection=none
2. -mbranch-protection=standard
3. -mbranch-protection=pac-ret
4. -mbranch-protection=pac-ret+b-key
5. -mbranch-protection=bti

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2024-07-22 16:57:13 -05:00
Bill Roberts
3a32506877
arm: add include guards on header
Prevent double inclusion of header file.

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
2024-07-22 16:57:13 -05:00
Mike Hommey
865e6ce00b pixman: Adjust arm assembly for binutils change
A change in the latest version of binutils broke building pixman for arm.

The binutils change:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b

Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/96
2024-07-12 15:55:33 -04:00
Matt Turner
b252d40714 Post-release version bump to 0.43.5 2024-02-29 11:19:46 -05:00
Matt Turner
54cad71674 Pre-release version bump to 0.43.4 2024-02-29 11:13:20 -05:00
Matt Turner
add7c8db45 pixman-arm: Use unified syntax
Allows us to use the same assembly without a bunch of #ifdef __clang__.
2024-02-29 10:47:07 -05:00
Makoto Kato
63ae6af9a6 pixman-arm: Fix build on clang/arm32
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/74
2024-02-29 10:47:00 -05:00
Matt Turner
033716e99a Revert "Allow to build pixman on clang/arm32"
This reverts merge request !78
2024-02-29 15:41:37 +00:00
Heiko Lewin
74130e84c5 Allow to build pixman on clang/arm32 2024-02-29 14:46:55 +00:00
Matt Turner
63332b4e72 pixman-x86: Move #include "cpuid.h" inside conditionals
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/93
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/94
2024-02-25 17:28:14 -05:00
Matt Turner
8c6d59a9f8 pixman-x86: Use cpuid.h header 2024-02-24 12:36:53 -05:00
Gayathri Berli
ac485a9b66 Revert the changes to fix the problem in big-endian architectures
This reverts commit b4a105d772.

There is an endianness issue in pixman-fast-path.c. In the function
bits_image_fetch_separable_convolution_affine we have this code:

#ifdef WORDS_BIGENDIAN
	buffer[k] = (satot << 0) | (srtot << 8) | (sgtot << 16) | (sbtot << 24);
#else
	buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0);
#endif

This will write out the pixels as BGRA on big endian systems but
obviously that's wrong. Pixel order should be ARGB on big endian systems
so we don't need any #ifdef for big endian here at all. Instead, the
code should be the same on little and big endian, i.e. it should be just
this line instead of the 5 lines above:

	buffer[k] = (satot << 24) | (srtot << 16) | (sgtot << 8) | (sbtot << 0);

Changing the code like this fixes the wrong colors that I get with
pixman on my PowerPC/s390x system.

Here is what cairo.h has to say (which is rooted in pixman):

 * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with
 *   alpha in the upper 8 bits, then red, then green, then blue.
 *   The 32-bit quantities are stored native-endian. Pre-multiplied
 *   alpha is used. (That is, 50% transparent red is 0x80800000,
 *   not 0x80ff0000.) (Since 1.0)

Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/78
Signed-off-by: Gayathri Berli <gayathri.berli@ibm.com>
2024-02-24 12:28:30 -05:00
Simon Ser
fdd7161097 Post-release version bump to 0.43.3 2024-01-28 13:32:42 +01:00
Simon Ser
91b8526c1e Pre-release version bump to 0.43.2 2024-01-28 13:26:31 +01:00
Simon Ser
e8bb34e302 Drop contrib/ci.sh
This is unused and outdated (Autotools is no longer supported).

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-28 12:23:29 +00:00
Simon Ser
43773c69db Drop ChangeLog
This file is empty and unused.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-28 12:22:00 +00:00
Simon Ser
8c39ce2437 Drop automatic DEBUG define
We don't use the historical odd stable release numbering scheme
anymore.

Developers can still enable this debugging code via CFLAGS=-DDEBUG.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/87
2024-01-27 13:15:28 +01:00
Simon Ser
8e4be8c2db Post-release version bump to 0.43.1
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-04 11:48:38 +01:00
Simon Ser
6c2e4a0dd9 Pre-release version bump to 0.43.0
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-04 11:01:05 +01:00
Matt Turner
396e1a76ed test: Use fabsl on float128 2024-01-03 21:40:12 -05:00
Matt Turner
7e76c96281 pixman-access: Mark __dummy__ variables with MAYBE_UNUSED 2024-01-03 21:24:46 -05:00
Matt Turner
af101d3c21 pixman-mmx: Don't redefine _MM_SHUFFLE 2024-01-03 21:24:46 -05:00
Matt Turner
20cc4ee0e9 pixman-sse2: Remove unused functions 2024-01-03 21:24:46 -05:00
Simon Ser
7883ab8d63 ci: upgrade to Fedora 39
Fedora 28 is super old.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-12-15 13:21:09 +01:00
Pavel Labath
86f9162332 Fix alignment problem in pixman-fast-path.c
The variable is accessed through uint32_t pointer, so it needs to be
aligned to avoid undefined behavior (crashes on architectures which
require aligned accesses).

Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/84
2023-12-15 13:10:52 +01:00
Benjamin Gilbert
b4b789df5b meson: avoid linking with -pthread if we don't have pthreads
Meson always returns -pthread in dependency('threads') on non-MSVC
compilers.  Fix a link error when building on MinGW without winpthreads.
2023-11-08 18:43:10 +00:00
Sam James
08115a4217
pixman-bits-image: fix -Walloc-size
GCC 14 introduces a new -Walloc-size included in -Wextra which gives (when forced
to be an error):
```
../pixman/pixman-bits-image.c: In function ‘create_bits’:
../pixman/pixman-bits-image.c:1273:16: error: allocation of insufficient size ‘1’ for type ‘uint32_t’ {aka ‘unsigned int’} with size ‘4’ [-Werror=alloc-size]
 1273 |         return calloc (buf_size, 1);
      |                ^~~~~~~~~~~~~~~~~~~~
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 element of size `buf_size`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
2023-11-07 22:31:05 +00:00
Havard Eidnes
47a1c3d330 vmx: Reimplement create_mask_32_128 and use it in vmx_fill
Based on suggestion from @siamashka.

This lets the compiler pick the vector instruction to use which is
usually the best idea.

Use create_mask_32_128() instead of create_mask_1x32_128() in
vmx_fill(), avoiding loading memory beyond the filler argument on the
stack.

Remove the now-unused create_mask_1x32_128(). This gets rid of some
(correct) warnings from the compiler about indexing beyond the variable
in question.
2023-08-30 12:14:40 -04:00
Havard Eidnes
634b8196d2 vmx: Simplify scaled_nearest_scanline_vmx_8888_8888_OVER
Since combine4() does not take vector variables as arguments, there's no
need to use a vector variable and casts back and forth to normal scalars
for the arguments.
2023-08-30 12:14:26 -04:00
Matt Turner
753f5e095e meson: Fix syntax 2023-08-30 11:58:04 -04:00
Simon Ser
7aeeb501ad Fix const warnings in pixman_image_set_clip_region()
Fixes the following warnings:

    pixman-image.c: In function 'pixman_image_set_clip_region':
    pixman-image.c:601:81: warning: passing argument 2 of 'pixman_region32_copy_from_region16' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      601 |         if ((result = pixman_region32_copy_from_region16 (&common->clip_region, region)))
          |                                                                                 ^~~~~~
    In file included from pixman-image.c:32:
    pixman-private.h:859:56: note: expected 'pixman_region16_t *' {aka 'struct pixman_region16 *'} but argument is of type 'const pixman_region16_t *' {aka 'const struct pixman_region16 *'}
      859 |                                     pixman_region16_t *src);
          |                                     ~~~~~~~~~~~~~~~~~~~^~~
    pixman-utils.c:240:1: error: conflicting types for 'pixman_region16_copy_from_region32'; have 'pixman_bool_t(pixman_region16_t *, pixman_region32_t *)' {aka 'int(struct pixman_region16 *, struct pixman_region32 *)'}
      240 | pixman_region16_copy_from_region32 (pixman_region16_t *dst,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from pixman-utils.c:31:
    pixman-private.h:862:1: note: previous declaration of 'pixman_region16_copy_from_region32' with type 'pixman_bool_t(pixman_region16_t *, const pixman_region32_t *)' {aka 'int(struct pixman_region16 *, const struct pixman_region32 *)'}
      862 | pixman_region16_copy_from_region32 (pixman_region16_t *dst,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    pixman-utils.c:270:1: error: conflicting types for 'pixman_region32_copy_from_region16'; have 'pixman_bool_t(pixman_region32_t *, pixman_region16_t *)' {aka 'int(struct pixman_region32 *, struct pixman_region16 *)'}
      270 | pixman_region32_copy_from_region16 (pixman_region32_t *dst,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from pixman-utils.c:31:
    pixman-private.h:858:1: note: previous declaration of 'pixman_region32_copy_from_region16' with type 'pixman_bool_t(pixman_region32_t *, const pixman_region16_t *)' {aka 'int(struct pixman_region32 *, const struct pixman_region16 *)'}
      858 | pixman_region32_copy_from_region16 (pixman_region32_t *dst,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-08-30 15:49:50 +00:00
Matt Turner
7169c0404f Use more Markdown-friendly syntax 2023-08-30 11:15:00 -04:00
Matt Turner
f1072b07eb Remove generic build system information 2023-08-30 11:14:04 -04:00
Gauthier Östervall
2cf9ae1cea Update build instructions to meson and ninja 2023-08-30 11:12:41 -04:00
Dylan Baker
72c4245b2e delete win32 make files
meson can handle building for win32 (including using visual studio, and
mingw), and does a good deal more than these could. Since we're dropping
autotools, we might as well drop these too.
2023-08-30 10:54:46 -04:00
Dylan Baker
55eb680a1f autotools: remove autotools
At this point meson is pretty well tested and seems to pretty much work,
so we can consider dropping an extra build system.

This doesn't solve the problem that pixman's release scripts are part of
the autotools build system (as make targets). One solution might be to
use xorg's release.sh instead.
2023-08-30 10:51:27 -04:00
Matt Turner
593a970266 test: Revert to including pixman-private.h
This broke the Visual Studio builds in GTK's CI system.
2023-07-19 15:08:22 -04:00
Heiko Lewin
67490a8bc1
pixman-arma64: Adjustments to build with llvm integrated assembler
This enables building the aarch64 assembly with clang.
Changes:
1. Use `.func` or `.endfunc` only if available
2. Prefix macro arg names with `\` 
3. Use `\()` instead of `&`
4. Always use commas to separate macro arguments
5. Prefix asm symbols with an undderscore if necessary
2023-07-18 07:20:01 +02:00
Benjamin Gilbert
47d3fbe38f mmx: use xmmintrin.h if building with SSE2
As of mingw-w64 commit 463f00975, winnt.h includes emmintrin.h when
compiling with SSE2, causing redefinition errors for our copied MMX
intrinsics.  If the build is assuming SSE2 anyway, just use the system
header instead.
2023-07-09 01:56:40 +00:00
Simon Ser
55845c3dd3 Constify pixman_image_set_clip_region()
This function copies the region passed in.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-07-09 01:53:48 +00:00
Simon Ser
672f67db96 Add pixman_region{,32}_empty()
Inverse of pixman_region32_not_empty().

Most of the time, callers want to check whether a region is empty,
not whether a region is not empty. This results in code with
double-negatives such as !pixman_region32_not_empty(), which is
confusing to read.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-07-09 01:48:29 +00:00
Benjamin Gilbert
48d5df1f37 meson: don't dllexport when built as static library
If a static Pixman is linked with a dynamic library, Pixman shouldn't
export its own symbols into the latter's ABI.
2023-07-08 17:36:00 -04:00
Emanuel Schmidt
e4c878d179 Fixed missing dependency in libdemo
After the latest changes and separation of demo- and test-targets,
it was visible that a dependency towards `libtestutils_dep` was
missing in one of the demo-dependencies. This change will fix
this particular problem.
2023-02-17 18:52:14 +01:00
Emanuel Schmidt
ee145e53d1 Changed name of the config-header to "pixman-config.h" 2023-02-14 22:20:12 +01:00
Emanuel Schmidt
eb998d7b65 Separate meson build options for demos and tests 2023-02-08 20:56:05 +01:00
Emilio Pozuelo Monfort
a7a919b881 Release to sid 2022-11-11 13:42:32 +01:00
Emilio Pozuelo Monfort
a4e8d8901f Remove patch for CVE-2022-44638 included in 0.42.2 2022-11-08 13:24:10 +01:00
Emilio Pozuelo Monfort
590b8eb08f New upstream release 2022-11-08 13:11:47 +01:00
Emilio Pozuelo Monfort
dbe5c715e6 Merge branch 'upstream-unstable' into debian-unstable 2022-11-08 13:11:17 +01:00
Heiko Lewin
713077d0a3 Fix signed-unsigned semantics in reduce_32 2022-11-03 19:13:41 +00:00
Matt Turner
618e3d4283 Post-release version bump to 0.42.3 2022-11-03 09:53:12 -04:00
Claude Heiland-Allen
40d6c9b256 add r8g8b8 sRGB to test suite
Signed-off-by: Claude Heiland-Allen <claude@mathr.co.uk>
2022-11-03 12:51:47 +00:00
Claude Heiland-Allen
83ba024483 implement r8g8b8 sRGB (without alpha)
Signed-off-by: Claude Heiland-Allen <claude@mathr.co.uk>
2022-11-03 12:51:47 +00:00
Matt Turner
37216a3283 Pre-release version bump to 0.42.2 2022-11-02 13:25:48 -04:00
Matt Turner
a1f88e842e Avoid integer overflow leading to out-of-bounds write
Thanks to Maddie Stone and Google's Project Zero for discovering this
issue, providing a proof-of-concept, and a great analysis.

Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/63
2022-11-02 13:25:48 -04:00
Matt Turner
c3bbb94b4c Revert "Fix signed-unsigned semantics in reduce_32"
This reverts commit aaf59b0338.

This commit regressed the scaling-test unit test, by apparently allowing
the compiler to emit fused multiply-add instructions in cases they
wouldn't have been allowed before. While using gcc's -ffp-contract=...
flag avoids the issue on amd64, it does not on at least aarch64 and
ppc64.

This is unfortunate, because the commit being reverted resolved
https://gitlab.freedesktop.org/pixman/pixman/-/issues/43 so we will
reintroduce this failure, but after more than a year without a fix for
the unit test, I think it's time to bite the bullet.

Fixes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/49
2022-10-27 15:10:30 -04:00
Matt Turner
ca7bb8894e build: Add a64-neon-test.S to EXTRA_DIST
Fixes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/66
2022-10-27 14:36:54 -04:00
Simon Ser
1a0d50ce70 meson: explicitly set C standard to gnu99
This explicitly indicates that GNU extensions (like asm) are used.
This fixes build errors when Pixman is used as a Meson subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-27 18:21:37 +00:00
Simon Ser
0cf92877a9 meson: override pixman-1 dependency
This eases usage as a Meson subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-27 18:17:26 +00:00
Thomas Klausner
4ee322c4e2 Makefile.am: increase shell portability
Use standard test(1) instead of bash's '[['.

Signed-off-by: Thomas Klausner <wiz@gatalith.at>
2022-10-18 17:48:49 +02:00
Thomas Klausner
b5b3243792 configure.ac: avoid unportable test(1) operator
"==" is only supported by bash, POSIX mandates "="

Signed-off-by: Thomas Klausner <wiz@gatalith.at>
2022-10-18 17:48:24 +02:00
Simon Ser
7df9e162c6 Post-release version bump to 0.42.1
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-18 11:01:24 +02:00
Simon Ser
8d6d7f44f4 Pre-release version bump to 0.42.0
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-18 09:44:04 +02:00
Benjamin Gilbert
421fc252ab meson: Add feature to disable compiler TLS support
When compiling with MinGW, use of the __thread attribute causes pixman
to gain a dependency on the winpthread DLL.  With Autotools, this could
be avoided by configuring with ac_cv_tls=none, causing pixman to fall
back to TlsSetValue() instead.

Add a Meson 'tls' option that can be 'disabled' to skip support for TLS
compiler attributes, or 'enabled' to require a working TLS attribute.
2022-10-18 01:02:43 +00:00
Alan Coopersmith
7989483929 configure.ac: allow x64 libraries on Solaris to run on non-SSSE3 machines
Override the x64 hardware capability autodetection by Solaris Studio
compilers for x64 libraries the same way we do for x86 libraries.

Also fix configure test for this override to work in out-of-tree builds.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-13 20:58:57 +00:00
Jocelyn Falempe
b4a105d772 Fix inverted colors on big endian system
bits_image_fetch_separable_convolution_affine() didn't take care
of big endian system

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
2022-06-29 11:00:04 +02:00
Alan Coopersmith
285b9a907c configure: replace bugzilla URL with gitlab issues
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-02-19 13:37:54 -08:00
Nirbheek Chauhan
adc07d4618 meson: Fix usage of pkgconfig.generate()
The library that the pkgconfig file is for should be the first
positional argument. The `libraries:` kwarg is for libraries that the
user must also link against, and which meson does not know about (and
hence cannot automatically add to the `Libs:` or `Requires:` section
in the .pc file).

Fixes:
```
subprojects/pixman/meson.build:564: DEPRECATION: Library pixman-1 was
passed to the "libraries" keyword argument of a previous call to
generate() method instead of first positional argument. Adding
pixman-1 to "Requires" field, but this is a deprecated behaviour that
will change in a future version of Meson. Please report the issue if
this warning cannot be avoided in your case.
```
2022-01-22 13:25:57 +05:30
Nirbheek Chauhan
3563dfe436 meson: Fix warning about extract_all_objects usage
We use this because of a meson bug that was fixed in 0.52:

https://mesonbuild.com/Release-notes-for-0-52-0.html#improved-support-for-static-libraries

Bump the requirement and remove the extract_all_objects workaround.
This gets rid of a meson warning:

WARNING: extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but
the default will be changed in the future.
2022-01-21 09:07:53 +00:00
Manuel Stoeckl
c6e1af995e demos: port to Gtk3
GTK2 has reached end of life, and GTK3 has been available for a
almost a decade.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
2022-01-12 23:19:39 -05:00
Mizuki Asakura
eadb82866b added aarch64 bilinear implementations (ver.4.1)
Since aarch64 has different neon syntax from aarch32 and has no
support for (older) arm-simd,
there are no SIMD accelerations for pixman on aarch64.

We need new implementations.

This patch also contains Ben Avions's series of patches for aarch32
and now the benchmark results are fine to aarch64.

Please find the result at the below ticket.

Added: https://bugs.freedesktop.org/show_bug.cgi?id=94758
Signed-off-by: Mizuki Asakura <ed6e117f@gmail.com>
2021-09-17 17:03:02 +00:00
Simon Ser
36001032b7 Constify region APIs
This allows callers to pass around const Pixman region in their
APIs, improving type safety and documentation.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-09-17 16:22:51 +00:00
Nirbheek Chauhan
bd4e7a9b9e tests: Fix undefined symbol build error on macOS
prng_state and prng_state_data are getting classified as a "Common
symbol" by the compiler due to the convoluted way in which it is
`#include`-ed in various test sources, and that's not read as a valid
symbol by the linker later.

Initializing the symbol clarifies it to the compiler that this
specific declaration is the canonical location for this variable, and
that it's not a "Common symbol".

Fixes https://gitlab.freedesktop.org/pixman/pixman/-/issues/42
2021-09-17 16:08:04 +00:00
Alex Richardson
e0d4403e78 Fix -Wincompatible-function-pointer-types warning
Adding const to the return type does nothing and means that the function
pointer types do not match exactly:

error: incompatible function pointer types passing 'const float (int, int)' to parameter of type 'dither_factor_t' (aka 'float (*)(int, int)')
2021-09-17 16:03:48 +00:00
Manuel Stoeckl
5f5e752f15 Fix masked pixel fetching with wide format
In __bits_image_fetch_affine_no_alpha and __bits_image_fetch_general,
when `wide` is true, the mask is actually an array of argb_t instead
of the array of uint32_t it was cast to, and the access to `mask[i]`
does not correctly detect when the pixel is nontrivial. The code now
uses a check appropriate for argb_t when `wide` is true.

One caveat: this new check only skips entries when the mask pixel data
is binary all zero; this misses cases like `-0.f` which would be caught
by the FLOAT_IS_ZERO macro. As the mask check only appears to be a
performance optimization to avoid loading inconsequential pixels, it
erring on the side of loading more pixels is safe.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2021-08-09 21:43:58 -04:00
Heiko Lewin
aaf59b0338 Fix signed-unsigned semantics in reduce_32 2021-07-21 14:50:52 +00:00
pkubaj
4251202d9d Fix AltiVec detection on FreeBSD. 2021-05-07 15:58:56 +00:00
Jonathan Kew
e93eaff517 Avoid out-of-bounds read when accessing individual bytes from mask.
The important changes here are a handful of places where we replace

            memcpy(&m, mask++, sizeof(uint32_t));

or similar code with

            uint8_t m = *mask++;

because we're only supposed to be reading a single byte from *mask,
and accessing a 32-bit value may read out of bounds (besides that
it reads values we don't actually want; whether this matters would
depend exactly how the value in m is subsequently used).

I've also changed a bunch of other places to use this same pattern
(a local 8-bit variable) when reading individual bytes from the mask;
the code was inconsistent about this, sometimes casting the byte to
a uint32_t instead. This makes no actual difference, it just seemed
better to use a consistent pattern throughout the file.
2021-05-07 09:37:28 -04:00
Érico Rolim
d93ec57138 meson: update option descriptions.
- gtk is only used in demos
- libpng is only used in tests
- openmp is only used in tests (in the standard build)
2020-10-22 20:43:26 -03:00
Dylan Baker
9b49f4e087 meson: remove pixman dependency
AFAICT from the git history, what happened is that the gtk demos rely on
gtk being built with pixman support. pkg-config isn't really expressive
enough to have that information, so the solution that was come up with
was to search for pixman as well as gtk+ and hope that pixman being
installed was.

This isn't actually used anywhere in the meson build anyway, and it's
causing problems for projects that want to use pixman as a supproject
(there's a port of cairo underway that's hitting this), because it
confuses meson.
2020-06-18 14:21:09 -07:00
Tim-Philipp Müller
606f5c15b0 meson: add option to skip building of tests and demos
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2020-06-02 02:30:39 +00:00
Tim-Philipp Müller
15e0668616 meson: add cpu-features-path option for Android
Add option to include cpu-features.[ch] from a given path
into the build for platforms that don't provide this out
of the box. This is needed on Android.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2020-06-02 01:15:33 +01:00
Tim-Philipp Müller
0ba6cbe1ac Update README a little
- bugzilla -> gitlab
- convert links to https
- suggest issues and patches be filed via gitlab
2020-05-30 11:34:26 +01:00
Tom Stellard
c2fe1568ff Add -ftrapping-math to default cflags
This should resolve https://gitlab.freedesktop.org/pixman/pixman/-/issues/22
and make the tests pass with clang.

-ftrapping-math is already the default[1] for gcc, so this should not change
behavior when compiling with gcc.  However, clang defaults[2] to -fno-trapping-math,
so -ftrapping-math is needed to avoid floating-point expceptions when running the
combiner and stress tests.

The root causes of this issue is that that pixman-combine-float.c guards floating-point
division operations with a FLOAT_IS_ZERO check e.g.

if (FLOAT_IS_ZERO (sa))
	f = 1.0f;
else
	f = CLAMP (da / sa);

With -fno-trapping-math, the compiler assumes that division will never trap, so it may
re-order the division and the guard and execute the division first.  In most cases,
this would not be an issue, because floating-point exceptions are ignored.  However,
these tests call enable_divbyzero_exceptions() which causes the SIGFPE signal to
be sent to the program when a divide by zero exception is raised.

[1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
[2] https://clang.llvm.org/docs/UsersManual.html#controlling-floating-point-behavior
2020-05-11 22:33:49 +00:00
Michael Forney
3b1fefda7f Prevent empty top-level declaration
The expansion of PIXMAN_DEFINE_THREAD_LOCAL(...) may end in a
function definition, so the following semicolon is considered an
empty top-level declaration, which is not allowed in ISO C.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2020-04-26 13:46:43 -07:00
Matt Turner
10a057e27f Post-release version bump to 0.40.1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-04-19 15:01:30 -07:00
169 changed files with 10755 additions and 29436 deletions

View File

@ -6,9 +6,6 @@ root = true
[*]
tab_width = 8
[Makefile.*]
indent_style = tab
[meson.build,meson_options.txt]
indent_style = space
indent_size = 2

View File

@ -0,0 +1,80 @@
# Docker build stage
#
# It builds a multi-arch image for all required architectures. Each image can be
# later easily used with properly configured Docker (which uses binfmt and QEMU
# underneath).
docker:
stage: docker
image: quay.io/buildah/stable
rules:
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event' && $TARGET =~ $ACTIVE_TARGET_PATTERN"
changes:
paths:
- .gitlab-ci.d/01-docker.yml
- .gitlab-ci.d/01-docker/**/*
variables:
DOCKER_TAG: $CI_COMMIT_REF_SLUG
DOCKER_IMAGE_NAME: ${CI_REGISTRY_IMAGE}/pixman:${DOCKER_TAG}
- if: "$CI_PIPELINE_SOURCE == 'schedule' && $TARGET =~ $ACTIVE_TARGET_PATTERN"
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $TARGET =~ $ACTIVE_TARGET_PATTERN"
- if: "$CI_COMMIT_TAG && $TARGET =~ $ACTIVE_TARGET_PATTERN"
variables:
# Use vfs with buildah. Docker offers overlayfs as a default, but Buildah
# cannot stack overlayfs on top of another overlayfs filesystem.
STORAGE_DRIVER: vfs
# Write all image metadata in the docker format, not the standard OCI
# format. Newer versions of docker can handle the OCI format, but older
# versions, like the one shipped with Fedora 30, cannot handle the format.
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
CACHE_IMAGE: ${CI_REGISTRY_IMAGE}/cache
CACHE_ARGS: --cache-from ${CACHE_IMAGE} --cache-to ${CACHE_IMAGE}
before_script:
# Login to the target registry.
- echo "${CI_REGISTRY_PASSWORD}" |
buildah login -u "${CI_REGISTRY_USER}" --password-stdin ${CI_REGISTRY}
# Docker Hub login is optional, and can be used to circumvent image pull
# quota for anonymous pulls for base images.
- echo "${DOCKERHUB_PASSWORD}" |
buildah login -u "${DOCKERHUB_USER}" --password-stdin docker.io ||
echo "Failed to login to Docker Hub."
parallel:
matrix:
- TARGET:
- linux-386
- linux-amd64
- linux-arm-v5
- linux-arm-v7
- linux-arm64-v8
- linux-mips
- linux-mips64el
- linux-mipsel
- linux-ppc
- linux-ppc64
- linux-ppc64le
- linux-riscv64
- windows-686
- windows-amd64
- windows-arm64-v8
script:
# Prepare environment.
- ${LOAD_TARGET_ENV}
- FULL_IMAGE_NAME=${DOCKER_IMAGE_NAME}-${TARGET}
# Build and push the image.
- buildah bud
--tag ${FULL_IMAGE_NAME}
--layers ${CACHE_ARGS}
--target ${TARGET}
--platform=${DOCKER_PLATFORM}
--build-arg BASE_IMAGE=${BASE_IMAGE}
--build-arg BASE_IMAGE_TAG=${BASE_IMAGE_TAG}
--build-arg LLVM_VERSION=${LLVM_VERSION}
-f Dockerfile .gitlab-ci.d/01-docker/
- buildah images
- buildah push ${FULL_IMAGE_NAME}

View File

@ -0,0 +1,150 @@
ARG BASE_IMAGE=docker.io/debian
ARG BASE_IMAGE_TAG=bookworm-slim
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS base
LABEL org.opencontainers.image.title="Pixman build environment for platform coverage" \
org.opencontainers.image.authors="Marek Pikuła <m.pikula@partner.samsung.com>"
ARG DEBIAN_FRONTEND=noninteractive
ENV APT_UPDATE="apt-get update" \
APT_INSTALL="apt-get install -y --no-install-recommends" \
APT_CLEANUP="rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*"
ARG GCOVR_VERSION="~=7.2"
ARG MESON_VERSION="~=1.6"
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
# Build dependencies.
build-essential \
ninja-build \
pkg-config \
qemu-user \
# pipx dependencies.
python3-argcomplete \
python3-packaging \
python3-pip \
python3-platformdirs \
python3-userpath \
python3-venv \
# gcovr dependencies.
libxml2-dev \
libxslt-dev \
python3-dev \
&& ${APT_CLEANUP} \
# Install pipx using pip to have a more recent version of pipx, which
# supports the `--global` flag.
&& pip install pipx --break-system-packages \
# Install a recent version of meson and gcovr using pipx to have the same
# version across all variants regardless of base.
&& pipx install --global \
gcovr${GCOVR_VERSION} \
meson${MESON_VERSION} \
&& gcovr --version \
&& echo Meson version: \
&& meson --version
FROM base AS llvm-base
# LLVM 16 is the highest available in Bookworm. Preferably, we should use the
# same version for all platforms, but it's not possible at the moment.
ARG LLVM_VERSION=16
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
clang-${LLVM_VERSION} \
libclang-rt-${LLVM_VERSION}-dev \
lld-${LLVM_VERSION} \
llvm-${LLVM_VERSION} \
&& ${APT_CLEANUP} \
&& ln -f /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang \
&& ln -f /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld \
&& ln -f /usr/bin/llvm-ar-${LLVM_VERSION} /usr/bin/llvm-ar \
&& ln -f /usr/bin/llvm-strip-${LLVM_VERSION} /usr/bin/llvm-strip
FROM llvm-base AS native-base
ARG LLVM_VERSION=16
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
# Runtime library dependencies.
libglib2.0-dev \
libgtk-3-dev \
libpng-dev \
# Install libomp-dev if available (OpenMP support for LLVM). It's done only
# for the native images, as OpenMP support in cross-build environment is
# tricky for LLVM.
&& (${APT_INSTALL} libomp-${LLVM_VERSION}-dev \
|| echo "OpenMP not available on this platform.") \
&& ${APT_CLEANUP}
# The following targets differ in BASE_IMAGE.
FROM native-base AS linux-386
FROM native-base AS linux-amd64
FROM native-base AS linux-arm-v5
FROM native-base AS linux-arm-v7
FROM native-base AS linux-arm64-v8
FROM native-base AS linux-mips64el
FROM native-base AS linux-mipsel
FROM native-base AS linux-ppc64le
FROM native-base AS linux-riscv64
# The following targets should have a common BASE_IMAGE.
FROM llvm-base AS linux-mips
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-mips-linux-gnu \
&& ${APT_CLEANUP}
FROM llvm-base AS linux-ppc
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-powerpc-linux-gnu \
&& ${APT_CLEANUP}
FROM llvm-base AS linux-ppc64
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-powerpc64-linux-gnu \
&& ${APT_CLEANUP}
# We use a common image for Windows i686 and amd64, as it doesn't make sense to
# make them separate in terms of build time and image size. After two runs they
# should use the same cache layers, so in the end it makes the collective image
# size smaller.
FROM base AS windows-base
ARG LLVM_MINGW_RELEASE=20240619
ARG LLVM_MINGW_VARIANT=llvm-mingw-${LLVM_MINGW_RELEASE}-msvcrt-ubuntu-20.04-x86_64
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} wget \
&& ${APT_CLEANUP} \
&& cd /opt \
&& wget https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_RELEASE}/${LLVM_MINGW_VARIANT}.tar.xz \
&& tar -xf ${LLVM_MINGW_VARIANT}.tar.xz \
&& rm -f ${LLVM_MINGW_VARIANT}.tar.xz
ENV PATH=${PATH}:/opt/${LLVM_MINGW_VARIANT}/bin
FROM windows-base AS windows-x86-base
RUN dpkg --add-architecture i386 \
&& ${APT_UPDATE} \
&& ${APT_INSTALL} \
gcc-mingw-w64-i686 \
gcc-mingw-w64-x86-64 \
mingw-w64-tools \
procps \
wine \
wine32 \
wine64 \
&& ${APT_CLEANUP} \
# Inspired by https://code.videolan.org/videolan/docker-images
&& wine wineboot --init \
&& while pgrep wineserver > /dev/null; do \
echo "waiting ..."; \
sleep 1; \
done \
&& rm -rf /tmp/wine-*
FROM windows-x86-base AS windows-686
FROM windows-x86-base AS windows-amd64
# aarch64 image requires linaro/wine-arm64 as a base.
FROM windows-base AS windows-arm64-v8
RUN wine-arm64 wineboot --init \
&& while pgrep wineserver > /dev/null; do \
echo "waiting ..."; \
sleep 1; \
done \
&& rm -rf /tmp/wine-*

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/386
BASE_IMAGE=docker.io/i386/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/amd64/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/arm/v5
BASE_IMAGE=docker.io/arm32v5/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/arm/v7
BASE_IMAGE=docker.io/arm32v7/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/arm64/v8
BASE_IMAGE=docker.io/arm64v8/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/amd64/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/mips64el
BASE_IMAGE=docker.io/mips64le/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/mipsel
BASE_IMAGE=docker.io/serenitycode/debian-debootstrap
BASE_IMAGE_TAG=mipsel-bookworm-slim
LLVM_VERSION=14

View File

@ -0,0 +1 @@
linux-amd64.env

View File

@ -0,0 +1 @@
linux-amd64.env

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/ppc64le
BASE_IMAGE=docker.io/ppc64le/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -0,0 +1,4 @@
DOCKER_PLATFORM=linux/riscv64
BASE_IMAGE=docker.io/riscv64/debian
BASE_IMAGE_TAG=sid-slim
LLVM_VERSION=18

View File

@ -0,0 +1 @@
linux-amd64.env

View File

@ -0,0 +1 @@
linux-amd64.env

View File

@ -0,0 +1,3 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/linaro/wine-arm64
BASE_IMAGE_TAG=latest

107
.gitlab-ci.d/02-build.yml Normal file
View File

@ -0,0 +1,107 @@
# Build stage
#
# This stage builds pixman with enabled coverage for all supported
# architectures.
#
# Some targets don't support atomic profile update, so to decrease the number of
# gcov errors, they need to be built without OpenMP (single threaded) by adding
# `-Dopenmp=disabled` Meson argument.
variables:
# Used in test stage as well.
BUILD_DIR: build-${TOOLCHAIN}
# Applicable to all build targets.
include:
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-386
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-amd64
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm-v5
qemu_cpu: arm1136
# Disable coverage, as the tests take too long to run with a single thread.
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm-v7
qemu_cpu: max
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm64-v8
qemu_cpu: max
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips
toolchain: [gnu]
qemu_cpu: 74Kf
enable_gnu_coverage: false
# TODO: Merge with the one above once the following issue is resolved:
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/105).
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips
toolchain: [llvm]
qemu_cpu: 74Kf
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips64el
qemu_cpu: Loongson-3A4000
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mipsel
toolchain: [gnu]
qemu_cpu: 74Kf
# Disable coverage, as the tests take too long to run with a single thread.
enable_gnu_coverage: false
# TODO: Merge with the one above once the following issue is resolved:
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/105).
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mipsel
toolchain: [llvm]
qemu_cpu: 74Kf
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc
qemu_cpu: g4
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc64
qemu_cpu: ppc64
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc64le
qemu_cpu: power10
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-riscv64
qemu_cpu: rv64
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-686
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-amd64
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-arm64-v8
toolchain: [llvm] # GNU toolchain doesn't seem to support Windows on ARM.
qemu_cpu: max
enable_gnu_coverage: false

175
.gitlab-ci.d/03-test.yml Normal file
View File

@ -0,0 +1,175 @@
# Test stage
#
# This stage executes the test suite for pixman for all architectures in
# different configurations. Build and test is split, as some architectures can
# have different QEMU configuration or have multiple supported pixman backends,
# which are executed as job matrix.
#
# Mind that `PIXMAN_ENABLE` variable in matrix runs does nothing, but it looks
# better in CI to indicate what is actually being tested.
#
# Some emulated targets are really slow or cannot be run in multithreaded mode
# (mipsel, arm-v5). Thus coverage reporting is disabled for them.
variables:
# Used in summary stage as well.
COVERAGE_BASE_DIR: coverage
COVERAGE_OUT: ${COVERAGE_BASE_DIR}/${CI_JOB_ID}
TEST_NAME: "" # Allow to specify a set of tests to run with run variables.
include:
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-386
toolchain: [gnu]
pixman_disable:
- "sse2 ssse3" # Testing "mmx"
- "mmx ssse3" # Testing "sse2"
- "mmx sse2" # Testing "ssse3"
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/106
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-386
toolchain: [llvm]
pixman_disable:
# Same as above.
- "sse2 ssse3"
- "mmx ssse3"
- "mmx sse2"
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-amd64
pixman_disable:
- ""
- "fast"
- "wholeops"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v5
toolchain: [gnu]
qemu_cpu: [arm1136]
pixman_disable: ["arm-neon"] # Test only arm-simd.
timeout: 3h
test_timeout_multiplier: 40
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/107
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v5
toolchain: [llvm]
qemu_cpu: [arm1136]
pixman_disable: ["arm-neon"] # Test only arm-simd.
timeout: 3h
test_timeout_multiplier: 40
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v7
qemu_cpu: [max]
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm64-v8
qemu_cpu: [max]
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips
toolchain: [gnu] # TODO: Add llvm once the build is fixed.
qemu_cpu: [74Kf]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # Some tests seem to fail.
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips64el
toolchain: [gnu]
qemu_cpu: [Loongson-3A4000]
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/108
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips64el
toolchain: [llvm]
qemu_cpu: [Loongson-3A4000]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mipsel
toolchain: [gnu] # TODO: Add llvm once the build is fixed.
qemu_cpu: [74Kf]
timeout: 2h
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc
qemu_cpu: [g4]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # SIGILL for some tests
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64
qemu_cpu: [ppc64]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # SIGSEGV for some tests
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64le
toolchain: [gnu]
qemu_cpu: [power10]
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/109
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64le
toolchain: [llvm]
qemu_cpu: [power10]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-riscv64
qemu_cpu:
# Test on target without RVV (verify no autovectorization).
- rv64,v=false
# Test correctness for different VLENs.
- rv64,v=true,vext_spec=v1.0,vlen=128,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=256,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=512,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=1024,elen=64
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-686
pixman_disable:
# The same as for linux-386.
- "sse2 ssse3"
- "mmx ssse3"
- "mmx sse2"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-amd64
pixman_disable:
# The same as for linux-amd64.
- ""
- "fast"
- "wholeops"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-arm64-v8
toolchain: [llvm]
qemu_cpu: [max]

View File

@ -0,0 +1,47 @@
# Summary stage
#
# This stage takes coverage reports from test runs for all architectures, and
# merges it into a single report, with GitLab visualization. There is also an
# HTML report generated as a separate artifact.
summary:
extends: .target:all
stage: summary
variables:
TARGET: linux-amd64
COVERAGE_SUMMARY_DIR: ${COVERAGE_BASE_DIR}/summary
needs:
- job: test:linux-386
optional: true
- job: test:linux-amd64
optional: true
- job: test:linux-arm-v7
optional: true
- job: test:linux-arm64-v8
optional: true
- job: test:linux-mips64el
optional: true
- job: test:linux-ppc64le
optional: true
- job: test:linux-riscv64
optional: true
script:
- echo "Input coverage reports:" && ls ${COVERAGE_BASE_DIR}/*.json || (echo "No coverage reports available." && exit)
- |
args=( )
for f in ${COVERAGE_BASE_DIR}/*.json; do
args+=( "-a" "$f" )
done
- mkdir -p ${COVERAGE_SUMMARY_DIR}
- gcovr "${args[@]}"
--cobertura-pretty --cobertura ${COVERAGE_SUMMARY_DIR}/coverage.xml
--html-details ${COVERAGE_SUMMARY_DIR}/coverage.html
--txt --print-summary
coverage: '/^TOTAL.*\s+(\d+\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: ${COVERAGE_SUMMARY_DIR}/coverage.xml
paths:
- ${COVERAGE_SUMMARY_DIR}/

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1 @@
native-gnu-noopenmp.meson

View File

@ -0,0 +1 @@
native-llvm-noopenmp.meson

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1,11 @@
[binaries]
c = ['mips-linux-gnu-gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'mips-linux-gnu-ar'
strip = 'mips-linux-gnu-strip'
exe_wrapper = ['qemu-mips', '-L', '/usr/mips-linux-gnu/']
[host_machine]
system = 'linux'
cpu_family = 'mips32'
cpu = 'mips32'
endian = 'big'

View File

@ -0,0 +1,14 @@
[binaries]
c = ['clang', '-target', 'mips-linux-gnu', '-fPIC', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-mips', '-L', '/usr/mips-linux-gnu/']
[built-in options]
c_link_args = ['-target', 'mips-linux-gnu', '-fuse-ld=lld']
[host_machine]
system = 'linux'
cpu_family = 'mips32'
cpu = 'mips32'
endian = 'big'

View File

@ -0,0 +1,8 @@
[binaries]
c = ['gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'
[project options]
mips-dspr2 = 'disabled'

View File

@ -0,0 +1,8 @@
[binaries]
c = ['clang', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'
[project options]
mips-dspr2 = 'disabled'

View File

@ -0,0 +1 @@
native-gnu-noopenmp.meson

View File

@ -0,0 +1 @@
native-llvm-noopenmp.meson

View File

@ -0,0 +1,11 @@
[binaries]
c = 'powerpc-linux-gnu-gcc'
ar = 'powerpc-linux-gnu-ar'
strip = 'powerpc-linux-gnu-strip'
exe_wrapper = ['qemu-ppc', '-L', '/usr/powerpc-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc'
cpu = 'ppc'
endian = 'big'

View File

@ -0,0 +1,15 @@
[binaries]
c = ['clang', '-target', 'powerpc-linux-gnu']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-ppc', '-L', '/usr/powerpc-linux-gnu/']
[built-in options]
# We cannot use LLD, as it doesn't support big-endian PPC.
c_link_args = ['-target', 'powerpc-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc'
cpu = 'ppc'
endian = 'big'

View File

@ -0,0 +1,11 @@
[binaries]
c = 'powerpc64-linux-gnu-gcc'
ar = 'powerpc64-linux-gnu-ar'
strip = 'powerpc64-linux-gnu-strip'
exe_wrapper = ['qemu-ppc64', '-L', '/usr/powerpc64-linux-gnu/']
[host_machine]
system = 'linux'
cpu_family = 'ppc64'
cpu = 'ppc64'
endian = 'big'

View File

@ -0,0 +1,15 @@
[binaries]
c = ['clang', '-target', 'powerpc64-linux-gnu']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-ppc64', '-L', '/usr/powerpc64-linux-gnu/']
[built-in options]
# We cannot use LLD, as it doesn't support big-endian PPC.
c_link_args = ['-target', 'powerpc64-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc64'
cpu = 'ppc64'
endian = 'big'

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1 @@
native-gnu.meson

View File

@ -0,0 +1 @@
native-llvm.meson

View File

@ -0,0 +1,8 @@
[binaries]
c = ['gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'
[project options]
openmp = 'disabled'

View File

@ -0,0 +1,5 @@
[binaries]
c = 'gcc'
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'

View File

@ -0,0 +1,8 @@
[binaries]
c = ['clang', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'
[project options]
openmp = 'disabled'

View File

@ -0,0 +1,5 @@
[binaries]
c = 'clang'
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'

View File

@ -0,0 +1,18 @@
[binaries]
c = 'i686-w64-mingw32-gcc'
ar = 'i686-w64-mingw32-ar'
strip = 'i686-w64-mingw32-strip'
windres = 'i686-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static-libgcc']
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
[project options]
openmp = 'disabled'

View File

@ -0,0 +1,18 @@
[binaries]
c = 'i686-w64-mingw32-clang'
ar = 'i686-w64-mingw32-llvm-ar'
strip = 'i686-w64-mingw32-strip'
windres = 'i686-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static']
[project options]
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'

View File

@ -0,0 +1,15 @@
[binaries]
c = 'x86_64-w64-mingw32-gcc'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static-libgcc']
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

View File

@ -0,0 +1,20 @@
[binaries]
c = 'x86_64-w64-mingw32-clang'
ar = 'x86_64-w64-mingw32-llvm-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
# Static linking is a workaround around `libwinpthread-1` not being discovered correctly.
c_link_args = ['-static']
[project options]
# OpenMP is disabled as it is not being discovered correctly during tests.
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

View File

@ -0,0 +1,18 @@
[binaries]
c = 'aarch64-w64-mingw32-clang'
ar = 'aarch64-w64-mingw32-llvm-ar'
strip = 'aarch64-w64-mingw32-strip'
windres = 'aarch64-w64-mingw32-windres'
exe_wrapper = 'wine-arm64'
[built-in options]
c_link_args = ['-static']
[project options]
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

View File

@ -0,0 +1,65 @@
# This file contains the set of jobs run by the pixman project:
# https://gitlab.freedesktop.org/pixman/pixman/-/pipelines
stages:
- docker
- build
- test
- summary
variables:
# Make it possible to change RUNNER_TAG from GitLab variables. The default
# `kvm` tag has been tested with FDO infrastructure.
RUNNER_TAG: kvm
# Docker image global configuration.
DOCKER_TAG: latest
DOCKER_IMAGE_NAME: registry.freedesktop.org/pixman/pixman/pixman:${DOCKER_TAG}
# Execute to load a target-specific environment.
LOAD_TARGET_ENV: source .gitlab-ci.d/01-docker/target-env/${TARGET}.env
# Enable/disable specific targets for code and platform coverage targets.
ACTIVE_TARGET_PATTERN: '/linux-386|linux-amd64|linux-arm-v5|linux-arm-v7|linux-arm64-v8|linux-mips|linux-mips64el|linux-mipsel|linux-ppc|linux-ppc64|linux-ppc64le|linux-riscv64|windows-686|windows-amd64|windows-arm64-v8/i'
workflow:
rules:
# Use modified Docker image if building in MR and Docker image is affected
# by the MR.
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
paths:
- .gitlab-ci.d/01-docker.yml
- .gitlab-ci.d/01-docker/**/*
variables:
DOCKER_TAG: $CI_COMMIT_REF_SLUG
DOCKER_IMAGE_NAME: ${CI_REGISTRY_IMAGE}/pixman:${DOCKER_TAG}
# A standard set of GitLab CI triggers (i.e., MR, schedule, default branch,
# and tag).
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
auto_cancel:
on_new_commit: conservative
on_job_failure: all
default:
tags:
- $RUNNER_TAG
# Retry in case the runner is misconfigured for multi-arch builds or some
# random unexpected runner error occurs (it happened during testing).
retry: 1
include:
- local: "/.gitlab-ci.d/templates/targets.yml"
- local: "/.gitlab-ci.d/01-docker.yml"
- local: "/.gitlab-ci.d/02-build.yml"
- local: "/.gitlab-ci.d/03-test.yml"
- local: "/.gitlab-ci.d/04-summary.yml"

View File

@ -0,0 +1,80 @@
spec:
inputs:
target:
description:
Build target in form of "OS-ARCH" pair (e.g., linux-amd64). Mostly the
same as platform string for Docker but with a hyphen instead of slash.
toolchain:
description:
An array of toolchains to test with. Each toolchain should have an
appropriate Meson cross file.
type: array
default: [gnu, llvm]
qemu_cpu:
description:
QEMU_CPU environmental variable used by Docker (which uses QEMU
underneath). It is not used by x86 targets, as they are executed
natively on the host.
default: ""
enable_gnu_coverage:
description:
Enable coverage build flags. It can be later used to compile a coverage
report for all the jobs. Should be enabled only for native build
environments as they have all the optional dependencies, and are the
most reliable and uniform (so disable for cross environments).
type: boolean
default: true
job_name_prefix:
description:
Additional prefix for the job name. Can be used to disable a job with a
"." prefix.
default: ""
job_name_suffix:
description:
Additional suffix for the job name. Can be used to prevent job
duplication for jobs for the same target.
default: ""
allow_failure:
description:
Set the `allow_failure` flag for jobs that are expected to fail.
Remember to set `retry` argument to 0 to prevent unnecessary retries.
type: boolean
default: false
retry:
description:
Set the `retry` flag for a job. Usually used together with
`allow_failure`.
type: number
default: 1
---
"$[[ inputs.job_name_prefix ]]build:$[[ inputs.target ]]$[[ inputs.job_name_suffix ]]":
extends: .target:all
stage: build
allow_failure: $[[ inputs.allow_failure ]]
retry: $[[ inputs.retry ]]
needs:
- job: docker
optional: true
parallel:
matrix:
- TARGET: $[[ inputs.target ]]
variables:
TARGET: $[[ inputs.target ]]
QEMU_CPU: $[[ inputs.qemu_cpu ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
script:
- |
if [ "$[[ inputs.enable_gnu_coverage ]]" == "true" ] && [ "${TOOLCHAIN}" == "gnu" ]; then
COV_C_ARGS=-fprofile-update=atomic
COV_MESON_BUILD_ARGS=-Db_coverage=true
fi
- meson setup ${BUILD_DIR}
--cross-file .gitlab-ci.d/meson-cross/${TARGET}-${TOOLCHAIN}.meson
-Dc_args="${COV_C_ARGS}" ${COV_MESON_BUILD_ARGS}
- meson compile -C ${BUILD_DIR}
artifacts:
paths:
- ${BUILD_DIR}/

View File

@ -0,0 +1,9 @@
# General target templates.
.target:all:
image:
name: $DOCKER_IMAGE_NAME-$TARGET
rules:
- if: "$TARGET =~ $ACTIVE_TARGET_PATTERN"
before_script:
- ${LOAD_TARGET_ENV}

View File

@ -0,0 +1,112 @@
spec:
inputs:
target:
description:
Build target in form of "OS-ARCH" pair (e.g., linux-amd64). Mostly the
same as platform string for Docker but with a hyphen instead of slash.
toolchain:
description:
An array of toolchains to test with. Each toolchain should have an
appropriate Meson cross file.
type: array
default: [gnu, llvm]
qemu_cpu:
description:
An array of QEMU_CPU environmental variables used as a job matrix
variable, and in turn by Docker (which uses QEMU underneath). It is not
used by x86 targets, as they are executed natively on the host.
type: array
default: [""]
pixman_disable:
description:
An array of PIXMAN_DISABLE targets used as a job matrix variable.
type: array
default: [""]
timeout:
description:
GitLab job timeout property. May need to be increased for slow
targets.
default: 1h
test_timeout_multiplier:
description:
Test timeout multiplier flag used for Meson test execution. May need to
be increased for slow targets.
type: number
default: 20
meson_testthreads:
description:
Sets MESON_TESTTHREADS environmental variable. For some platforms, the
tests should be executed one by one (without multithreading) to prevent
gcovr errors.
type: number
default: 0
gcovr_flags:
description:
Additional flags passed to gcovr tool.
default: ""
job_name_prefix:
description:
Additional prefix for the job name. Can be used to disable a job with a
"." prefix.
default: ""
job_name_suffix:
description:
Additional suffix for the job name. Can be used to prevent job
duplication for jobs for the same target.
default: ""
allow_failure:
description:
Set the `allow_failure` flag for jobs that are expected to fail.
Remember to set `retry` argument to 0 to prevent unnecessary retries.
type: boolean
default: false
retry:
description:
Set the `retry` flag for a job. Usually used together with
`allow_failure`.
type: number
default: 1
---
"$[[ inputs.job_name_prefix ]]test:$[[ inputs.target ]]$[[ inputs.job_name_suffix ]]":
extends: .target:all
stage: test
allow_failure: $[[ inputs.allow_failure ]]
retry: $[[ inputs.retry ]]
timeout: $[[ inputs.timeout ]]
needs:
- job: docker
optional: true
parallel:
matrix:
- TARGET: $[[ inputs.target ]]
- job: build:$[[ inputs.target ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
variables:
TARGET: $[[ inputs.target ]]
TEST_TIMEOUT_MULTIPLIER: $[[ inputs.test_timeout_multiplier ]]
GCOVR_FLAGS: $[[ inputs.gcovr_flags ]]
MESON_ARGS: -t ${TEST_TIMEOUT_MULTIPLIER} --no-rebuild -v ${TEST_NAME}
MESON_TESTTHREADS: $[[ inputs.meson_testthreads ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
PIXMAN_DISABLE: $[[ inputs.pixman_disable ]]
QEMU_CPU: $[[ inputs.qemu_cpu ]]
script:
- meson test -C ${BUILD_DIR} ${MESON_ARGS}
after_script:
- mkdir -p ${COVERAGE_OUT}
- gcovr ${GCOVR_FLAGS} -r ./ ${BUILD_DIR} -e ./subprojects
--json ${COVERAGE_OUT}.json
--html-details ${COVERAGE_OUT}/coverage.html
--print-summary || echo "No coverage data available."
artifacts:
paths:
- ${BUILD_DIR}/meson-logs/testlog.txt
- ${COVERAGE_BASE_DIR}/
reports:
junit:
- ${BUILD_DIR}/meson-logs/testlog.junit.xml

View File

@ -1,19 +1,16 @@
image: fedora:28
#
# This is the GitLab CI configuration file for the mainstream pixman project:
# https://gitlab.freedesktop.org/pixman/pixman/-/pipelines
#
# !!! DO NOT ADD ANY NEW CONFIGURATION TO THIS FILE !!!
#
# Only documentation or comments is accepted.
#
# To use a different set of jobs than the mainstream project, you need to set
# the location of your custom yml file at "custom CI/CD configuration path", on
# your GitLab CI namespace:
# https://docs.gitlab.com/ee/ci/pipelines/settings.html#custom-cicd-configuration-path
#
autotools-build:
script:
- dnf -y install dnf-plugins-core
- dnf -y groupinstall buildsys-build
- dnf -y builddep pixman
- ./autogen.sh
- make -sj4 check
meson-build:
script:
- dnf -y install dnf-plugins-core
- dnf -y groupinstall buildsys-build
- dnf -y builddep pixman
- dnf -y install ninja-build
- python3 -m pip install meson>=0.47.2
- meson build
- ninja -C build test
include:
- local: '/.gitlab-ci.d/pixman-project.yml'

25687
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@ -1,142 +0,0 @@
SUBDIRS = pixman demos test
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=pixman-1.pc
$(pkgconfig_DATA): pixman-1.pc.in
snapshot:
distdir="$(distdir)-`date '+%Y%m%d'`"; \
test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git rev-parse HEAD | cut -c 1-6`; \
$(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist
GPGKEY=3892336E
USERNAME=$$USER
RELEASE_OR_SNAPSHOT = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo "$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org
RELEASE_CAIRO_DIR = /srv/cairo.freedesktop.org/www/$(RELEASE_OR_SNAPSHOT)s
RELEASE_CAIRO_URL = https://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
RELEASE_XORG_URL = https://www.x.org/releases/individual/lib
RELEASE_XORG_HOST = $(USERNAME)@xorg.freedesktop.org
RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib
RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org, xorg-announce@lists.freedesktop.org, pixman@lists.freedesktop.org
EXTRA_DIST = \
Makefile.win32 \
Makefile.win32.common \
meson.build \
meson_options.txt \
neon-test.S \
arm-simd-test.S \
$(NULL)
tar_gz = $(PACKAGE)-$(VERSION).tar.gz
tar_xz = $(PACKAGE)-$(VERSION).tar.xz
sha512_tgz = $(tar_gz).sha512
sha256_tgz = $(tar_gz).sha256
sha512_txz = $(tar_xz).sha512
sha256_txz = $(tar_xz).sha256
gpg_file = $(sha512_tgz).asc
$(sha512_tgz): $(tar_gz)
sha512sum $^ > $@
$(sha256_tgz): $(tar_gz)
sha256sum $^ > $@
$(sha512_txz): $(tar_xz)
sha512sum $^ > $@
$(sha256_txz): $(tar_xz)
sha256sum $^ > $@
$(gpg_file): $(sha512_tgz)
@echo "Please enter your GPG password to sign the checksum."
gpg --armor --sign $^
HASHFILES = $(sha512_tgz) $(sha512_txz) $(sha256_tgz) $(sha256_txz)
release-verify-newer:
@echo -n "Checking that no $(VERSION) release already exists at $(RELEASE_XORG_HOST)..."
@ssh $(RELEASE_XORG_HOST) test ! -e $(RELEASE_XORG_DIR)/$(tar_gz) \
|| (echo "Ouch." && echo "Found: $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)/$(tar_gz)" \
&& echo "Refusing to try to generate a new release of the same name." \
&& false)
@ssh $(RELEASE_CAIRO_HOST) test ! -e $(RELEASE_CAIRO_DIR)/$(tar_gz) \
|| (echo "Ouch." && echo "Found: $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)/$(tar_gz)" \
&& echo "Refusing to try to generate a new release of the same name." \
&& false)
@echo "Good."
release-remove-old:
$(RM) $(tar_gz) $(tar_xz) $(HASHFILES) $(gpg_file)
ensure-prev:
@if [[ "$(PREV)" == "" ]]; then \
echo "" && \
echo "You must set the PREV variable on the make command line to" && \
echo "the last version." && \
echo "" && \
echo "For example:" && \
echo " make PREV=0.7.3" && \
echo "" && \
false; \
fi
release-check: ensure-prev release-verify-newer release-remove-old distcheck
release-tag:
git tag -u $(GPGKEY) -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
release-upload: release-check $(tar_gz) $(tar_xz) $(sha512_tgz) $(sha512_txz) $(sha256_tgz) $(gpg_file)
scp $(tar_gz) $(sha512_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)
scp $(tar_gz) $(tar_xz) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)
ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
RELEASE_TYPE = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo "$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo "stable release in the" ; else echo "development snapshot leading up to a stable"; fi)
release-publish-message: $(HASHFILES) ensure-prev
@echo "Please follow the instructions in RELEASING to push stuff out and"
@echo "send out the announcement mails. Here is the excerpt you need:"
@echo ""
@echo "Lists: $(RELEASE_ANNOUNCE_LIST)"
@echo "Subject: [ANNOUNCE] $(PACKAGE) release $(VERSION) now available"
@echo "============================== CUT HERE =============================="
@echo "A new $(PACKAGE) release $(VERSION) is now available. This is a $(RELEASE_TYPE)"
@echo ""
@echo "tar.gz:"
@echo " $(RELEASE_CAIRO_URL)/$(tar_gz)"
@echo " $(RELEASE_XORG_URL)/$(tar_gz)"
@echo ""
@echo "tar.xz:"
@echo " $(RELEASE_XORG_URL)/$(tar_xz)"
@echo ""
@echo "Hashes:"
@echo -n " SHA256: "
@cat $(sha256_tgz)
@echo -n " SHA256: "
@cat $(sha256_txz)
@echo -n " SHA512: "
@cat $(sha512_tgz)
@echo -n " SHA512: "
@cat $(sha512_txz)
@echo ""
@echo "GPG signature:"
@echo " $(RELEASE_CAIRO_URL)/$(gpg_file)"
@echo " (signed by`gpg --list-keys $(GPGKEY) | grep uid | cut -b4- | tr -s " "`)"
@echo ""
@echo "Git:"
@echo " https://gitlab.freedesktop.org/pixman/pixman.git"
@echo " tag: $(PACKAGE)-$(VERSION)"
@echo ""
@echo "Log:"
@git log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b1-80
@echo "============================== CUT HERE =============================="
@echo ""
release-publish: release-upload release-tag release-publish-message
.PHONY: release-upload release-publish release-publish-message release-tag

View File

@ -1,25 +0,0 @@
default: all
top_srcdir = .
include $(top_srcdir)/Makefile.win32.common
all: pixman test
pixman:
@$(MAKE) -C pixman -f Makefile.win32
test:
@$(MAKE) -C test -f Makefile.win32
clean_r:
@$(MAKE) -C pixman -f Makefile.win32 clean
@$(MAKE) -C test -f Makefile.win32 clean
check:
@$(MAKE) -C test -f Makefile.win32 check
clean: clean_r
.PHONY: all pixman test clean check

View File

@ -1,73 +0,0 @@
LIBRARY = pixman-1
ifeq ($(shell echo ""),)
# POSIX style shell
mkdir_p = mkdir -p $1
rm = $(RM) $1
echo = echo "$1"
else
# DOS/Windows style shell
mkdir_p = if not exist $(subst /,\,$1) md $(subst /,\,$1)
echo = echo $1
rm = del $(subst /,\,$1)
endif
CC = cl
LD = link
AR = lib
PERL = perl
ifneq ($(shell echo ""),)
RM = del
endif
ifeq ($(top_builddir),)
top_builddir = $(top_srcdir)
endif
CFG_VAR = $(CFG)
ifeq ($(CFG_VAR),)
CFG_VAR = release
endif
ifeq ($(CFG_VAR),debug)
CFG_CFLAGS = -MDd -Od -Zi
CFG_LDFLAGS = -DEBUG
else
CFG_CFLAGS = -MD -O2
CFG_LDFLAGS =
endif
# Package definitions, to be used instead of those provided in config.h
PKG_CFLAGS = -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
BASE_CFLAGS = -nologo -I. -I$(top_srcdir) -I$(top_srcdir)/pixman
PIXMAN_CFLAGS = $(BASE_CFLAGS) $(PKG_CFLAGS) $(CFG_CFLAGS) $(CFLAGS)
PIXMAN_LDFLAGS = -nologo $(CFG_LDFLAGS) $(LDFLAGS)
PIXMAN_ARFLAGS = -nologo $(LDFLAGS)
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
ifneq ($(CFG),)
@echo "Invalid specified configuration option: "$(CFG)"."
@echo
@echo "Possible choices for configuration are 'release' and 'debug'"
@exit 1
endif
@echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
endif
endif
$(CFG_VAR):
@$(call mkdir_p,$@)
$(CFG_VAR)/%.obj: %.c $(libpixman_headers) | $(CFG_VAR)
$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
clean: inform $(CFG_VAR)
-$(call rm,$(CFG_VAR)/*.exe $(CFG_VAR)/*.ilk $(CFG_VAR)/*.lib $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb)
.PHONY: inform clean

80
README
View File

@ -1,14 +1,20 @@
Pixman
======
Pixman is a library that provides low-level pixel manipulation
features such as image compositing and trapezoid rasterization.
Questions, bug reports and patches should be directed to the pixman
mailing list:
Questions should be directed to the pixman mailing list:
http://lists.freedesktop.org/mailman/listinfo/pixman
https://lists.freedesktop.org/mailman/listinfo/pixman
You can also file bugs at
https://bugs.freedesktop.org/enter_bug.cgi?product=pixman
https://gitlab.freedesktop.org/pixman/pixman/-/issues/new
or submit improvements in form of a Merge Request via
https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests
For real time discussions about pixman, feel free to join the IRC
channels #cairo and #xorg-devel on the FreeNode IRC network.
@ -21,54 +27,66 @@ In order to contribute to pixman, you will need a working knowledge of
the git version control system. For a quick getting started guide,
there is the "Everyday Git With 20 Commands Or So guide"
http://www.kernel.org/pub/software/scm/git/docs/everyday.html
https://www.kernel.org/pub/software/scm/git/docs/everyday.html
from the Git homepage. For more in depth git documentation, see the
resources on the Git community documentation page:
http://git-scm.com/documentation
https://git-scm.com/documentation
Pixman uses the infrastructure from the freedesktop.org umbrella
project. For instructions about how to use the git service on
freedesktop.org, see:
http://www.freedesktop.org/wiki/Infrastructure/git/Developers
https://www.freedesktop.org/wiki/Infrastructure/git/Developers
The Pixman master repository can be found at:
git://anongit.freedesktop.org/git/pixman
and browsed on the web here:
http://cgit.freedesktop.org/pixman/
https://gitlab.freedesktop.org/pixman/pixman
Sending patches
---------------
The general workflow for sending patches is to first make sure that
git can send mail on your system. Then,
Patches should be submitted in form of Merge Requests via Gitlab.
- create a branch off of master in your local git repository
You will first need to create a fork of the main pixman repository at
- make your changes as one or more commits
https://gitlab.freedesktop.org/pixman/pixman
- use the
via the Fork button on the top right. Once that is done you can add your
personal repository as a remote to your local pixman development git checkout:
git send-email
git remote add my-gitlab git@gitlab.freedesktop.org:YOURUSERNAME/pixman.git
command to send the patch series to pixman@lists.freedesktop.org.
git fetch my-gitlab
Make sure to have added ssh keys to your gitlab profile at
https://gitlab.freedesktop.org/profile/keys
Once that is set up, the general workflow for sending patches is to create a
new local branch with your improvements and once it's ready push it to your
personal pixman fork:
git checkout -b fix-some-bug
...
git push my-gitlab
The output of the `git push` command will include a link that allows you to
create a Merge Request against the official pixman repository.
Whenever you make changes to your branch (add new commits or fix up commits)
you push them back to your personal pixman fork:
git push -f my-gitlab
If there is an open Merge Request Gitlab will automatically pick up the
changes from your branch and pixman developers can review them anew.
In order for your patches to be accepted, please consider the
following guidelines:
- This link:
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#patch-series
describes how what a good patch series is, and to create one with
git.
- At each point in the series, pixman should compile and the test
suite should pass.
@ -79,7 +97,7 @@ following guidelines:
You can run the test suite with
make check
meson test -C builddir
It will take around two minutes to run on a modern PC.
@ -101,7 +119,7 @@ following guidelines:
- If review comments were incorporated, a brief version
history describing what those changes were.
- For big patch series, send an introductory email with an overall
- For big patch series, write an introductory post with an overall
description of the patch series, including benchmarks and
motivation. Each commit message should still be descriptive and
include enough information to understand why this particular commit
@ -111,6 +129,6 @@ Pixman has high standards for code quality and so almost everybody
should expect to have the first versions of their patches rejected.
If you think that the reviewers are wrong about something, or that the
guidelines above are wrong, feel free to discuss the issue on the
list. The purpose of the guidelines and code review is to ensure high
code quality; it is not an exercise in compliance.
guidelines above are wrong, feel free to discuss the issue. The purpose
of the guidelines and code review is to ensure high code quality; it is
not an exercise in compliance.

View File

@ -10,12 +10,11 @@ Here are the steps to follow to create a new pixman release:
git log master...origin (no output; note: *3* dots)
2) Increment pixman_(major|minor|micro) in configure.ac and meson.build
according to the directions in those files.
2) Increment the version in meson.build.
3) Make sure that new version works, including
- make distcheck passes
- meson test passes
- the X server still works with the new pixman version
installed

5
a64-neon-test.S Normal file
View File

@ -0,0 +1,5 @@
.text
.arch armv8-a
.altmacro
prfm pldl2strm, [x0]
xtn v0.8b, v0.8h

View File

@ -1,14 +0,0 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
$srcdir/configure "$@"
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
#!/bin/sh
set -ex
./autogen.sh
make -sj4 check

39
debian/changelog vendored
View File

@ -1,3 +1,42 @@
pixman (0.44.0-4) UNRELEASED; urgency=medium
* Team upload.
* debian/copyright: Convert to machine-readable format
-- Dylan Aïssi <daissi@debian.org> Thu, 31 Jul 2025 22:16:23 +0200
pixman (0.44.0-3) unstable; urgency=medium
* Replace timeout bump patch by using a multiplier option instead.
Thanks, Aurelien Jarno! (Closes: #1086999)
-- Timo Aaltonen <tjaalton@debian.org> Sat, 09 Nov 2024 11:02:55 +0200
pixman (0.44.0-2) unstable; urgency=medium
* patches: Increase test timeout 120->240s. (Closes: #1086999)
-- Timo Aaltonen <tjaalton@debian.org> Fri, 08 Nov 2024 09:58:04 +0200
pixman (0.44.0-1) unstable; urgency=medium
* New upstream release.
* patches: Refresh patch.
* control, rules: Build with meson.
* symbols: Updated.
* control: Migrate to pkgconf.
* rules: Drop obsolete dbgsym-migration.
-- Timo Aaltonen <tjaalton@debian.org> Thu, 07 Nov 2024 16:48:29 +0200
pixman (0.42.2-1) unstable; urgency=medium
* New upstream release.
* d/p/Avoid-integer-overflow-leading-to-out-of-bounds-writ.diff:
- Removed, fixed upstream.
-- Emilio Pozuelo Monfort <pochu@debian.org> Fri, 11 Nov 2022 13:42:25 +0100
pixman (0.40.0-1.1) unstable; urgency=medium
* Non-maintainer upload.

3
debian/control vendored
View File

@ -5,7 +5,8 @@ Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: Andreas Boll <aboll@debian.org>
Build-Depends:
debhelper-compat (= 13),
pkg-config,
meson,
pkgconf,
quilt,
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/xorg-team/lib/pixman.git

89
debian/copyright vendored
View File

@ -1,47 +1,48 @@
This package was downloaded from
https://xorg.freedesktop.org/releases/individual/lib/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pixman
Source: https://gitlab.freedesktop.org/pixman/pixman
License: Expat
Debian packaging by Julien Cristau <jcristau@debian.org>, 18 May 2007.
Files: *
Copyright: 1987-1998 The Open Group
1987-1989 Digital Equipment Corporation
1999-2008 Keith Packard
2000 SuSE, Inc.
2000 Keith Packard, member of The XFree86 Project, Inc.
2004-2010 Red Hat, Inc.
2004 Nicholas Miell
2005 Lars Knoll & Zack Rusin, Trolltech
2005 Trolltech AS
2007 Luca Barbato
2008 Aaron Plattner, NVIDIA Corporation
2008 Rodrigo Kumpera
2008 André Tupinambá
2008 Mozilla Corporation
2008 Frederic Plourde
2009, Oracle and/or its affiliates. All rights reserved.
2009-2010 Nokia Corporation
License: Expat
The following is the MIT license, agreed upon by most contributors.
Copyright holders of new code should use this license statement where
possible. They may also add themselves to the list below.
Files: debian/*
Copyright: 2007 Julien Cristau <jcristau@debian.org>
License: Expat
/*
* Copyright 1987, 1988, 1989, 1998 The Open Group
* Copyright 1987, 1988, 1989 Digital Equipment Corporation
* Copyright 1999, 2004, 2008 Keith Packard
* Copyright 2000 SuSE, Inc.
* Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
* Copyright 2004, 2005, 2007, 2008, 2009, 2010 Red Hat, Inc.
* Copyright 2004 Nicholas Miell
* Copyright 2005 Lars Knoll & Zack Rusin, Trolltech
* Copyright 2005 Trolltech AS
* Copyright 2007 Luca Barbato
* Copyright 2008 Aaron Plattner, NVIDIA Corporation
* Copyright 2008 Rodrigo Kumpera
* Copyright 2008 André Tupinambá
* Copyright 2008 Mozilla Corporation
* Copyright 2008 Frederic Plourde
* Copyright 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009, 2010 Nokia Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -80,6 +80,7 @@ libpixman-1.so.0 libpixman-1-0 #MINVER#
pixman_region32_contains_point@Base 0.11.2
pixman_region32_contains_rectangle@Base 0.11.2
pixman_region32_copy@Base 0.11.2
pixman_region32_empty@Base 0.44.0
pixman_region32_equal@Base 0.11.2
pixman_region32_extents@Base 0.11.2
pixman_region32_fini@Base 0.11.2
@ -104,6 +105,7 @@ libpixman-1.so.0 libpixman-1-0 #MINVER#
pixman_region_contains_point@Base 0
pixman_region_contains_rectangle@Base 0
pixman_region_copy@Base 0
pixman_region_empty@Base 0.44.0
pixman_region_equal@Base 0
pixman_region_extents@Base 0
pixman_region_fini@Base 0

View File

@ -1,4 +1,3 @@
usr/lib/*/libpixman-1.so
usr/lib/*/libpixman-1.a
usr/lib/*/pkgconfig
usr/include/pixman-1

View File

@ -1,32 +0,0 @@
From: Matt Turner <mattst88@gmail.com>
Date: Wed, 2 Nov 2022 12:07:32 -0400
Subject: Avoid integer overflow leading to out-of-bounds write
Origin: https://gitlab.freedesktop.org/pixman/pixman/-/commit/a1f88e842e0216a5b4df1ab023caebe33c101395
Bug: https://gitlab.freedesktop.org/pixman/pixman/-/issues/63
Bug-Debian: https://bugs.debian.org/1023427
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-44638
Thanks to Maddie Stone and Google's Project Zero for discovering this
issue, providing a proof-of-concept, and a great analysis.
Closes: https://gitlab.freedesktop.org/pixman/pixman/-/issues/63
---
pixman/pixman-trap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 91766fdbfca0..7560405ee2e4 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -74,7 +74,7 @@ pixman_sample_floor_y (pixman_fixed_t y,
if (f < Y_FRAC_FIRST (n))
{
- if (pixman_fixed_to_int (i) == 0x8000)
+ if (pixman_fixed_to_int (i) == 0xffff8000)
{
f = 0; /* saturate */
}
--
2.37.2

View File

@ -1,2 +1 @@
test-increase-timeout.diff
Avoid-integer-overflow-leading-to-out-of-bounds-writ.diff

View File

@ -1,10 +1,8 @@
Index: pixman/test/alpha-loop.c
===================================================================
--- pixman.orig/test/alpha-loop.c 2013-07-26 14:26:43.905457549 +0200
+++ pixman/test/alpha-loop.c 2013-08-03 10:21:53.498601016 +0200
@@ -21,7 +21,7 @@
pixman_image_t *d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4);
pixman_image_t *s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4);
--- a/test/alpha-loop.c
+++ b/test/alpha-loop.c
@@ -22,7 +22,7 @@ main (int argc, char **argv)
d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4);
s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4);
- fail_after (5, "Infinite loop detected: 5 seconds without progress\n");
+ fail_after (50, "Infinite loop detected: 50 seconds without progress\n");

11
debian/rules vendored
View File

@ -9,8 +9,8 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
override_dh_auto_configure:
# also avoid loongson2f optimizations on mipsel, see 0.26.0-3
# changelog entry:
LS_CFLAGS=" " dh_auto_configure -- --disable-gtk \
--disable-arm-iwmmxt
LS_CFLAGS=" " dh_auto_configure -- \
-Dgtk=disabled
# Install in debian/tmp to retain control through dh_install:
override_dh_auto_install:
@ -21,17 +21,12 @@ override_dh_install:
find debian/tmp -name '*.la' -delete
dh_install
# Debug package:
override_dh_strip:
dh_strip -p$(PACKAGE) --dbgsym-migration="$(PACKAGE)-dbg (<< 0.34.0-2~)"
dh_strip -N$(PACKAGE)
# Shlibs:
override_dh_makeshlibs:
dh_makeshlibs -p$(PACKAGE) --add-udeb $(PACKAGE)-udeb -V"$(PACKAGE) (>= $(SHLIBS))" -- -c4
override_dh_auto_test:
dh_auto_test -- VERBOSE=1
dh_auto_test -- --verbose --timeout-multiplier 3
%:
dh $@ --with quilt --builddirectory=build/

View File

@ -1,60 +0,0 @@
EXTRA_DIST = \
parrot.c \
parrot.jpg \
scale.ui \
dither.ui \
meson.build \
$(NULL)
if HAVE_GTK
AM_CFLAGS = $(OPENMP_CFLAGS)
AM_LDFLAGS = $(OPENMP_CFLAGS)
LDADD = $(top_builddir)/pixman/libpixman-1.la -lm $(GTK_LIBS) $(PNG_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS) $(PNG_CFLAGS)
GTK_UTILS = gtk-utils.c gtk-utils.h ../test/utils.c ../test/utils.h \
../test/utils-prng.c ../test/utils-prng.h
DEMOS = \
clip-test \
clip-in \
composite-test \
gradient-test \
radial-test \
linear-gradient \
conical-test \
alpha-test \
screen-test \
convolution-test \
trap-test \
tri-test \
quad2quad \
checkerboard \
srgb-trap-test \
srgb-test \
scale \
dither
gradient_test_SOURCES = gradient-test.c $(GTK_UTILS)
alpha_test_SOURCES = alpha-test.c $(GTK_UTILS)
composite_test_SOURCES = composite-test.c $(GTK_UTILS)
clip_test_SOURCES = clip-test.c $(GTK_UTILS)
clip_in_SOURCES = clip-in.c $(GTK_UTILS)
trap_test_SOURCES = trap-test.c $(GTK_UTILS)
screen_test_SOURCES = screen-test.c $(GTK_UTILS)
convolution_test_SOURCES = convolution-test.c $(GTK_UTILS)
radial_test_SOURCES = radial-test.c $(GTK_UTILS)
linear_gradient_SOURCES = linear-gradient.c $(GTK_UTILS)
conical_test_SOURCES = conical-test.c $(GTK_UTILS)
tri_test_SOURCES = tri-test.c $(GTK_UTILS)
checkerboard_SOURCES = checkerboard.c $(GTK_UTILS)
srgb_test_SOURCES = srgb-test.c $(GTK_UTILS)
srgb_trap_test_SOURCES = srgb-trap-test.c $(GTK_UTILS)
scale_SOURCES = scale.c $(GTK_UTILS)
dither_SOURCES = dither.c $(GTK_UTILS)
noinst_PROGRAMS = $(DEMOS)
endif

View File

@ -1,4 +1,4 @@
#include "../test/utils.h"
#include "utils.h"
#include "gtk-utils.h"
#define SIZE 128

View File

@ -23,12 +23,12 @@
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "pixman-config.h"
#endif
#include <math.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include "../test/utils.h"
#include "utils.h"
#include "gtk-utils.h"
#define WIDTH 1024
@ -103,48 +103,46 @@ rescale (GtkWidget *may_be_null, app_t *app)
}
static gboolean
on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
app_t *app = data;
GdkRectangle *area = &event->expose.area;
app_t *app = user_data;
GdkRectangle area;
cairo_surface_t *surface;
pixman_image_t *tmp, *final;
cairo_t *cr;
uint32_t *pixels;
gdk_cairo_get_clip_rectangle(cr, &area);
tmp = pixman_image_create_bits (
app->format, area->width, area->height, NULL, 0);
app->format, area.width, area.height, NULL, 0);
pixman_image_set_dither (tmp, app->dither);
pixman_image_composite (
PIXMAN_OP_SRC,
app->original, NULL, tmp,
area->x, area->y, 0, 0, 0, 0,
app->width - area->x,
app->height - area->y);
area.x, area.y, 0, 0, 0, 0,
app->width - area.x,
app->height - area.y);
pixels = calloc (1, area->width * area->height * 4);
pixels = calloc (1, area.width * area.height * 4);
final = pixman_image_create_bits (
PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4);
pixman_image_composite (
PIXMAN_OP_SRC,
tmp, NULL, final,
area->x, area->y, 0, 0, 0, 0,
app->width - area->x,
app->height - area->y);
area.x, area.y, 0, 0, 0, 0,
app->width - area.x,
app->height - area.y);
surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
area->width, area->height, area->width * 4);
area.width, area.height, area.width * 4);
cr = gdk_cairo_create (da->window);
cairo_set_source_surface (cr, surface, area->x, area->y);
cairo_set_source_surface (cr, surface, area.x, area.y);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (surface);
free (pixels);
pixman_image_unref (final);
@ -211,7 +209,7 @@ app_new (pixman_image_t *original)
g_error ("Could not read file dither.ui: %s", err->message);
widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app);
set_up_combo_box (app, "target_format_combo_box",
G_N_ELEMENTS (formats), formats);

View File

@ -1,6 +1,8 @@
#include <gtk/gtk.h>
#include <config.h>
#include "../test/utils.h"
#ifdef HAVE_CONFIG_H
#include <pixman-config.h>
#endif
#include "utils.h"
#include "gtk-utils.h"
pixman_image_t *
@ -93,15 +95,14 @@ pixbuf_from_argb32 (uint32_t *bits,
}
static gboolean
on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
pixman_image_t *pimage = data;
pixman_image_t *pimage = user_data;
int width = pixman_image_get_width (pimage);
int height = pixman_image_get_height (pimage);
int stride = pixman_image_get_stride (pimage);
cairo_surface_t *cimage;
cairo_format_t format;
cairo_t *cr;
if (pixman_image_get_format (pimage) == PIXMAN_x8r8g8b8)
format = CAIRO_FORMAT_RGB24;
@ -112,13 +113,10 @@ on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
(uint8_t *)pixman_image_get_data (pimage),
format, width, height, stride);
cr = gdk_cairo_create (widget->window);
cairo_rectangle (cr, 0, 0, width, height);
cairo_set_source_surface (cr, cimage, 0, 0);
cairo_fill (cr);
cairo_destroy (cr);
cairo_surface_destroy (cimage);
return TRUE;
@ -170,7 +168,7 @@ show_image (pixman_image_t *image)
break;
}
g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), copy);
g_signal_connect (window, "draw", G_CALLBACK (on_draw), copy);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (window);

View File

@ -1,4 +1,4 @@
#include "../test/utils.h"
#include "utils.h"
#include "gtk-utils.h"
#define WIDTH 1024

View File

@ -47,7 +47,7 @@ if dep_gtk.found()
libdemo = static_library(
'demo',
['gtk-utils.c', config_h, version_h],
dependencies : [dep_gtk, dep_glib, dep_png, dep_m, dep_openmp],
dependencies : [libtestutils_dep, dep_gtk, dep_glib, dep_png, dep_m, dep_openmp],
include_directories : inc_pixman,
)
@ -57,8 +57,8 @@ if dep_gtk.found()
d,
[d + '.c', config_h, version_h],
c_args : extra_demo_cflags,
link_with : [libdemo, libtestutils],
dependencies : [dep_glib, dep_gtk, dep_openmp, idep_pixman],
link_with : [libdemo],
dependencies : [idep_pixman, libtestutils_dep, dep_glib, dep_gtk, dep_openmp, dep_png],
)
endforeach
endif

View File

@ -1,4 +1,4 @@
#include "../test/utils.h"
#include "utils.h"
#include "gtk-utils.h"
#define NUM_GRADIENTS 9

View File

@ -24,7 +24,7 @@
* Author: Soren Sandmann <soren.sandmann@gmail.com>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "pixman-config.h"
#endif
#include <math.h>
#include <gtk/gtk.h>
@ -278,39 +278,37 @@ rescale (GtkWidget *may_be_null, app_t *app)
}
static gboolean
on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
app_t *app = data;
GdkRectangle *area = &event->expose.area;
app_t *app = user_data;
GdkRectangle area;
cairo_surface_t *surface;
pixman_image_t *tmp;
cairo_t *cr;
uint32_t *pixels;
pixels = calloc (1, area->width * area->height * 4);
tmp = pixman_image_create_bits (
PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
gdk_cairo_get_clip_rectangle(cr, &area);
if (area->x < app->scaled_width && area->y < app->scaled_height)
pixels = calloc (1, area.width * area.height * 4);
tmp = pixman_image_create_bits (
PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4);
if (area.x < app->scaled_width && area.y < app->scaled_height)
{
pixman_image_composite (
PIXMAN_OP_SRC,
app->original, NULL, tmp,
area->x, area->y, 0, 0, 0, 0,
app->scaled_width - area->x, app->scaled_height - area->y);
area.x, area.y, 0, 0, 0, 0,
app->scaled_width - area.x, app->scaled_height - area.y);
}
surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
area->width, area->height, area->width * 4);
area.width, area.height, area.width * 4);
cr = gdk_cairo_create (da->window);
cairo_set_source_surface (cr, surface, area->x, area->y);
cairo_set_source_surface (cr, surface, area.x, area.y);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (surface);
free (pixels);
pixman_image_unref (tmp);
@ -400,7 +398,7 @@ app_new (pixman_image_t *original)
gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);
widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app);
set_up_filter_box (app, "reconstruct_x_combo_box");
set_up_filter_box (app, "reconstruct_y_combo_box");

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../test/utils.h"
#include "utils.h"
#include "gtk-utils.h"
int

View File

@ -21,10 +21,10 @@
project(
'pixman',
['c'],
version : '0.40.0',
version : '0.44.0',
license : 'MIT',
meson_version : '>= 0.50.0',
default_options : ['buildtype=debugoptimized'],
meson_version : '>= 0.52.0',
default_options : ['c_std=gnu99', 'buildtype=debugoptimized'],
)
config = configuration_data()
@ -37,6 +37,12 @@ add_project_arguments(
'-fno-strict-aliasing',
'-fvisibility=hidden',
'-Wundef',
# -ftrapping-math is the default for gcc, but -fno-trapping-math is the
# default for clang. The FLOAT_IS_ZERO macro is used to guard against
# floating-point exceptions, however with -fno-trapping-math, the compiler
# can reorder floating-point operations so that they occur before the guard.
# Note, this function is ignored in clang < 10.0.0.
'-ftrapping-math'
]),
language : ['c']
)
@ -237,6 +243,41 @@ if not use_vmx.disabled()
endif
endif
if cc.compiles('''
__asm__ (
".func meson_test"
".endfunc"
);''',
name : 'test for ASM .func directive')
config.set('ASM_HAVE_FUNC_DIRECTIVE', 1)
endif
if cc.compiles('''
__asm__ (
".syntax unified\n"
);''',
name : 'test for ASM .syntax unified directive')
config.set('ASM_HAVE_SYNTAX_UNIFIED', 1)
endif
if cc.links('''
#include <stdint.h>
__asm__ (
" .global _testlabel\n"
"_testlabel:\n"
);
int testlabel();
int main(int argc, char* argv[]) {
return testlabel();
}''',
name : 'test for ASM leading underscore')
config.set('ASM_LEADING_UNDERSCORE', 1)
endif
if have_vmx
config.set10('USE_VMX', true)
elif use_vmx.enabled()
@ -275,52 +316,27 @@ elif use_neon.enabled()
error('NEON Support unavailable, but required')
endif
use_iwmmxt = get_option('iwmmxt')
have_iwmmxt = false
iwmmxt_flags = ['-flax-vector-conversions', '-Winline']
if not use_iwmmxt.disabled()
if get_option('iwmmxt2')
iwmmxt_flags += '-march=iwmmxt2'
else
iwmmxt_flags += '-march=iwmmxt'
endif
if host_machine.cpu_family() == 'arm'
if cc.compiles('''
#ifndef __IWMMXT__
#error "IWMMXT not enabled (with -march=iwmmxt)"
#endif
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
#error "Need GCC >= 4.8 for IWMMXT intrinsics"
#endif
#include <mmintrin.h>
int main () {
union {
__m64 v;
char c[8];
} a = { .c = {1, 2, 3, 4, 5, 6, 7, 8} };
int b = 4;
__m64 c = _mm_srli_si64 (a.v, b);
}
''',
args : iwmmxt_flags,
name : 'IWMMXT Intrinsic Support')
have_iwmmxt = true
use_a64neon = get_option('a64-neon')
have_a64neon = false
if not use_a64neon.disabled()
if host_machine.cpu_family() == 'aarch64'
if cc.compiles(files('a64-neon-test.S'), name : 'NEON A64 Intrinsic Support')
have_a64neon = true
endif
endif
endif
if have_iwmmxt
config.set10('USE_ARM_IWMMXT', true)
elif use_iwmmxt.enabled()
error('IWMMXT Support unavailable, but required')
if have_a64neon
config.set10('USE_ARM_A64_NEON', true)
elif use_a64neon.enabled()
error('A64 NEON Support unavailable, but required')
endif
use_mips_dspr2 = get_option('mips-dspr2')
have_mips_dspr2 = false
mips_dspr2_flags = ['-mdspr2']
if not use_mips_dspr2.disabled()
if host_machine.cpu_family() == 'mips32'
if host_machine.cpu_family().startswith('mips')
if cc.compiles('''
#if !(defined(__mips__) && __mips_isa_rev >= 2)
#error MIPS DSPr2 is currently only available on MIPS32r2 platforms.
@ -336,7 +352,7 @@ if not use_mips_dspr2.disabled()
);
return c;
}''',
args : mipds_dspr2_flags,
args : mips_dspr2_flags,
name : 'DSPr2 Intrinsic Support')
have_mips_dspr2 = true
endif
@ -349,6 +365,28 @@ elif use_mips_dspr2.enabled()
error('MIPS DSPr2 Support unavailable, but required')
endif
use_rvv = get_option('rvv')
have_rvv = false
rvv_flags = ['-march=rv64gcv']
if not use_rvv.disabled()
if host_machine.cpu_family() == 'riscv64'
if cc.compiles('''
#include <riscv_vector.h>
int main() { vfloat32m1_t tmp; return 0; }
''',
args : rvv_flags,
name : 'RISC-V Vector Intrinsic Support')
have_rvv = true
endif
endif
endif
if have_rvv
config.set10('USE_RVV', true)
elif use_rvv.enabled()
error('RISC-V Vector Support unavailable, but required')
endif
use_gnu_asm = get_option('gnu-inline-asm')
if not use_gnu_asm.disabled()
if cc.compiles('''
@ -390,10 +428,8 @@ else
dep_openmp = null_dep
endif
dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk'))
dep_glib = dependency('glib-2.0', required : get_option('gtk'))
dep_pixman = dependency('pixman-1', required : get_option('gtk'),
version : '>= ' + meson.project_version())
dep_gtk = dependency('gtk+-3.0', required : get_option('gtk').enabled() and get_option('demos').enabled())
dep_glib = dependency('glib-2.0', required : get_option('gtk').enabled() and get_option('demos').enabled())
dep_png = null_dep
if not get_option('libpng').disabled()
@ -437,6 +473,9 @@ if dep_threads.found() and cc.has_header('pthread.h')
else
pthreads_found = true
endif
else
# Avoid linking with -pthread if we don't actually have pthreads
dep_threads = null_dep
endif
if pthreads_found
@ -472,15 +511,25 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h']
endif
endforeach
# gcc on Windows only warns that __declspec(thread) isn't supported,
# passing -Werror=attributes makes it fail.
if (host_machine.system() == 'windows' and
cc.compiles('int __declspec(thread) foo;',
args : cc.get_supported_arguments(['-Werror=attributes']),
name : 'TLS via __declspec(thread)'))
config.set('TLS', '__declspec(thread)')
elif cc.compiles('int __thread foo;', name : 'TLS via __thread')
config.set('TLS', '__thread')
use_tls = get_option('tls')
have_tls = ''
if not use_tls.disabled()
# gcc on Windows only warns that __declspec(thread) isn't supported,
# passing -Werror=attributes makes it fail.
if (host_machine.system() == 'windows' and
cc.compiles('int __declspec(thread) foo;',
args : cc.get_supported_arguments(['-Werror=attributes']),
name : 'TLS via __declspec(thread)'))
have_tls = '__declspec(thread)'
elif cc.compiles('int __thread foo;', name : 'TLS via __thread')
have_tls = '__thread'
endif
endif
if have_tls != ''
config.set('TLS', have_tls)
elif use_tls.enabled()
error('Compiler TLS Support unavailable, but required')
endif
if cc.links('''
@ -492,6 +541,15 @@ if cc.links('''
config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR', 1)
endif
if cc.links('''
static int x = 1;
static void __attribute__((destructor)) destructor_function () { x = 0; }
int main (void) { return x; }
''',
name : '__attribute__((destructor))')
config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_DESTRUCTOR', 1)
endif
if cc.links(
' __float128 a = 1.0Q, b = 2.0Q; int main (void) { return a + b; }',
name : 'Has float128 support')
@ -528,15 +586,24 @@ version_conf.set('PIXMAN_VERSION_MICRO', split[2])
add_project_arguments('-DHAVE_CONFIG_H', language : ['c'])
subdir('pixman')
subdir('test')
subdir('demos')
if not get_option('tests').disabled() or not get_option('demos').disabled()
subdir(join_paths('test', 'utils'))
endif
if not get_option('demos').disabled()
subdir('demos')
endif
if not get_option('tests').disabled()
subdir('test')
endif
pkg = import('pkgconfig')
pkg.generate(
pkg.generate(libpixman,
name : 'Pixman',
filebase : 'pixman-1',
description : 'The pixman library (version 1)',
libraries : libpixman,
subdirs: 'pixman-1',
version : meson.project_version(),
)

View File

@ -54,30 +54,39 @@ option(
description : 'Use ARM NEON intrinsic optimized paths',
)
option(
'iwmmxt',
'a64-neon',
type : 'feature',
description : 'Use ARM IWMMXT intrinsic optimized paths',
)
option(
'iwmmxt2',
type : 'boolean',
value : true,
description : 'Use ARM IWMMXT2 intrinsic instead of IWMMXT',
description : 'Use ARM A64 NEON intrinsic optimized paths',
)
option(
'mips-dspr2',
type : 'feature',
description : 'Use MIPS32 DSPr2 intrinsic optimized paths',
)
option(
'rvv',
type : 'feature',
description : 'Use RISC-V Vector extension',
)
option(
'gnu-inline-asm',
type : 'feature',
description : 'Use GNU style inline assembler',
)
option(
'tls',
type : 'feature',
description : 'Use compiler support for thread-local storage',
)
option(
'cpu-features-path',
type : 'string',
description : 'Path to platform-specific cpu-features.[ch] for systems that do not provide it (e.g. Android)',
)
option(
'openmp',
type : 'feature',
description : 'Enable openmp support',
description : 'Enable OpenMP for tests',
)
option(
'timers',
@ -94,10 +103,20 @@ option(
option(
'gtk',
type : 'feature',
description : 'Enable tests using GTK',
description : 'Enable demos using GTK',
)
option(
'libpng',
type : 'feature',
description : 'Use libpng'
description : 'Use libpng in tests'
)
option(
'tests',
type : 'feature',
description : 'Build tests'
)
option(
'demos',
type : 'feature',
description : 'Build demos'
)

View File

@ -1,5 +0,0 @@
Name: Pixman
Description: The pixman library (version 1)
Version: @PACKAGE_VERSION@
Cflags: -I${pc_top_builddir}/${pcfiledir}/pixman
Libs: ${pc_top_builddir}/${pcfiledir}/pixman/libpixman-1.la

View File

@ -1,11 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Pixman
Description: The pixman library (version 1)
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}/pixman-1
Libs: -L${libdir} -lpixman-1

View File

@ -1,143 +0,0 @@
include $(top_srcdir)/pixman/Makefile.sources
lib_LTLIBRARIES = libpixman-1.la
libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined @PTHREAD_LDFLAGS@
libpixman_1_la_LIBADD = @PTHREAD_LIBS@ -lm
libpixman_1_la_SOURCES = $(libpixman_sources) $(libpixman_headers)
libpixmanincludedir = $(includedir)/pixman-1
libpixmaninclude_HEADERS = pixman.h pixman-version.h
noinst_LTLIBRARIES =
EXTRA_DIST = \
Makefile.win32 \
dither/make-blue-noise.c \
pixman-region.c \
solaris-hwcap.mapfile \
meson.build \
$(NULL)
# mmx code
if USE_X86_MMX
noinst_LTLIBRARIES += libpixman-mmx.la
libpixman_mmx_la_SOURCES = \
pixman-mmx.c
libpixman_mmx_la_CFLAGS = $(MMX_CFLAGS)
libpixman_1_la_LDFLAGS += $(MMX_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-mmx.la
ASM_CFLAGS_mmx=$(MMX_CFLAGS)
endif
# vmx code
if USE_VMX
noinst_LTLIBRARIES += libpixman-vmx.la
libpixman_vmx_la_SOURCES = \
pixman-vmx.c \
pixman-combine32.h
libpixman_vmx_la_CFLAGS = $(VMX_CFLAGS)
libpixman_1_la_LIBADD += libpixman-vmx.la
ASM_CFLAGS_vmx=$(VMX_CFLAGS)
endif
# sse2 code
if USE_SSE2
noinst_LTLIBRARIES += libpixman-sse2.la
libpixman_sse2_la_SOURCES = \
pixman-sse2.c
libpixman_sse2_la_CFLAGS = $(SSE2_CFLAGS)
libpixman_1_la_LDFLAGS += $(SSE2_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-sse2.la
ASM_CFLAGS_sse2=$(SSE2_CFLAGS)
endif
# ssse3 code
if USE_SSSE3
noinst_LTLIBRARIES += libpixman-ssse3.la
libpixman_ssse3_la_SOURCES = \
pixman-ssse3.c
libpixman_ssse3_la_CFLAGS = $(SSSE3_CFLAGS)
libpixman_1_la_LDFLAGS += $(SSSE3_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-ssse3.la
ASM_CFLAGS_ssse3=$(SSSE3_CFLAGS)
endif
# arm simd code
if USE_ARM_SIMD
noinst_LTLIBRARIES += libpixman-arm-simd.la
libpixman_arm_simd_la_SOURCES = \
pixman-arm-simd.c \
pixman-arm-common.h \
pixman-arm-simd-asm.S \
pixman-arm-simd-asm-scaled.S \
pixman-arm-asm.h \
pixman-arm-simd-asm.h
libpixman_1_la_LIBADD += libpixman-arm-simd.la
ASM_CFLAGS_arm_simd=
endif
# arm neon code
if USE_ARM_NEON
noinst_LTLIBRARIES += libpixman-arm-neon.la
libpixman_arm_neon_la_SOURCES = \
pixman-arm-neon.c \
pixman-arm-common.h \
pixman-arm-neon-asm.S \
pixman-arm-neon-asm-bilinear.S \
pixman-arm-asm.h \
pixman-arm-neon-asm.h
libpixman_1_la_LIBADD += libpixman-arm-neon.la
ASM_CFLAGS_arm_neon=
endif
# iwmmxt code
if USE_ARM_IWMMXT
libpixman_iwmmxt_la_SOURCES = pixman-mmx.c
noinst_LTLIBRARIES += libpixman-iwmmxt.la
libpixman_1_la_LIBADD += libpixman-iwmmxt.la
libpixman_iwmmxt_la-pixman-mmx.lo: pixman-mmx.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $(IWMMXT_CFLAGS) -MT libpixman_iwmmxt_la-pixman-mmx.lo -MD -MP -MF $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Tpo -c -o libpixman_iwmmxt_la-pixman-mmx.lo `test -f 'pixman-mmx.c' || echo '$(srcdir)/'`pixman-mmx.c
$(AM_V_at)$(am__mv) $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Tpo $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Plo
libpixman_iwmmxt_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
libpixman_iwmmxt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(CFLAGS) $(IWMMXT_CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
libpixman-iwmmxt.la: libpixman_iwmmxt_la-pixman-mmx.lo $(libpixman_iwmmxt_la_DEPENDENCIES)
$(AM_V_CCLD)$(libpixman_iwmmxt_la_LINK) libpixman_iwmmxt_la-pixman-mmx.lo $(libpixman_iwmmxt_la_LIBADD) $(LIBS)
endif
# mips dspr2 code
if USE_MIPS_DSPR2
noinst_LTLIBRARIES += libpixman-mips-dspr2.la
libpixman_mips_dspr2_la_SOURCES = \
pixman-mips-dspr2.c \
pixman-mips-dspr2.h \
pixman-mips-dspr2-asm.S \
pixman-mips-dspr2-asm.h \
pixman-mips-memcpy-asm.S
libpixman_1_la_LIBADD += libpixman-mips-dspr2.la
ASM_CFLAGS_mips_dspr2=
endif
# loongson code
if USE_LOONGSON_MMI
noinst_LTLIBRARIES += libpixman-loongson-mmi.la
libpixman_loongson_mmi_la_SOURCES = pixman-mmx.c loongson-mmintrin.h
libpixman_loongson_mmi_la_CFLAGS = $(LS_CFLAGS)
libpixman_1_la_LDFLAGS += $(LS_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-loongson-mmi.la
endif
.c.s : $(libpixmaninclude_HEADERS)
$(CC) $(CFLAGS) $(ASM_CFLAGS_$(@:pixman-%.s=%)) $(ASM_CFLAGS_$(@:pixman-arm-%.s=arm_%)) -DHAVE_CONFIG_H -I$(srcdir) -I$(builddir) -I$(top_builddir) -S -o $@ $<

View File

@ -1,43 +0,0 @@
libpixman_sources = \
pixman.c \
pixman-access.c \
pixman-access-accessors.c \
pixman-bits-image.c \
pixman-combine32.c \
pixman-combine-float.c \
pixman-conical-gradient.c \
pixman-filter.c \
pixman-x86.c \
pixman-mips.c \
pixman-arm.c \
pixman-ppc.c \
pixman-edge.c \
pixman-edge-accessors.c \
pixman-fast-path.c \
pixman-glyph.c \
pixman-general.c \
pixman-gradient-walker.c \
pixman-image.c \
pixman-implementation.c \
pixman-linear-gradient.c \
pixman-matrix.c \
pixman-noop.c \
pixman-radial-gradient.c \
pixman-region16.c \
pixman-region32.c \
pixman-solid-fill.c \
pixman-timer.c \
pixman-trap.c \
pixman-utils.c \
$(NULL)
libpixman_headers = \
dither/blue-noise-64x64.h \
pixman.h \
pixman-accessor.h \
pixman-combine32.h \
pixman-compiler.h \
pixman-edge-imp.h \
pixman-inlines.h \
pixman-private.h \
$(NULL)

View File

@ -1,93 +0,0 @@
default: all
top_srcdir = ..
include $(top_srcdir)/pixman/Makefile.sources
include $(top_srcdir)/Makefile.win32.common
MMX_VAR = $(MMX)
ifeq ($(MMX_VAR),)
MMX_VAR=on
endif
SSE2_VAR = $(SSE2)
ifeq ($(SSE2_VAR),)
SSE2_VAR=on
endif
SSSE3_VAR = $(SSSE3)
ifeq ($(SSSE3_VAR),)
SSSE3_VAR=on
endif
MMX_CFLAGS = -DUSE_X86_MMX -w14710 -w14714
SSE2_CFLAGS = -DUSE_SSE2
SSSE3_CFLAGS = -DUSE_SSSE3
# MMX compilation flags
ifeq ($(MMX_VAR),on)
PIXMAN_CFLAGS += $(MMX_CFLAGS)
libpixman_sources += pixman-mmx.c
endif
# SSE2 compilation flags
ifeq ($(SSE2_VAR),on)
PIXMAN_CFLAGS += $(SSE2_CFLAGS)
libpixman_sources += pixman-sse2.c
endif
# SSSE3 compilation flags
ifeq ($(SSSE3_VAR),on)
PIXMAN_CFLAGS += $(SSSE3_CFLAGS)
libpixman_sources += pixman-ssse3.c
endif
OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libpixman_sources))
# targets
all: inform informMMX informSSE2 informSSSE3 $(CFG_VAR)/$(LIBRARY).lib
informMMX:
ifneq ($(MMX),off)
ifneq ($(MMX),on)
ifneq ($(MMX),)
@echo "Invalid specified MMX option : "$(MMX_VAR)"."
@echo
@echo "Possible choices for MMX are 'on' or 'off'"
@exit 1
endif
@echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
endif
endif
informSSE2:
ifneq ($(SSE2),off)
ifneq ($(SSE2),on)
ifneq ($(SSE2),)
@echo "Invalid specified SSE option : "$(SSE2)"."
@echo
@echo "Possible choices for SSE2 are 'on' or 'off'"
@exit 1
endif
@echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
endif
endif
informSSSE3:
ifneq ($(SSSE3),off)
ifneq ($(SSSE3),on)
ifneq ($(SSSE3),)
@echo "Invalid specified SSE option : "$(SSSE3)"."
@echo
@echo "Possible choices for SSSE3 are 'on' or 'off'"
@exit 1
endif
@echo "Setting SSSE3 flag to default value 'on'... (use SSSE3=on or SSSE3=off)"
endif
endif
# pixman linking
$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
.PHONY: all informMMX informSSE2 informSSSE3

View File

@ -73,7 +73,7 @@ print <<"PROLOG";
#include <stdint.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#include <pixman-config.h>
#endif
#include "pixman-private.h"

View File

@ -20,7 +20,7 @@
config_h = configure_file(
configuration : config,
output : 'config.h'
output : 'pixman-config.h'
)
version_h = configure_file(
@ -31,21 +31,20 @@ version_h = configure_file(
)
libpixman_extra_cargs = []
if cc.has_function_attribute('dllexport')
default_library = get_option('default_library')
if default_library != 'static' and cc.has_function_attribute('dllexport')
libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)']
endif
pixman_simd_libs = []
simds = [
# the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on
# some arm cores, or loongson mmi on loongson mips systems. The
# libraries will all have the same name, "pixman-mmx", but there is
# no chance of more than one version being built in the same build
# because no system could have mmx, iwmmxt, and mmi, and it
# simplifies the build logic to give them the same name.
# the mmx library can be compiled with mmx on x86/x86_64 or loongson
# mmi on loongson mips systems. The libraries will all have the same
# name, "pixman-mmx", but there is no chance of more than one version
# being built in the same build because no system could have mmx and
# mmi, and it simplifies the build logic to give them the same name.
['mmx', have_mmx, mmx_flags, []],
['mmx', have_loongson_mmi, loongson_mmi_flags, []],
['mmx', have_iwmmxt, iwmmxt_flags, []],
['sse2', have_sse2, sse2_flags, []],
['ssse3', have_ssse3, ssse3_flags, []],
@ -54,8 +53,11 @@ simds = [
['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']],
['arm-neon', have_neon, [],
['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-bilinear.S']],
['arm-neon', have_a64neon, [],
['pixman-arma64-neon-asm.S', 'pixman-arma64-neon-asm-bilinear.S']],
['mips-dspr2', have_mips_dspr2, mips_dspr2_flags,
['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']],
['rvv', have_rvv, rvv_flags, []],
]
foreach simd : simds
@ -73,18 +75,15 @@ pixman_files = files(
'pixman.c',
'pixman-access.c',
'pixman-access-accessors.c',
'pixman-arm.c',
'pixman-bits-image.c',
'pixman-combine32.c',
'pixman-combine-float.c',
'pixman-conical-gradient.c',
'pixman-filter.c',
'pixman-x86.c',
'pixman-mips.c',
'pixman-arm.c',
'pixman-ppc.c',
'pixman-edge.c',
'pixman-edge-accessors.c',
'pixman-fast-path.c',
'pixman-filter.c',
'pixman-glyph.c',
'pixman-general.c',
'pixman-gradient-walker.c',
@ -92,29 +91,40 @@ pixman_files = files(
'pixman-implementation.c',
'pixman-linear-gradient.c',
'pixman-matrix.c',
'pixman-mips.c',
'pixman-noop.c',
'pixman-ppc.c',
'pixman-radial-gradient.c',
'pixman-region16.c',
'pixman-region32.c',
'pixman-riscv.c',
'pixman-solid-fill.c',
'pixman-timer.c',
'pixman-trap.c',
'pixman-utils.c',
'pixman-x86.c',
)
# We cannot use 'link_with' or 'link_whole' because meson wont do the right
# thing for static archives.
_obs = []
foreach l : pixman_simd_libs
_obs += l.extract_all_objects()
endforeach
# Android cpu-features
cpu_features_path = get_option('cpu-features-path')
cpu_features_sources = []
cpu_features_inc = []
if cpu_features_path != ''
message('Using cpu-features.[ch] from ' + cpu_features_path)
cpu_features_sources = files(
cpu_features_path / 'cpu-features.h',
cpu_features_path / 'cpu-features.c',
)
cpu_features_inc = include_directories(cpu_features_path)
endif
libpixman = library(
'pixman-1',
[pixman_files, config_h, version_h],
objects : _obs,
[pixman_files, config_h, version_h, cpu_features_sources],
link_with: pixman_simd_libs,
c_args : libpixman_extra_cargs,
dependencies : [dep_m, dep_threads],
include_directories : cpu_features_inc,
version : meson.project_version(),
install : true,
)
@ -126,4 +136,8 @@ idep_pixman = declare_dependency(
include_directories : inc_pixman,
)
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('pixman-1', idep_pixman)
endif
install_headers('pixman.h', subdir : 'pixman-1')

View File

@ -25,7 +25,7 @@
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#include <pixman-config.h>
#endif
#include <stdlib.h>
@ -465,7 +465,7 @@ convert_and_store_pixel (bits_image_t * image,
image, bits, offset, PIXMAN_ ## format); \
} \
\
static const void *const __dummy__ ## format
static const void *const __dummy__ ## format MAYBE_UNUSED
MAKE_ACCESSORS(a8r8g8b8);
MAKE_ACCESSORS(x8r8g8b8);
@ -610,6 +610,32 @@ fetch_scanline_a8r8g8b8_sRGB_float (bits_image_t * image,
}
}
static void
fetch_scanline_r8g8b8_sRGB_float (bits_image_t * image,
int x,
int y,
int width,
uint32_t * b,
const uint32_t *mask)
{
const uint8_t *bits = (uint8_t *)(image->bits + y * image->rowstride);
argb_t *buffer = (argb_t *)b;
int i;
for (i = x; i < width; ++i)
{
uint32_t p = FETCH_24 (image, bits, i);
argb_t *argb = buffer;
argb->a = 1.0f;
argb->r = to_linear[(p >> 16) & 0xff];
argb->g = to_linear[(p >> 8) & 0xff];
argb->b = to_linear[(p >> 0) & 0xff];
buffer++;
}
}
/* Expects a float buffer */
static void
fetch_scanline_a2r10g10b10_float (bits_image_t * image,
@ -981,6 +1007,24 @@ fetch_pixel_a8r8g8b8_sRGB_float (bits_image_t *image,
return argb;
}
static argb_t
fetch_pixel_r8g8b8_sRGB_float (bits_image_t *image,
int offset,
int line)
{
uint8_t *bits = (uint8_t *)(image->bits + line * image->rowstride);
uint32_t p = FETCH_24 (image, bits, offset);
argb_t argb;
argb.a = 1.0f;
argb.r = to_linear[(p >> 16) & 0xff];
argb.g = to_linear[(p >> 8) & 0xff];
argb.b = to_linear[(p >> 0) & 0xff];
return argb;
}
static uint32_t
fetch_pixel_yuy2 (bits_image_t *image,
int offset,
@ -1205,6 +1249,31 @@ store_scanline_a8r8g8b8_sRGB_float (bits_image_t * image,
}
}
static void
store_scanline_r8g8b8_sRGB_float (bits_image_t * image,
int x,
int y,
int width,
const uint32_t *v)
{
uint8_t *bits = (uint8_t *)(image->bits + image->rowstride * y) + 3 * x;
argb_t *values = (argb_t *)v;
int i;
for (i = 0; i < width; ++i)
{
uint32_t r, g, b, rgb;
r = to_srgb (values[i].r);
g = to_srgb (values[i].g);
b = to_srgb (values[i].b);
rgb = (r << 16) | (g << 8) | b;
STORE_24 (image, bits, i, rgb);
}
}
/*
* Contracts a floating point image to 32bpp and then stores it using a
* regular 32-bit store proc. Despite the type, this function expects an
@ -1283,6 +1352,37 @@ fetch_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
}
}
static void
fetch_scanline_r8g8b8_32_sRGB (bits_image_t *image,
int x,
int y,
int width,
uint32_t *buffer,
const uint32_t *mask)
{
const uint8_t *bits = (uint8_t *)(image->bits + y * image->rowstride) + 3 * x;
uint32_t tmp;
int i;
for (i = 0; i < width; ++i)
{
uint32_t a, r, g, b;
tmp = FETCH_24 (image, bits, i);
a = 0xff;
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_linear[r] * 255.0f + 0.5f;
g = to_linear[g] * 255.0f + 0.5f;
b = to_linear[b] * 255.0f + 0.5f;
*buffer++ = (a << 24) | (r << 16) | (g << 8) | (b << 0);
}
}
static uint32_t
fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
int offset,
@ -1304,6 +1404,27 @@ fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
return (a << 24) | (r << 16) | (g << 8) | (b << 0);
}
static uint32_t
fetch_pixel_r8g8b8_32_sRGB (bits_image_t *image,
int offset,
int line)
{
uint8_t *bits = (uint8_t *)(image->bits + line * image->rowstride);
uint32_t tmp = FETCH_24 (image, bits, offset);
uint32_t a, r, g, b;
a = 0xff;
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_linear[r] * 255.0f + 0.5f;
g = to_linear[g] * 255.0f + 0.5f;
b = to_linear[b] * 255.0f + 0.5f;
return (a << 24) | (r << 16) | (g << 8) | (b << 0);
}
static void
store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
int x,
@ -1336,6 +1457,36 @@ store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
}
}
static void
store_scanline_r8g8b8_32_sRGB (bits_image_t *image,
int x,
int y,
int width,
const uint32_t *v)
{
uint8_t *bits = (uint8_t *)(image->bits + image->rowstride * y) + 3 * x;
uint64_t *values = (uint64_t *)v;
uint64_t tmp;
int i;
for (i = 0; i < width; ++i)
{
uint32_t r, g, b;
tmp = values[i];
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_srgb (r * (1/255.0f));
g = to_srgb (g * (1/255.0f));
b = to_srgb (b * (1/255.0f));
STORE_24 (image, bits, i, (r << 16) | (g << 8) | (b << 0));
}
}
static argb_t
fetch_pixel_generic_float (bits_image_t *image,
int offset,
@ -1409,6 +1560,11 @@ static const format_info_t accessors[] =
fetch_pixel_a8r8g8b8_32_sRGB, fetch_pixel_a8r8g8b8_sRGB_float,
store_scanline_a8r8g8b8_32_sRGB, store_scanline_a8r8g8b8_sRGB_float,
},
{ PIXMAN_r8g8b8_sRGB,
fetch_scanline_r8g8b8_32_sRGB, fetch_scanline_r8g8b8_sRGB_float,
fetch_pixel_r8g8b8_32_sRGB, fetch_pixel_r8g8b8_sRGB_float,
store_scanline_r8g8b8_32_sRGB, store_scanline_r8g8b8_sRGB_float,
},
/* 24bpp formats */
FORMAT_INFO (r8g8b8),

View File

@ -25,13 +25,86 @@
*
*/
/* Supplementary macro for setting function attributes */
.macro pixman_asm_function fname
.func fname
.global fname
#ifdef __ELF__
.hidden fname
.type fname, %function
#ifndef PIXMAN_ARM_ASM_H
#define PIXMAN_ARM_ASM_H
#include "pixman-config.h"
/*
* References:
* - https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros
* - https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst
*/
#if defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1
#define BTI_C hint 34 /* bti c: for calls, IE bl instructions */
#define GNU_PROPERTY_AARCH64_BTI 1 /* bit 0 GNU Notes is for BTI support */
#else
#define BTI_C
#define GNU_PROPERTY_AARCH64_BTI 0
#endif
fname:
#if defined(__ARM_FEATURE_PAC_DEFAULT)
#if __ARM_FEATURE_PAC_DEFAULT & 1
#define SIGN_LR hint 25 /* paciasp: sign with the A key */
#define VERIFY_LR hint 29 /* autiasp: verify with the b key */
#elif __ARM_FEATURE_PAC_DEFAULT & 2
#define SIGN_LR hint 27 /* pacibsp: sign with the b key */
#define VERIFY_LR hint 31 /* autibsp: verify with the b key */
#endif
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 2 /* bit 1 GNU Notes is for PAC support */
#else
#define SIGN_LR BTI_C
#define VERIFY_LR
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 0
#endif
/* Add the BTI support to GNU Notes section for ASM files */
#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0
.pushsection .note.gnu.property, "a"; /* Start a new allocatable section */
.balign 8; /* align it on a byte boundry */
.long 4; /* size of "GNU\0" */
.long 0x10; /* size of descriptor */
.long 0x5; /* NT_GNU_PROPERTY_TYPE_0 */
.asciz "GNU";
.long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
.long 4; /* Four bytes of data */
.long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH); /* BTI or PAC is enabled */
.long 0; /* padding for 8 byte alignment */
.popsection; /* end the section */
#endif
/* Supplementary macro for setting function attributes */
.macro pixman_asm_function_impl fname
#ifdef ASM_HAVE_FUNC_DIRECTIVE
.func \fname
#endif
.global \fname
#ifdef __ELF__
.hidden \fname
.type \fname, %function
#endif
\fname:
SIGN_LR
.endm
.macro pixman_asm_function fname
#ifdef ASM_LEADING_UNDERSCORE
pixman_asm_function_impl _\fname
#else
pixman_asm_function_impl \fname
#endif
.endm
.macro pixman_syntax_unified
#ifdef ASM_HAVE_SYNTAX_UNIFIED
.syntax unified
#endif
.endm
.macro pixman_end_asm_function
#ifdef ASM_HAVE_FUNC_DIRECTIVE
.endfunc
#endif
.endm
#endif /* PIXMAN_ARM_ASM_H */

View File

@ -68,6 +68,8 @@
#include "pixman-arm-asm.h"
#include "pixman-arm-neon-asm.h"
pixman_syntax_unified
/*
* Bilinear macros from pixman-arm-neon-asm.S
*/
@ -82,28 +84,28 @@
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #2
vld1.32 {reg1}, [TMP1], STRIDE
vld1.32 {reg2}, [TMP1]
vld1.32 {\reg1}, [TMP1], STRIDE
vld1.32 {\reg2}, [TMP1]
.endm
.macro bilinear_load_0565 reg1, reg2, tmp
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #1
vld1.32 {reg2[0]}, [TMP1], STRIDE
vld1.32 {reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp
vld1.32 {\reg2[0]}, [TMP1], STRIDE
vld1.32 {\reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp
.endm
.macro bilinear_load_and_vertical_interpolate_two_8888 \
acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2
bilinear_load_8888 reg1, reg2, tmp1
vmull.u8 acc1, reg1, d28
vmlal.u8 acc1, reg2, d29
bilinear_load_8888 reg3, reg4, tmp2
vmull.u8 acc2, reg3, d28
vmlal.u8 acc2, reg4, d29
bilinear_load_8888 \reg1, \reg2, \tmp1
vmull.u8 \acc1, \reg1, d28
vmlal.u8 \acc1, \reg2, d29
bilinear_load_8888 \reg3, \reg4, \tmp2
vmull.u8 \acc2, \reg3, d28
vmlal.u8 \acc2, \reg4, d29
.endm
.macro bilinear_load_and_vertical_interpolate_four_8888 \
@ -111,9 +113,9 @@
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \
xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi
\xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, \xacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
\yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi
.endm
.macro bilinear_load_and_vertical_interpolate_two_0565 \
@ -125,19 +127,19 @@
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {acc2lo[0]}, [TMP1], STRIDE
vld1.32 {acc2hi[0]}, [TMP2], STRIDE
vld1.32 {acc2lo[1]}, [TMP1]
vld1.32 {acc2hi[1]}, [TMP2]
convert_0565_to_x888 acc2, reg3, reg2, reg1
vzip.u8 reg1, reg3
vzip.u8 reg2, reg4
vzip.u8 reg3, reg4
vzip.u8 reg1, reg2
vmull.u8 acc1, reg1, d28
vmlal.u8 acc1, reg2, d29
vmull.u8 acc2, reg3, d28
vmlal.u8 acc2, reg4, d29
vld1.32 {\acc2lo[0]}, [TMP1], STRIDE
vld1.32 {\acc2hi[0]}, [TMP2], STRIDE
vld1.32 {\acc2lo[1]}, [TMP1]
vld1.32 {\acc2hi[1]}, [TMP2]
convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1
vzip.u8 \reg1, \reg3
vzip.u8 \reg2, \reg4
vzip.u8 \reg3, \reg4
vzip.u8 \reg1, \reg2
vmull.u8 \acc1, \reg1, d28
vmlal.u8 \acc1, \reg2, d29
vmull.u8 \acc2, \reg3, d28
vmlal.u8 \acc2, \reg4, d29
.endm
.macro bilinear_load_and_vertical_interpolate_four_0565 \
@ -150,46 +152,46 @@
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {xacc2lo[1]}, [TMP1]
vld1.32 {xacc2hi[1]}, [TMP2]
convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1
vld1.32 {\xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {\xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {\xacc2lo[1]}, [TMP1]
vld1.32 {\xacc2hi[1]}, [TMP2]
convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #1
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 xreg1, xreg3
vld1.32 {yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 xreg2, xreg4
vld1.32 {yacc2lo[1]}, [TMP1]
vzip.u8 xreg3, xreg4
vld1.32 {yacc2hi[1]}, [TMP2]
vzip.u8 xreg1, xreg2
convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1
vmull.u8 xacc1, xreg1, d28
vzip.u8 yreg1, yreg3
vmlal.u8 xacc1, xreg2, d29
vzip.u8 yreg2, yreg4
vmull.u8 xacc2, xreg3, d28
vzip.u8 yreg3, yreg4
vmlal.u8 xacc2, xreg4, d29
vzip.u8 yreg1, yreg2
vmull.u8 yacc1, yreg1, d28
vmlal.u8 yacc1, yreg2, d29
vmull.u8 yacc2, yreg3, d28
vmlal.u8 yacc2, yreg4, d29
vld1.32 {\yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 \xreg1, \xreg3
vld1.32 {\yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 \xreg2, \xreg4
vld1.32 {\yacc2lo[1]}, [TMP1]
vzip.u8 \xreg3, \xreg4
vld1.32 {\yacc2hi[1]}, [TMP2]
vzip.u8 \xreg1, \xreg2
convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1
vmull.u8 \xacc1, \xreg1, d28
vzip.u8 \yreg1, \yreg3
vmlal.u8 \xacc1, \xreg2, d29
vzip.u8 \yreg2, \yreg4
vmull.u8 \xacc2, \xreg3, d28
vzip.u8 \yreg3, \yreg4
vmlal.u8 \xacc2, \xreg4, d29
vzip.u8 \yreg1, \yreg2
vmull.u8 \yacc1, \yreg1, d28
vmlal.u8 \yacc1, \yreg2, d29
vmull.u8 \yacc2, \yreg3, d28
vmlal.u8 \yacc2, \yreg4, d29
.endm
.macro bilinear_store_8888 numpix, tmp1, tmp2
.if numpix == 4
.if \numpix == 4
vst1.32 {d0, d1}, [OUT]!
.elseif numpix == 2
.elseif \numpix == 2
vst1.32 {d0}, [OUT]!
.elseif numpix == 1
.elseif \numpix == 1
vst1.32 {d0[0]}, [OUT, :32]!
.else
.error bilinear_store_8888 numpix is unsupported
@ -201,12 +203,12 @@
vuzp.u8 d2, d3
vuzp.u8 d1, d3
vuzp.u8 d0, d2
convert_8888_to_0565 d2, d1, d0, q1, tmp1, tmp2
.if numpix == 4
convert_8888_to_0565 d2, d1, d0, q1, \tmp1, \tmp2
.if \numpix == 4
vst1.16 {d2}, [OUT]!
.elseif numpix == 2
.elseif \numpix == 2
vst1.32 {d2[0]}, [OUT]!
.elseif numpix == 1
.elseif \numpix == 1
vst1.16 {d2[0]}, [OUT]!
.else
.error bilinear_store_0565 numpix is unsupported
@ -222,20 +224,20 @@
.endm
.macro bilinear_load_mask_8 numpix, mask
.if numpix == 4
vld1.32 {mask[0]}, [MASK]!
.elseif numpix == 2
vld1.16 {mask[0]}, [MASK]!
.elseif numpix == 1
vld1.8 {mask[0]}, [MASK]!
.if \numpix == 4
vld1.32 {\mask[0]}, [MASK]!
.elseif \numpix == 2
vld1.16 {\mask[0]}, [MASK]!
.elseif \numpix == 1
vld1.8 {\mask[0]}, [MASK]!
.else
.error bilinear_load_mask_8 numpix is unsupported
.error bilinear_load_mask_8 \numpix is unsupported
.endif
pld [MASK, #prefetch_offset]
.endm
.macro bilinear_load_mask mask_fmt, numpix, mask
bilinear_load_mask_&mask_fmt numpix, mask
bilinear_load_mask_\()\mask_fmt \numpix, \mask
.endm
@ -250,28 +252,28 @@
.endm
.macro bilinear_load_dst_8888 numpix, dst0, dst1, dst01
.if numpix == 4
vld1.32 {dst0, dst1}, [OUT]
.elseif numpix == 2
vld1.32 {dst0}, [OUT]
.elseif numpix == 1
vld1.32 {dst0[0]}, [OUT]
.if \numpix == 4
vld1.32 {\dst0, \dst1}, [OUT]
.elseif \numpix == 2
vld1.32 {\dst0}, [OUT]
.elseif \numpix == 1
vld1.32 {\dst0[0]}, [OUT]
.else
.error bilinear_load_dst_8888 numpix is unsupported
.error bilinear_load_dst_8888 \numpix is unsupported
.endif
pld [OUT, #(prefetch_offset * 4)]
.endm
.macro bilinear_load_dst_8888_over numpix, dst0, dst1, dst01
bilinear_load_dst_8888 numpix, dst0, dst1, dst01
bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_load_dst_8888_add numpix, dst0, dst1, dst01
bilinear_load_dst_8888 numpix, dst0, dst1, dst01
bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_load_dst dst_fmt, op, numpix, dst0, dst1, dst01
bilinear_load_dst_&dst_fmt&_&op numpix, dst0, dst1, dst01
bilinear_load_dst_\()\dst_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01
.endm
/*
@ -290,19 +292,19 @@
.endm
.macro bilinear_duplicate_mask_8 numpix, mask
.if numpix == 4
vdup.32 mask, mask[0]
.elseif numpix == 2
vdup.16 mask, mask[0]
.elseif numpix == 1
vdup.8 mask, mask[0]
.if \numpix == 4
vdup.32 \mask, \mask[0]
.elseif \numpix == 2
vdup.16 \mask, \mask[0]
.elseif \numpix == 1
vdup.8 \mask, \mask[0]
.else
.error bilinear_duplicate_mask_8 is unsupported
.endif
.endm
.macro bilinear_duplicate_mask mask_fmt, numpix, mask
bilinear_duplicate_mask_&mask_fmt numpix, mask
bilinear_duplicate_mask_\()\mask_fmt \numpix, \mask
.endm
/*
@ -310,10 +312,10 @@
* Interleave should be done when maks is enabled or operator is 'over'.
*/
.macro bilinear_interleave src0, src1, dst0, dst1
vuzp.8 src0, src1
vuzp.8 dst0, dst1
vuzp.8 src0, src1
vuzp.8 dst0, dst1
vuzp.8 \src0, \src1
vuzp.8 \dst0, \dst1
vuzp.8 \src0, \src1
vuzp.8 \dst0, \dst1
.endm
.macro bilinear_interleave_src_dst_x_src \
@ -323,7 +325,7 @@
.macro bilinear_interleave_src_dst_x_over \
numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave src0, src1, dst0, dst1
bilinear_interleave \src0, \src1, \dst0, \dst1
.endm
.macro bilinear_interleave_src_dst_x_add \
@ -333,26 +335,26 @@
.macro bilinear_interleave_src_dst_8_src \
numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave src0, src1, dst0, dst1
bilinear_interleave \src0, \src1, \dst0, \dst1
.endm
.macro bilinear_interleave_src_dst_8_over \
numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave src0, src1, dst0, dst1
bilinear_interleave \src0, \src1, \dst0, \dst1
.endm
.macro bilinear_interleave_src_dst_8_add \
numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave src0, src1, dst0, dst1
bilinear_interleave \src0, \src1, \dst0, \dst1
.endm
.macro bilinear_interleave_src_dst \
mask_fmt, op, numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave_src_dst_&mask_fmt&_&op \
numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave_src_dst_\()\mask_fmt\()_\()\op \
\numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01
.endm
@ -370,23 +372,23 @@
numpix, src0, src1, src01, mask, \
tmp01, tmp23, tmp45, tmp67
vmull.u8 tmp01, src0, mask
vmull.u8 tmp23, src1, mask
vmull.u8 \tmp01, \src0, \mask
vmull.u8 \tmp23, \src1, \mask
/* bubbles */
vrshr.u16 tmp45, tmp01, #8
vrshr.u16 tmp67, tmp23, #8
vrshr.u16 \tmp45, \tmp01, #8
vrshr.u16 \tmp67, \tmp23, #8
/* bubbles */
vraddhn.u16 src0, tmp45, tmp01
vraddhn.u16 src1, tmp67, tmp23
vraddhn.u16 \src0, \tmp45, \tmp01
vraddhn.u16 \src1, \tmp67, \tmp23
.endm
.macro bilinear_apply_mask_to_src \
mask_fmt, numpix, src0, src1, src01, mask, \
tmp01, tmp23, tmp45, tmp67
bilinear_apply_mask_to_src_&mask_fmt \
numpix, src0, src1, src01, mask, \
tmp01, tmp23, tmp45, tmp67
bilinear_apply_mask_to_src_\()\mask_fmt \
\numpix, \src0, \src1, \src01, \mask, \
\tmp01, \tmp23, \tmp45, \tmp67
.endm
@ -403,79 +405,79 @@
numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8
vdup.32 tmp8, src1[1]
vdup.32 \tmp8, \src1[1]
/* bubbles */
vmvn.8 tmp8, tmp8
vmvn.8 \tmp8, \tmp8
/* bubbles */
vmull.u8 tmp01, dst0, tmp8
vmull.u8 \tmp01, \dst0, \tmp8
/* bubbles */
vmull.u8 tmp23, dst1, tmp8
vmull.u8 \tmp23, \dst1, \tmp8
/* bubbles */
vrshr.u16 tmp45, tmp01, #8
vrshr.u16 tmp67, tmp23, #8
vrshr.u16 \tmp45, \tmp01, #8
vrshr.u16 \tmp67, \tmp23, #8
/* bubbles */
vraddhn.u16 dst0, tmp45, tmp01
vraddhn.u16 dst1, tmp67, tmp23
vraddhn.u16 \dst0, \tmp45, \tmp01
vraddhn.u16 \dst1, \tmp67, \tmp23
/* bubbles */
vqadd.u8 src01, dst01, src01
vqadd.u8 \src01, \dst01, \src01
.endm
.macro bilinear_combine_add \
numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8
vqadd.u8 src01, dst01, src01
vqadd.u8 \src01, \dst01, \src01
.endm
.macro bilinear_combine \
op, numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8
bilinear_combine_&op \
numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8
bilinear_combine_\()\op \
\numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01, \
\tmp01, \tmp23, \tmp45, \tmp67, \tmp8
.endm
/*
* Macros for final deinterleaving of destination pixels if needed.
*/
.macro bilinear_deinterleave numpix, dst0, dst1, dst01
vuzp.8 dst0, dst1
vuzp.8 \dst0, \dst1
/* bubbles */
vuzp.8 dst0, dst1
vuzp.8 \dst0, \dst1
.endm
.macro bilinear_deinterleave_dst_x_src numpix, dst0, dst1, dst01
.endm
.macro bilinear_deinterleave_dst_x_over numpix, dst0, dst1, dst01
bilinear_deinterleave numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_deinterleave_dst_x_add numpix, dst0, dst1, dst01
.endm
.macro bilinear_deinterleave_dst_8_src numpix, dst0, dst1, dst01
bilinear_deinterleave numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_deinterleave_dst_8_over numpix, dst0, dst1, dst01
bilinear_deinterleave numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_deinterleave_dst_8_add numpix, dst0, dst1, dst01
bilinear_deinterleave numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_deinterleave_dst mask_fmt, op, numpix, dst0, dst1, dst01
bilinear_deinterleave_dst_&mask_fmt&_&op numpix, dst0, dst1, dst01
bilinear_deinterleave_dst_\()\mask_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01
.endm
.macro bilinear_interpolate_last_pixel src_fmt, mask_fmt, dst_fmt, op
bilinear_load_&src_fmt d0, d1, d2
bilinear_load_mask mask_fmt, 1, d4
bilinear_load_dst dst_fmt, op, 1, d18, d19, q9
bilinear_load_\()\src_fmt d0, d1, d2
bilinear_load_mask \mask_fmt, 1, d4
bilinear_load_dst \dst_fmt, \op, 1, d18, d19, q9
vmull.u8 q1, d0, d28
vmlal.u8 q1, d1, d29
/* 5 cycles bubble */
@ -483,28 +485,28 @@
vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30
/* 5 cycles bubble */
bilinear_duplicate_mask mask_fmt, 1, d4
bilinear_duplicate_mask \mask_fmt, 1, d4
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
/* 3 cycles bubble */
vmovn.u16 d0, q0
/* 1 cycle bubble */
bilinear_interleave_src_dst \
mask_fmt, op, 1, d0, d1, q0, d18, d19, q9
\mask_fmt, \op, 1, d0, d1, q0, d18, d19, q9
bilinear_apply_mask_to_src \
mask_fmt, 1, d0, d1, q0, d4, \
\mask_fmt, 1, d0, d1, q0, d4, \
q3, q8, q10, q11
bilinear_combine \
op, 1, d0, d1, q0, d18, d19, q9, \
\op, 1, d0, d1, q0, d18, d19, q9, \
q3, q8, q10, q11, d5
bilinear_deinterleave_dst mask_fmt, op, 1, d0, d1, q0
bilinear_store_&dst_fmt 1, q2, q3
bilinear_deinterleave_dst \mask_fmt, \op, 1, d0, d1, q0
bilinear_store_\()\dst_fmt 1, q2, q3
.endm
.macro bilinear_interpolate_two_pixels src_fmt, mask_fmt, dst_fmt, op
bilinear_load_and_vertical_interpolate_two_&src_fmt \
bilinear_load_and_vertical_interpolate_two_\()\src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23
bilinear_load_mask mask_fmt, 2, d4
bilinear_load_dst dst_fmt, op, 2, d18, d19, q9
bilinear_load_mask \mask_fmt, 2, d4
bilinear_load_dst \dst_fmt, \op, 2, d18, d19, q9
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30
@ -513,24 +515,24 @@
vmlal.u16 q10, d23, d31
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask mask_fmt, 2, d4
bilinear_duplicate_mask \mask_fmt, 2, d4
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vmovn.u16 d0, q0
bilinear_interleave_src_dst \
mask_fmt, op, 2, d0, d1, q0, d18, d19, q9
\mask_fmt, \op, 2, d0, d1, q0, d18, d19, q9
bilinear_apply_mask_to_src \
mask_fmt, 2, d0, d1, q0, d4, \
\mask_fmt, 2, d0, d1, q0, d4, \
q3, q8, q10, q11
bilinear_combine \
op, 2, d0, d1, q0, d18, d19, q9, \
\op, 2, d0, d1, q0, d18, d19, q9, \
q3, q8, q10, q11, d5
bilinear_deinterleave_dst mask_fmt, op, 2, d0, d1, q0
bilinear_store_&dst_fmt 2, q2, q3
bilinear_deinterleave_dst \mask_fmt, \op, 2, d0, d1, q0
bilinear_store_\()\dst_fmt 2, q2, q3
.endm
.macro bilinear_interpolate_four_pixels src_fmt, mask_fmt, dst_fmt, op
bilinear_load_and_vertical_interpolate_four_&src_fmt \
bilinear_load_and_vertical_interpolate_four_\()\src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 \
q3, q9, d4, d5, d16, d17, d18, d19
pld [TMP1, PF_OFFS]
@ -546,8 +548,8 @@
vmlsl.u16 q2, d6, d30
vmlal.u16 q2, d7, d30
vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS
bilinear_load_mask mask_fmt, 4, d22
bilinear_load_dst dst_fmt, op, 4, d2, d3, q1
bilinear_load_mask \mask_fmt, 4, d22
bilinear_load_dst \dst_fmt, \op, 4, d2, d3, q1
pld [TMP1, PF_OFFS]
vmlsl.u16 q8, d18, d31
vmlal.u16 q8, d19, d31
@ -556,21 +558,21 @@
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask mask_fmt, 4, d22
bilinear_duplicate_mask \mask_fmt, 4, d22
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d0, q0
vmovn.u16 d1, q2
vadd.u16 q12, q12, q13
bilinear_interleave_src_dst \
mask_fmt, op, 4, d0, d1, q0, d2, d3, q1
\mask_fmt, \op, 4, d0, d1, q0, d2, d3, q1
bilinear_apply_mask_to_src \
mask_fmt, 4, d0, d1, q0, d22, \
\mask_fmt, 4, d0, d1, q0, d22, \
q3, q8, q9, q10
bilinear_combine \
op, 4, d0, d1, q0, d2, d3, q1, \
\op, 4, d0, d1, q0, d2, d3, q1, \
q3, q8, q9, q10, d23
bilinear_deinterleave_dst mask_fmt, op, 4, d0, d1, q0
bilinear_store_&dst_fmt 4, q2, q3
bilinear_deinterleave_dst \mask_fmt, \op, 4, d0, d1, q0
bilinear_store_\()\dst_fmt 4, q2, q3
.endm
.set BILINEAR_FLAG_USE_MASK, 1
@ -610,14 +612,14 @@
prefetch_distance, \
flags
pixman_asm_function fname
.if pixblock_size == 8
.elseif pixblock_size == 4
pixman_asm_function \fname
.if \pixblock_size == 8
.elseif \pixblock_size == 4
.else
.error unsupported pixblock size
.endif
.if ((flags) & BILINEAR_FLAG_USE_MASK) == 0
.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0
OUT .req r0
TOP .req r1
BOTTOM .req r2
@ -635,7 +637,7 @@ pixman_asm_function fname
mov ip, sp
push {r4, r5, r6, r7, r8, r9}
mov PF_OFFS, #prefetch_distance
mov PF_OFFS, #\prefetch_distance
ldmia ip, {WB, X, UX, WIDTH}
.else
OUT .req r0
@ -654,17 +656,17 @@ pixman_asm_function fname
TMP4 .req r10
STRIDE .req r3
.set prefetch_offset, prefetch_distance
.set prefetch_offset, \prefetch_distance
mov ip, sp
push {r4, r5, r6, r7, r8, r9, r10, ip}
mov PF_OFFS, #prefetch_distance
mov PF_OFFS, #\prefetch_distance
ldmia ip, {WT, WB, X, UX, WIDTH}
.endif
mul PF_OFFS, PF_OFFS, UX
.if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpush {d8-d15}
.endif
@ -683,11 +685,11 @@ pixman_asm_function fname
/* ensure good destination alignment */
cmp WIDTH, #1
blt 0f
tst OUT, #(1 << dst_bpp_shift)
tst OUT, #(1 << \dst_bpp_shift)
beq 0f
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
bilinear_process_last_pixel
\bilinear_process_last_pixel
sub WIDTH, WIDTH, #1
0:
vadd.u16 q13, q13, q13
@ -696,53 +698,53 @@ pixman_asm_function fname
cmp WIDTH, #2
blt 0f
tst OUT, #(1 << (dst_bpp_shift + 1))
tst OUT, #(1 << (\dst_bpp_shift + 1))
beq 0f
bilinear_process_two_pixels
\bilinear_process_two_pixels
sub WIDTH, WIDTH, #2
0:
.if pixblock_size == 8
.if \pixblock_size == 8
cmp WIDTH, #4
blt 0f
tst OUT, #(1 << (dst_bpp_shift + 2))
tst OUT, #(1 << (\dst_bpp_shift + 2))
beq 0f
bilinear_process_four_pixels
\bilinear_process_four_pixels
sub WIDTH, WIDTH, #4
0:
.endif
subs WIDTH, WIDTH, #pixblock_size
subs WIDTH, WIDTH, #\pixblock_size
blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
bilinear_process_pixblock_head
subs WIDTH, WIDTH, #pixblock_size
mov PF_OFFS, PF_OFFS, asr #(16 - \src_bpp_shift)
\bilinear_process_pixblock_head
subs WIDTH, WIDTH, #\pixblock_size
blt 5f
0:
bilinear_process_pixblock_tail_head
subs WIDTH, WIDTH, #pixblock_size
\bilinear_process_pixblock_tail_head
subs WIDTH, WIDTH, #\pixblock_size
bge 0b
5:
bilinear_process_pixblock_tail
\bilinear_process_pixblock_tail
1:
.if pixblock_size == 8
.if \pixblock_size == 8
tst WIDTH, #4
beq 2f
bilinear_process_four_pixels
\bilinear_process_four_pixels
2:
.endif
/* handle the remaining trailing pixels */
tst WIDTH, #2
beq 2f
bilinear_process_two_pixels
\bilinear_process_two_pixels
2:
tst WIDTH, #1
beq 3f
bilinear_process_last_pixel
\bilinear_process_last_pixel
3:
.if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpop {d8-d15}
.endif
.if ((flags) & BILINEAR_FLAG_USE_MASK) == 0
.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0
pop {r4, r5, r6, r7, r8, r9}
.else
pop {r4, r5, r6, r7, r8, r9, r10, ip}
@ -762,11 +764,11 @@ pixman_asm_function fname
.unreq TMP3
.unreq TMP4
.unreq STRIDE
.if ((flags) & BILINEAR_FLAG_USE_MASK) != 0
.if ((\flags) & BILINEAR_FLAG_USE_MASK) != 0
.unreq MASK
.endif
.endfunc
pixman_end_asm_function
.endm

View File

@ -53,6 +53,8 @@
#include "pixman-arm-asm.h"
#include "pixman-arm-neon-asm.h"
pixman_syntax_unified
/* Global configuration options and preferences */
/*
@ -260,13 +262,13 @@
vshrn.u16 d7, q2, #3
vsli.u16 q2, q2, #5
vshll.u8 q14, d16, #8
PF add PF_X, PF_X, #8
PF add, PF_X, PF_X, #8
vshll.u8 q8, d19, #8
PF tst PF_CTL, #0xF
PF tst, PF_CTL, #0xF
vsri.u8 d6, d6, #5
PF addne PF_X, PF_X, #8
PF addne, PF_X, PF_X, #8
vmvn.8 d3, d3
PF subne PF_CTL, PF_CTL, #1
PF subne, PF_CTL, PF_CTL, #1
vsri.u8 d7, d7, #6
vshrn.u16 d30, q2, #2
vmull.u8 q10, d3, d6
@ -275,18 +277,18 @@
vmull.u8 q12, d3, d30
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vsri.u16 q14, q8, #5
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vshll.u8 q9, d18, #8
vrshr.u16 q13, q10, #8
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vrshr.u16 q3, q11, #8
vrshr.u16 q15, q12, #8
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vsri.u16 q14, q9, #11
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vraddhn.u16 d20, q10, q13
vraddhn.u16 d23, q11, q3
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vraddhn.u16 d22, q12, q15
vst1.16 {d28, d29}, [DST_W, :128]!
.endm
@ -434,20 +436,20 @@ generate_composite_function \
.macro pixman_composite_src_8888_0565_process_pixblock_tail_head
vsri.u16 q14, q8, #5
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
fetch_src_pixblock
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vsri.u16 q14, q9, #11
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
vshll.u8 q8, d1, #8
vst1.16 {d28, d29}, [DST_W, :128]!
PF subge PF_X, PF_X, ORIG_W
PF subges PF_CTL, PF_CTL, #0x10
PF subge, PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10
vshll.u8 q14, d2, #8
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vshll.u8 q9, d0, #8
.endm
@ -509,20 +511,20 @@ generate_composite_function \
.macro pixman_composite_add_8_8_process_pixblock_tail_head
fetch_src_pixblock
PF add PF_X, PF_X, #32
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #32
PF tst, PF_CTL, #0xF
vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
PF addne PF_X, PF_X, #32
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #32
PF subne, PF_CTL, PF_CTL, #1
vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
PF subge PF_X, PF_X, ORIG_W
PF subges PF_CTL, PF_CTL, #0x10
PF subge, PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10
vqadd.u8 q14, q0, q2
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q15, q1, q3
.endm
@ -541,20 +543,20 @@ generate_composite_function \
.macro pixman_composite_add_8888_8888_process_pixblock_tail_head
fetch_src_pixblock
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
vld1.32 {d4, d5, d6, d7}, [DST_R, :128]!
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vst1.32 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
PF subge PF_X, PF_X, ORIG_W
PF subges PF_CTL, PF_CTL, #0x10
PF subge, PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10
vqadd.u8 q14, q0, q2
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q15, q1, q3
.endm
@ -604,16 +606,16 @@ generate_composite_function_single_scanline \
.macro pixman_composite_out_reverse_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vrshr.u16 q14, q8, #8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11
fetch_src_pixblock
@ -621,13 +623,13 @@ generate_composite_function_single_scanline \
vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vmull.u8 q10, d22, d6
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7
.endm
@ -656,16 +658,16 @@ generate_composite_function_single_scanline \
.macro pixman_composite_over_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vrshr.u16 q14, q8, #8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11
vqadd.u8 q14, q0, q14
@ -675,13 +677,13 @@ generate_composite_function_single_scanline \
vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vmull.u8 q10, d22, d6
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7
.endm
@ -742,20 +744,20 @@ generate_composite_function_single_scanline \
vraddhn.u16 d31, q3, q11
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vqadd.u8 q14, q0, q14
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0x0F
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0x0F
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vqadd.u8 q15, q1, q15
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vmull.u8 q8, d24, d4
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vmull.u8 q9, d24, d5
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q10, d24, d6
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q11, d24, d7
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
.endm
@ -784,16 +786,16 @@ generate_composite_function \
.macro pixman_composite_over_reverse_n_8888_process_pixblock_tail_head
vrshr.u16 q14, q8, #8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11
vqadd.u8 q14, q0, q14
@ -802,12 +804,12 @@ generate_composite_function \
vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5
vmull.u8 q10, d22, d6
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7
.endm
@ -1245,23 +1247,23 @@ generate_composite_function \
.macro pixman_composite_src_n_8_8888_process_pixblock_tail_head
fetch_mask_pixblock
PF add PF_X, PF_X, #8
PF add, PF_X, PF_X, #8
vrshrn.u16 d28, q8, #8
PF tst PF_CTL, #0x0F
PF tst, PF_CTL, #0x0F
vrshrn.u16 d29, q9, #8
PF addne PF_X, PF_X, #8
PF addne, PF_X, PF_X, #8
vrshrn.u16 d30, q10, #8
PF subne PF_CTL, PF_CTL, #1
PF subne, PF_CTL, PF_CTL, #1
vrshrn.u16 d31, q11, #8
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vmull.u8 q8, d24, d0
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q9, d24, d1
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q10, d24, d2
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q11, d24, d3
PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
vrsra.u16 q8, q8, #8
vrsra.u16 q9, q9, #8
@ -1314,23 +1316,23 @@ generate_composite_function \
.macro pixman_composite_src_n_8_8_process_pixblock_tail_head
fetch_mask_pixblock
PF add PF_X, PF_X, #8
PF add, PF_X, PF_X, #8
vrshrn.u16 d28, q0, #8
PF tst PF_CTL, #0x0F
PF tst, PF_CTL, #0x0F
vrshrn.u16 d29, q1, #8
PF addne PF_X, PF_X, #8
PF addne, PF_X, PF_X, #8
vrshrn.u16 d30, q2, #8
PF subne PF_CTL, PF_CTL, #1
PF subne, PF_CTL, PF_CTL, #1
vrshrn.u16 d31, q3, #8
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vmull.u8 q0, d24, d16
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q1, d25, d16
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q2, d26, d16
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q3, d27, d16
PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
vrsra.u16 q0, q0, #8
vrsra.u16 q1, q1, #8
@ -1408,27 +1410,27 @@ generate_composite_function \
vrshr.u16 q15, q9, #8
fetch_mask_pixblock
vrshr.u16 q6, q10, #8
PF add PF_X, PF_X, #8
PF add, PF_X, PF_X, #8
vrshr.u16 q7, q11, #8
PF tst PF_CTL, #0x0F
PF tst, PF_CTL, #0x0F
vraddhn.u16 d28, q14, q8
PF addne PF_X, PF_X, #8
PF addne, PF_X, PF_X, #8
vraddhn.u16 d29, q15, q9
PF subne PF_CTL, PF_CTL, #1
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d30, q6, q10
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
vraddhn.u16 d31, q7, q11
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vmull.u8 q6, d24, d8
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q7, d24, d9
PF subge PF_X, PF_X, ORIG_W
PF subge, PF_X, PF_X, ORIG_W
vmull.u8 q8, d24, d10
PF subges PF_CTL, PF_CTL, #0x10
PF subsge, PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d24, d11
PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q14, q0, q14
PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vqadd.u8 q15, q1, q15
vrshr.u16 q10, q6, #8
vrshr.u16 q11, q7, #8
@ -2425,21 +2427,21 @@ generate_composite_function \
vrshr.u16 q13, q10, #8
fetch_src_pixblock
vraddhn.u16 d30, q11, q8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d29, q12, q9
vraddhn.u16 d28, q13, q10
vmull.u8 q8, d3, d0
vmull.u8 q9, d3, d1
vmull.u8 q10, d3, d2
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF subge PF_X, PF_X, ORIG_W
PF subges PF_CTL, PF_CTL, #0x10
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF subge, PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
.endm
generate_composite_function \
@ -2482,21 +2484,21 @@ generate_composite_function \
vrshr.u16 q13, q10, #8
fetch_src_pixblock
vraddhn.u16 d28, q11, q8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
PF add, PF_X, PF_X, #8
PF tst, PF_CTL, #0xF
PF addne, PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1
vraddhn.u16 d29, q12, q9
vraddhn.u16 d30, q13, q10
vmull.u8 q8, d3, d0
vmull.u8 q9, d3, d1
vmull.u8 q10, d3, d2
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp PF_X, ORIG_W
PF cmp, PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF subge PF_X, PF_X, ORIG_W
PF subges PF_CTL, PF_CTL, #0x10
PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF subge, PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
.endm
generate_composite_function \
@ -2841,28 +2843,28 @@ generate_composite_function_nearest_scanline \
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #2
vld1.32 {reg1}, [TMP1], STRIDE
vld1.32 {reg2}, [TMP1]
vld1.32 {\reg1}, [TMP1], STRIDE
vld1.32 {\reg2}, [TMP1]
.endm
.macro bilinear_load_0565 reg1, reg2, tmp
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #1
vld1.32 {reg2[0]}, [TMP1], STRIDE
vld1.32 {reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp
vld1.32 {\reg2[0]}, [TMP1], STRIDE
vld1.32 {\reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp
.endm
.macro bilinear_load_and_vertical_interpolate_two_8888 \
acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2
bilinear_load_8888 reg1, reg2, tmp1
vmull.u8 acc1, reg1, d28
vmlal.u8 acc1, reg2, d29
bilinear_load_8888 reg3, reg4, tmp2
vmull.u8 acc2, reg3, d28
vmlal.u8 acc2, reg4, d29
bilinear_load_8888 \reg1, \reg2, \tmp1
vmull.u8 \acc1, \reg1, d28
vmlal.u8 \acc1, \reg2, d29
bilinear_load_8888 \reg3, \reg4, \tmp2
vmull.u8 \acc2, \reg3, d28
vmlal.u8 \acc2, \reg4, d29
.endm
.macro bilinear_load_and_vertical_interpolate_four_8888 \
@ -2870,9 +2872,9 @@ generate_composite_function_nearest_scanline \
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \
xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi
\xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, \xacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
\yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi
.endm
.macro bilinear_load_and_vertical_interpolate_two_0565 \
@ -2884,19 +2886,19 @@ generate_composite_function_nearest_scanline \
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {acc2lo[0]}, [TMP1], STRIDE
vld1.32 {acc2hi[0]}, [TMP2], STRIDE
vld1.32 {acc2lo[1]}, [TMP1]
vld1.32 {acc2hi[1]}, [TMP2]
convert_0565_to_x888 acc2, reg3, reg2, reg1
vzip.u8 reg1, reg3
vzip.u8 reg2, reg4
vzip.u8 reg3, reg4
vzip.u8 reg1, reg2
vmull.u8 acc1, reg1, d28
vmlal.u8 acc1, reg2, d29
vmull.u8 acc2, reg3, d28
vmlal.u8 acc2, reg4, d29
vld1.32 {\acc2lo[0]}, [TMP1], STRIDE
vld1.32 {\acc2hi[0]}, [TMP2], STRIDE
vld1.32 {\acc2lo[1]}, [TMP1]
vld1.32 {\acc2hi[1]}, [TMP2]
convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1
vzip.u8 \reg1, \reg3
vzip.u8 \reg2, \reg4
vzip.u8 \reg3, \reg4
vzip.u8 \reg1, \reg2
vmull.u8 \acc1, \reg1, d28
vmlal.u8 \acc1, \reg2, d29
vmull.u8 \acc2, \reg3, d28
vmlal.u8 \acc2, \reg4, d29
.endm
.macro bilinear_load_and_vertical_interpolate_four_0565 \
@ -2909,49 +2911,49 @@ generate_composite_function_nearest_scanline \
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {xacc2lo[1]}, [TMP1]
vld1.32 {xacc2hi[1]}, [TMP2]
convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1
vld1.32 {\xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {\xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {\xacc2lo[1]}, [TMP1]
vld1.32 {\xacc2hi[1]}, [TMP2]
convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1
mov TMP1, X, asr #16
add X, X, UX
add TMP1, TOP, TMP1, asl #1
mov TMP2, X, asr #16
add X, X, UX
add TMP2, TOP, TMP2, asl #1
vld1.32 {yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 xreg1, xreg3
vld1.32 {yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 xreg2, xreg4
vld1.32 {yacc2lo[1]}, [TMP1]
vzip.u8 xreg3, xreg4
vld1.32 {yacc2hi[1]}, [TMP2]
vzip.u8 xreg1, xreg2
convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1
vmull.u8 xacc1, xreg1, d28
vzip.u8 yreg1, yreg3
vmlal.u8 xacc1, xreg2, d29
vzip.u8 yreg2, yreg4
vmull.u8 xacc2, xreg3, d28
vzip.u8 yreg3, yreg4
vmlal.u8 xacc2, xreg4, d29
vzip.u8 yreg1, yreg2
vmull.u8 yacc1, yreg1, d28
vmlal.u8 yacc1, yreg2, d29
vmull.u8 yacc2, yreg3, d28
vmlal.u8 yacc2, yreg4, d29
vld1.32 {\yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 \xreg1, \xreg3
vld1.32 {\yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 \xreg2, \xreg4
vld1.32 {\yacc2lo[1]}, [TMP1]
vzip.u8 \xreg3, \xreg4
vld1.32 {\yacc2hi[1]}, [TMP2]
vzip.u8 \xreg1, \xreg2
convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1
vmull.u8 \xacc1, \xreg1, d28
vzip.u8 \yreg1, \yreg3
vmlal.u8 \xacc1, \xreg2, d29
vzip.u8 \yreg2, \yreg4
vmull.u8 \xacc2, \xreg3, d28
vzip.u8 \yreg3, \yreg4
vmlal.u8 \xacc2, \xreg4, d29
vzip.u8 \yreg1, \yreg2
vmull.u8 \yacc1, \yreg1, d28
vmlal.u8 \yacc1, \yreg2, d29
vmull.u8 \yacc2, \yreg3, d28
vmlal.u8 \yacc2, \yreg4, d29
.endm
.macro bilinear_store_8888 numpix, tmp1, tmp2
.if numpix == 4
.if \numpix == 4
vst1.32 {d0, d1}, [OUT, :128]!
.elseif numpix == 2
.elseif \numpix == 2
vst1.32 {d0}, [OUT, :64]!
.elseif numpix == 1
.elseif \numpix == 1
vst1.32 {d0[0]}, [OUT, :32]!
.else
.error bilinear_store_8888 numpix is unsupported
.error bilinear_store_8888 \numpix is unsupported
.endif
.endm
@ -2960,20 +2962,20 @@ generate_composite_function_nearest_scanline \
vuzp.u8 d2, d3
vuzp.u8 d1, d3
vuzp.u8 d0, d2
convert_8888_to_0565 d2, d1, d0, q1, tmp1, tmp2
.if numpix == 4
convert_8888_to_0565 d2, d1, d0, q1, \tmp1, \tmp2
.if \numpix == 4
vst1.16 {d2}, [OUT, :64]!
.elseif numpix == 2
.elseif \numpix == 2
vst1.32 {d2[0]}, [OUT, :32]!
.elseif numpix == 1
.elseif \numpix == 1
vst1.16 {d2[0]}, [OUT, :16]!
.else
.error bilinear_store_0565 numpix is unsupported
.error bilinear_store_0565 \numpix is unsupported
.endif
.endm
.macro bilinear_interpolate_last_pixel src_fmt, dst_fmt
bilinear_load_&src_fmt d0, d1, d2
bilinear_load_\()\src_fmt d0, d1, d2
vmull.u8 q1, d0, d28
vmlal.u8 q1, d1, d29
/* 5 cycles bubble */
@ -2985,11 +2987,11 @@ generate_composite_function_nearest_scanline \
/* 3 cycles bubble */
vmovn.u16 d0, q0
/* 1 cycle bubble */
bilinear_store_&dst_fmt 1, q2, q3
bilinear_store_\()\dst_fmt 1, q2, q3
.endm
.macro bilinear_interpolate_two_pixels src_fmt, dst_fmt
bilinear_load_and_vertical_interpolate_two_&src_fmt \
bilinear_load_and_vertical_interpolate_two_\()\src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30
@ -3002,11 +3004,11 @@ generate_composite_function_nearest_scanline \
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
vmovn.u16 d0, q0
bilinear_store_&dst_fmt 2, q2, q3
bilinear_store_\()\dst_fmt 2, q2, q3
.endm
.macro bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_load_and_vertical_interpolate_four_&src_fmt \
bilinear_load_and_vertical_interpolate_four_\()\src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 \
q3, q9, d4, d5, d16, d17, d18, d19
pld [TMP1, PF_OFFS]
@ -3034,54 +3036,54 @@ generate_composite_function_nearest_scanline \
vmovn.u16 d0, q0
vmovn.u16 d1, q2
vadd.u16 q12, q12, q13
bilinear_store_&dst_fmt 4, q2, q3
bilinear_store_\()\dst_fmt 4, q2, q3
.endm
.macro bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_head
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_head
.else
bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt
.endif
.endm
.macro bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail
.endif
.endm
.macro bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail_head
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head
.else
bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt
.endif
.endm
.macro bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_head
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_head
.else
bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt
.endif
.endm
.macro bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail
.else
bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt
.endif
.endm
.macro bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail_head
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head
.else
bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt
.endif
.endm
@ -3106,7 +3108,7 @@ generate_composite_function_nearest_scanline \
src_bpp_shift, dst_bpp_shift, \
prefetch_distance, flags
pixman_asm_function fname
pixman_asm_function \fname
OUT .req r0
TOP .req r1
BOTTOM .req r2
@ -3124,11 +3126,11 @@ pixman_asm_function fname
mov ip, sp
push {r4, r5, r6, r7, r8, r9}
mov PF_OFFS, #prefetch_distance
mov PF_OFFS, #\prefetch_distance
ldmia ip, {WB, X, UX, WIDTH}
mul PF_OFFS, PF_OFFS, UX
.if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpush {d8-d15}
.endif
@ -3147,11 +3149,11 @@ pixman_asm_function fname
/* ensure good destination alignment */
cmp WIDTH, #1
blt 0f
tst OUT, #(1 << dst_bpp_shift)
tst OUT, #(1 << \dst_bpp_shift)
beq 0f
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13
bilinear_interpolate_last_pixel src_fmt, dst_fmt
bilinear_interpolate_last_pixel \src_fmt, \dst_fmt
sub WIDTH, WIDTH, #1
0:
vadd.u16 q13, q13, q13
@ -3160,64 +3162,64 @@ pixman_asm_function fname
cmp WIDTH, #2
blt 0f
tst OUT, #(1 << (dst_bpp_shift + 1))
tst OUT, #(1 << (\dst_bpp_shift + 1))
beq 0f
bilinear_interpolate_two_pixels src_fmt, dst_fmt
bilinear_interpolate_two_pixels \src_fmt, \dst_fmt
sub WIDTH, WIDTH, #2
0:
.if ((flags) & BILINEAR_FLAG_UNROLL_8) != 0
.if ((\flags) & BILINEAR_FLAG_UNROLL_8) != 0
/*********** 8 pixels per iteration *****************/
cmp WIDTH, #4
blt 0f
tst OUT, #(1 << (dst_bpp_shift + 2))
tst OUT, #(1 << (\dst_bpp_shift + 2))
beq 0f
bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt
sub WIDTH, WIDTH, #4
0:
subs WIDTH, WIDTH, #8
blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt
bilinear_interpolate_eight_pixels_head \src_fmt, \dst_fmt
subs WIDTH, WIDTH, #8
blt 5f
0:
bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_eight_pixels_tail_head \src_fmt, \dst_fmt
subs WIDTH, WIDTH, #8
bge 0b
5:
bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt
bilinear_interpolate_eight_pixels_tail \src_fmt, \dst_fmt
1:
tst WIDTH, #4
beq 2f
bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt
2:
.else
/*********** 4 pixels per iteration *****************/
subs WIDTH, WIDTH, #4
blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt
subs WIDTH, WIDTH, #4
blt 5f
0:
bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt
subs WIDTH, WIDTH, #4
bge 0b
5:
bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt
1:
/****************************************************/
.endif
/* handle the remaining trailing pixels */
tst WIDTH, #2
beq 2f
bilinear_interpolate_two_pixels src_fmt, dst_fmt
bilinear_interpolate_two_pixels \src_fmt, \dst_fmt
2:
tst WIDTH, #1
beq 3f
bilinear_interpolate_last_pixel src_fmt, dst_fmt
bilinear_interpolate_last_pixel \src_fmt, \dst_fmt
3:
.if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpop {d8-d15}
.endif
pop {r4, r5, r6, r7, r8, r9}
@ -3236,7 +3238,7 @@ pixman_asm_function fname
.unreq TMP3
.unreq TMP4
.unreq STRIDE
.endfunc
pixman_end_asm_function
.endm

Some files were not shown because too many files have changed in this diff Show More