Commit Graph

2788 Commits

Author SHA1 Message Date
Christoph Reiter
fd5c0da579 meson: fix TLS support under mingw
GCC on Windows complains that "__declspec(thread)" doesn't work, but still
compiles it, so the meson check doesn't work. The warning printed by gcc:
"warning: 'thread' attribute directive ignored [-Wattributes]"

Pass -Werror=attributes to make the check fail instead.

This fixes the test suite (minus gtk tests) on Windows with mingw.
2019-06-10 16:42:59 +00:00
Christoph Reiter
4851d4e20f meson: allow building a static library
So that passing "-Ddefault_library=both" also creates a static lib.

Note that Libs.private in the .pc file will still be wrong because of
https://github.com/mesonbuild/meson/issues/3934 (it contains things like
-lpixman-mmx)
2019-06-10 16:38:39 +00:00
Christoph Reiter
be0d3e6994 meson: define SIZEOF_LONG and use -Wundef
meson builds defaulted to SIZEOF_LONG=0 in various places
2019-06-10 16:34:06 +00:00
Basile Clement
0ee0ad23de Don't use GNU extension for binary numbers
The dithering code (specifically `dither_factor_bayer_8`) uses a GNU
extension for binary notation, eg 0b001.  This is not supported by MSVC
(at least) and breaks the build on this platform [1].

This patches uses hexadecimal notation instead, fixing the build.

[1]: https://lists.freedesktop.org/archives/pixman/2019-June/004883.html

Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-06-10 09:32:12 -07:00
Basile Clement
cb2ec4268f Ordered dithering with blue noise, v2
On some screens (typically low quality laptop screens), using Bayer
ordered dithering has been observed to cause color changes depending on
*where the gradient is rendered on the screen*, causing visible
flickering when moving an image on the screen.

To alleviate the issue, this patch adds support for ordered dithering
using a 64x64 matrix tuned from blue noise.  In addition to being devoid
of the positional dependency on screen, the blue noise matrix also
generates more pleasing and less discernable patterns.  As such, it is
now the method used for PIXMAN_DITHER_GOOD and PIXMAN_DITHER_BEST
dithering methods.

The 64x64 blue noise matrix has been generated using the provided
`pixman/dither/make-blue-noise.c` script, which uses the
void-and-cluster method.

Changes since v1 (thanks Bill):
 - Use uint16_t for the blue noise matrix for lower memory usage
 - Use bitwise computation for array index
2019-05-25 07:30:19 -07:00
Basile Clement
98b5ec74ca demos: Add a dithering demo
This adds a dither.c which provides a demo of the dithering feature.
This is based on the scale.c demo for scaling and provides a selection
of intermediate formats and dithering operators (currently, only
PIXMAN_DITHER_ORDERED_BAYER_8) to use.  Images are first blitted onto a
surface of the intermediate format with the requested dither setup, then
blitted back onto a a8r8g8b8 surface for display.
2019-05-25 07:30:11 -07:00
Basile Clement
37d2e681b3 test: Check the dithering path in tolerance-test
This adds support for testing dithered destinations in tolerance-test.
When dithering is enabled, the pixel checker allows for an additional
quantization error.
2019-05-25 07:30:02 -07:00
Basile Clement
ddcc41b999 Implement basic dithering for the wide pipeline, v3
This patch implements dithering in pixman.  A "dither" property is added
to BITS images, which is used to:

 - Force rendering to the image to go through the floating point
   pipeline.  Note that this is different from FAST_PATH_NARROW_FORMAT
   as it should not enable the floating point pipeline when reading from
   the image.

 - Enable dithering in dest_write_back_wide.  The dithering uses the
   destination format to determine noise amplitude.

This does not change pixman's behavior when dithering is disabled (the
default).

Additional types and functions are added to the public API:

 - The `pixman_dither_t` enum exposes the available dithering methods.
   Currently a single dithering method based on 8x8 Bayer matrices is
   implemented (PIXMAN_DITHER_ORDERED_BAYER_8).  The PIXMAN_DITHER_FAST,
   PIXMAN_DITHER_GOOD and PIXMAN_DITHER_BEST aliases are provided and
   should be used to benefit from future specializations.

 - The `pixman_image_set_dither` function allows to set the dithering
   method to use when rendering to a bits image.

 - The `pixman_image_set_dither_offset` function allows to set a
   vertical and horizontal offsets for the dither matrix.  This can be
   used after scrolling to ensure a consistent spatial positioning of
   the dither matrix.

Changes since previous version (v2):
 - linear_gradient_is_horizontal optimization is still compatible with
   the wide pipeline.  The code disabling it was a remnant of a previous
   patch which performed dithering directly inside linear_get_scanline,
   and thus needed to be called independently for each scanline.

Changes since v1:
 - Renamed PIXMAN_DITHER_BAYER_8 to PIXMAN_DITHER_ORDERED_BAYER_8
 - Disable dithering for channels with 32bpp or more (since they can
   represent exactly the wide values already).  This makes the patches
   compatible with the newly added floating point format.

Dithering is compatible with linear_gradient_is_horizontal
2019-05-25 07:29:55 -07:00
Fan Jinke
85bfa8b4f9 add Hygon Dhyana support to enable X86_MMX_EXTENSIONS feature
Signed-off-by: Fan Jinke <fanjinke@hygon.cn>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-05-02 16:07:19 -07:00
Basile Clement
8256c235d9 Fix bilinear filter computation in wide pipeline
The recently introduced wide pipeline for filters has a typo which
causes it to improperly compute bilinear interpolation positions,
causing various glitches when enabled.

This patch uses the proper computation for bilinear interpolation in the
wide pipeline.  It also makes related `if` statements conformant to the
CODING_STYLE:

* If a substatement spans multiple lines, then there must be braces
  around it.

* If one substatement of an if statement has braces, then the other
  must too.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-04-11 10:59:00 +02:00
Matt Turner
e21ebfb13f Post-release version bump to 0.38.5
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-10 10:25:18 -07:00
Matt Turner
e8df10eea9 Pre-release version bump to 0.38.4
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-10 10:17:47 -07:00
Matt Turner
23f036d461 Makefile.am: Ship Meson assembly test files in the tarball
These were forgotten in commit 0ea37df428 (meson: store ARM SIMD and
NEON tests as text files) and since autotools doesn't use them make
distcheck still succeeded.

Fixes #30

Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-10 10:10:47 -07:00
Matt Turner
e7058fe49d Makefile.am: Update download links
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-07 13:43:57 -07:00
Matt Turner
8888e752bf Post-release version bump to 0.38.3
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-07 13:34:44 -07:00
Matt Turner
a7ffb3e617 Pre-release version bump to 0.38.2
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-07 13:13:30 -07:00
Matt Turner
4c4753c407 meson: Correct copy-and-paste mistake
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-04-07 12:31:40 -07:00
Niveditha Rau
72959837ab void function should not return a value
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-03-27 15:14:05 -07:00
Simon Richter
ef4fb03248 Windows: Support building with SHELL=cmd.exe
When GNU Make is not from msys, the startup cost for sh.exe is massive
compared to cmd.exe.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-03-27 15:12:52 -07:00
Simon Richter
55d8f956c2 Windows: Show compiler invocation
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-03-27 15:12:52 -07:00
Dylan Baker
0ea37df428 meson: store ARM SIMD and NEON tests as text files
This is unfortunately required to make the tests work correctly, as
otherwise meson assumes that the files are C code not assembly. I've
opened https://github.com/mesonbuild/meson/issues/5151, to discuss
fixing the issue in meson upstream.

Fixes #29
2019-03-27 10:54:50 -07:00
Dylan Baker
2065a07e98 meson: simplify and fix mmx library compilation
This simplifies the logic and fixes the loongson-mmi implementation to
build correctly.
2019-03-27 10:54:50 -07:00
Dylan Baker
6e206cf7fc meson: Add proper include paths for the loongson check 2019-03-27 10:53:34 -07:00
Dylan Baker
9ed0576a73 meson: fix copy-n-paste error for arm simd assembly
mentioned in #29
2019-03-27 10:53:34 -07:00
Dylan Baker
d13f6a8b1d meson: fix typo which breaks loongson checks
mach -> march
2019-03-27 10:53:34 -07:00
Dylan Baker
e7ac62c3c7 meson: work around meson issue #5115
This issue causes openmp arguments to be injected into compilers that
can support openmp, even if they don't. This issue will be fixed in
0.51 (code already landed in mesonbuild#5116), for older versions lets
work around the issue.
2019-03-27 10:53:33 -07:00
Maarten Lankhorst
5d2cf8fc21 Bump version to 0.38.0
And update RELEASING for the new meson build system.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-02-11 13:27:25 +01:00
Maarten Lankhorst
6240ad15c6 pixman: Use maximum precision for pixman-bits-image, v2.
pixman-bits-image's wide helpers first obtains the 8-bits image,
then converts it to float. This destroys all the precision that
the wide path was offering.

Fix this by making get_pixel() take a pointer instead of returning
a value. Floating point will fill in a argb_t, while the 8-bits path
will fill a 32-bits ARGB value. This also requires writing a floating
point bilinear interpolator. With this change pixman can use the full
floating point precision internally in all paths.

Changes since v1:
- Make accum and reduce an argument to convolution functions,
  to remove duplication.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Basile Clement <basile-pixman@clement.pm>
2019-02-11 12:48:57 +01:00
Basile Clement
a32fc4faf9 Implement floating point gradient computation, v2.
This patch modifies the gradient walker to be able to generate floating
point values directly in addition to a8r8g8b8 32 bit values.  This is
then used by the various gradient implementations to render in floating
point when asked to do so, instead of rendering to a8r8g8b8 and then
expanding to floating point as they were doing previously.

Changes since v1 (mlankhorst):
- Implement pixman_gradient_walker_pixel_32 without calling
  pixman_gradient_walker_pixel_float, to prevent performance degradation.
  Suggested by Adam Jackson.
- Fix whitespace errors.
- Remove unnecessary function prototypes in pixman-private.h

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
[mlankhorst: Add comment about pixman_contract_from_float,
             based on Basille's suggestion]
Acked-by: Basile Clement <basile-pixman@clement.pm>
2019-02-11 12:48:21 +01:00
Dylan Baker
b40d5495ec build: Add meson files to EXTRA_DIST
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-01-15 19:13:24 -08:00
Dylan Baker
16eacf19a3 editorconfig: use tabs for Makefiles
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-01-15 19:13:14 -08:00
Andreas Boll
60eec33554 Upload to unstable. 2018-12-12 22:02:53 +01:00
Andreas Boll
431e754de7 Bump standards version to 4.2.1. 2018-12-12 21:55:48 +01:00
Andreas Boll
8c5411a23b Bump debhelper compat to 11. 2018-12-12 21:55:28 +01:00
Andreas Boll
ea26aeb957 Set source format to 1.0. 2018-12-12 21:54:43 +01:00
Andreas Boll
da6e874f81 Use https URL in debian/copyright. 2018-12-12 21:53:40 +01:00
Andreas Boll
2d7f5e5831 Update Vcs-* URLs to point to salsa.debian.org. 2018-12-12 21:52:18 +01:00
Andreas Boll
c8e824af7b Update to my Debian address. 2018-12-12 21:51:21 +01:00
Andreas Boll
a26c93f936 Bump changelogs 2018-12-12 21:07:41 +01:00
Andreas Boll
51baef77fb Merge branch 'debian-unstable' into debian-unstable-new 2018-12-12 21:01:26 +01:00
Andreas Boll
0c08dcfc0c pixman 0.34.0 release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWrh2cAAoJEGUdTbirWueAfxAH/1sf8P0SHY1y9KBKCw0enM4Y
 60sZYAgTgLa5prITcPeTb11bw877WAF73bAVjzL+6pNkT+Xs1ytvckwmbDoKDRZi
 zlptf0vPCnPX95Fh2X2PSO/1G0EErNWbqP5dUtLJ8L4sEaAj5TtDC9r9BouXpFaR
 qdipAmC1dVQNsbheBUinnfIjQ7H7i0NXXoUADFoP+X9V3WW95Hjkbwyoa4IUeYsY
 lPLVKfMRTZfQLksAAViDDpAhQxIrwMYQYApuMlbYXvX3tsW6zZCTeDfjqwRfxkdX
 Nnsz3lKBGvbS2ZJQBx2Xp9YC7+eu12IlxFA8cn3Exa96VngPJK5bR8Qn1ZJlUH8=
 =hex7
 -----END PGP SIGNATURE-----

Merge tag 'pixman-0.34.0' into debian-unstable-new

pixman 0.34.0 release
2018-12-12 21:01:18 +01:00
Maarten Lankhorst
146fa64351 Merge remote-tracking branch 'origin/master'
And bump meson version to 37.1 as well. Seems my push to upstream failed.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-12-07 14:20:44 +01:00
Maarten Lankhorst
0202f0d89d Post release version bump to 37.1
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-12-07 13:44:38 +01:00
Dylan Baker
eb0dfaa0c6 gitlab-ci: Add meson build to pipeline test 2018-11-29 16:57:01 +00:00
Dylan Baker
199a3bd275 meson: Add a meson build system
This commit adds a meson build system for pixman. It carries the usual
improvements of meson, better clean build time, much better incremental
build times, while being simpler and easier to understand.

This takes advantage of some features from the most recent versions of
meson: the builtin openmp dependency and the feature option type.

There are a couple of things that I've done a bit differently than the
autotools build system, I've built a libdemos which is the utilities
from the demos folder, and I've linked the demos with libtestutils from
tetsts, otherwise I expect that most things will be the same.

I've tested so far cross compiling from x86_64 -> x86, x86_64 ->
Aarch64, and Linux to Windows via mingw, as well as native x86_64 Linux
builds which all work. I've also built with mingw nativly, there are
some test failures there. An MSVC build can be generated, but fails.

v2: - set WORDS_BIGENDIAN in the config for big endian systems.
2018-11-29 16:57:01 +00:00
Dylan Baker
761f36c3c8 Add .editorconfig file
This sets the style for meson (which uses the upstream style, 2 space
indent with no tabs), and sets the tab_width to 8 per the CODING_STYLE
document.
2018-11-29 16:57:01 +00:00
Maarten Lankhorst
0313f35ab9 Bump version to 0.36.0
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-11-21 12:40:26 +01:00
Maarten Lankhorst
8a5d44c420 pixman: Update git repository to the one at gitlab.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-11-21 12:39:33 +01:00
Maarten Lankhorst
489fa0df11 pixman: Add tests for (a)rgb floating point formats.
Add some basic tests to ensure that the newly added formats work as
intended.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-11-06 14:25:49 +01:00
Maarten Lankhorst
a4b8a26d2b pixman: Add support for argb/xrgb float formats, v5.
Pixman is already using the floating point formats internally, expose
this capability in case someone wants to support higher bit per
component formats.

This is useful for igt which depends on cairo to do the rendering.
It can use it to convert floats internally to planar Y'CbCr formats,
or to F16.

We add a new type PIXMAN_TYPE_RGBA_FLOAT for this format, which is an
all float array of R, G, B, and A. Formats that use mixed float/int
RGBA aren't supported, and will probably need their own type.

Changes since v1:
- Use RGBA 128 bits and RGB 96 bits memory layouts, to better match the opengl format.
Changes since v2:
- Add asserts in accessor and for strides to force alignment.
- Move test changes to their own commit.
Changes since v3:
- Define 32bpc as PIXMAN_FORMAT_PACKED_C32
- Rename pixman accessors from rgb*_float_float to rgb*f_float
Changes since v4:
- Create a new PIXMAN_FORMAT_BYTE for fitting up to 64 bits per component.
  (based on Siarhei Siamashka's suggestion)
- Use new format type PIXMAN_TYPE_RGBA_FLOAT

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> #v4
[mlankhorst: Fix missing braces in PIXMAN_FORMAT_RESHIFT macro]
2018-11-06 14:24:05 +01:00