Commit graph

263 commits

Author SHA1 Message Date
Simon Ser
25dd6d662e Fix -Wsign-conversion on 32-bit
Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/75
2023-02-22 10:45:05 +01:00
Simon Ser
314684fc64 plane: add NULL check to liftoff_plane_destroy()
All other libliftoff destructors already check for NULL, except
this one.
2023-02-22 10:15:19 +01:00
Simon Ser
94eb185771 build: bump to 0.5.0-dev 2023-02-20 22:09:53 +01:00
Simon Ser
40834142e1 build: bump version to 0.4.0 2023-02-20 22:04:22 +01:00
Simon Ser
ce325b1ee6 Turn on -Wsign-conversion
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/74
2023-02-16 21:33:36 +01:00
Simon Ser
b2721f739c Turn on -Wfloat-conversion
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/74
2023-02-16 21:07:05 +01:00
Simon Ser
8c5b0857f0 Add gcovr.cfg
Exclude test code and example code from code coverage results.
2023-02-16 20:05:48 +01:00
Simon Ser
99ed53677a Turn on -Wdeclaration-after-statement
Enforces code style.
2023-02-16 20:03:42 +01:00
Simon Ser
fb8ede8f89 editorconfig: increase max line length to 100
That's what the kernel uses.
2023-02-16 19:56:31 +01:00
Simon Ser
2045e7d070 Log reason why a previous allocation is not re-used 2023-02-16 19:55:30 +01:00
Simon Ser
63c6043b15 Fix disabled layers forcing realloc 2023-02-16 19:51:42 +01:00
Simon Ser
2f461be62c Add missing braces for code style 2023-02-16 19:51:24 +01:00
Simon Ser
9e44872217 test/prop: add range/enum/bitmask tests 2023-02-16 12:36:24 +01:00
Simon Ser
a002a240e9 test/prop: simplify by introducing commit() function 2023-02-15 20:12:37 +01:00
Simon Ser
0b910624f5 plane: check value for range/enum/bitmask properties
We need to drop the assert from apply_current(): the new value
may be outside the range for instance.

Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/47
2023-02-15 20:11:57 +01:00
Simon Ser
46f35829e0 plane: check IMMUTABLE flag in plane_set_prop() 2023-02-15 19:30:04 +01:00
Simon Ser
9568888b99 plane: store drmModePropertyRes
This retains all of the info we need: ID, name, type, possible
enum values. We'll need the possible enum values in the next
commit.
2023-02-15 19:30:04 +01:00
Simon Ser
8ec1203e64 test: add IN_FORMATS test 2023-02-15 19:19:24 +01:00
Simon Ser
94f45a91c4 test: add liftoff_mock_plane_add_in_formats() 2023-02-15 19:19:24 +01:00
Simon Ser
944ff20b13 alloc: check FB format and modifier
Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/12
2023-02-15 19:19:24 +01:00
Simon Ser
8a9167f9fd test/libdrm_mock: add stub blob functions 2023-02-15 19:12:46 +01:00
Simon Ser
0811ce855b test/libdrm_mock: take initial prop value as separate arg
drmModePropertyRes.values never holds the current value. Stop
abusing this field.
2023-02-15 18:39:57 +01:00
Simon Ser
afeeafd6d7 test: add basic test for candidate planes 2023-02-15 18:20:23 +01:00
Simon Ser
3e72fc3c5d test/libdrm_mock: add liftoff_mock_plane_get_id()
Useful when manually calling liftoff_plane_create() is desirable.
2023-02-15 18:20:23 +01:00
Simon Ser
6e8998c8a8 Add API to query candidate planes
This can be used to implement Wayland's linux-dmabuf-unstable-v1's
feedback mechanism.

Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/70
2023-02-15 18:20:22 +01:00
Simon Ser
62cd0aad09 test: add dynamic@change-fb-modifier 2023-02-15 18:14:13 +01:00
Simon Ser
ab72b0d5c6 Stop re-using a previous configuration when FB attributes change
If FB attributes change, we might be able to take advantage of a
plane we couldn't  use before.

Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/71
2023-02-15 18:14:13 +01:00
Simon Ser
a669c85be6 test/libdrm_mock: implement drmCloseBufferHandle() stub 2023-02-15 18:14:13 +01:00
Simon Ser
e03edeffba test/libdrm_mock: implement drmModeGetFB2()
By default, drmModeGetFB2() behaves as-if the kernel didn't support
the IOCTL. That way we don't need to update all tests to set sensible
FB info.

If a test is specifically interested in testing drmModeGetFB2()
behavior, it can call liftoff_mock_drm_set_fb_info().
2023-02-15 18:14:13 +01:00
Simon Ser
d39d1837fb test/libdrm_mock: add helpers to convert from/to object index
libdrm_mock's KMS object IDs record the type and index.
2023-02-15 17:56:50 +01:00
Simon Ser
e1ccdff079 build: set pkg-config URL 2023-02-15 11:50:33 +01:00
Simon Ser
97e0695932 build: remove unnecessary version param in pkgconfig.generate() 2023-02-06 11:20:24 +01:00
Simon Ser
363951a084 build: override Meson dependency
Eases use as a subproject.
2023-02-06 11:18:16 +01:00
Simon Ser
73c44aa52a readme: disambiguate short description a bit 2022-10-07 07:04:24 +02:00
Simon Ser
f83d81c91e readme: indicate which compositors use the library 2022-10-07 07:02:55 +02:00
Simon Ser
47b92cb22f Switch to kernel-doc style references in comments 2022-09-28 21:00:06 +02:00
Simon Ser
bcfca8f602 build: bump version to 0.4.0-dev 2022-08-18 09:18:44 +02:00
Simon Ser
c4488eeff9 build: bump to version 0.3.0 2022-08-18 09:17:49 +02:00
Simon Ser
9c84f7945a Introduce liftoff_layer_unset_property()
This can be used when a propperty doesn't have a default/no-op
value, such as COLOR_ENCODING and COLOR_RANGE.
2022-08-05 23:10:14 +02:00
Simon Ser
1d425f542c plane: ignore pixel blend mode when set to Pre-multiplied
This behaves the same when the property isn't supported.
2022-08-03 23:00:13 +02:00
Simon Ser
4d6989b389 plane: ignore FB_DAMAGE_CLIPS if plane is missing prop
Reporting the damage is optional, if the driver doesn't expose the
prop it means it doesn't care about damage.
2022-08-03 22:55:35 +02:00
Simon Ser
0ce48717b4 plane: ignore SCALING_FILTER when set to Default
This behaves the same when the property isn't supported.
2022-08-03 22:55:33 +02:00
Simon Ser
79f1647d67 ci: turn off tar verbosity when compressing coverage report 2022-07-27 09:08:00 +02:00
Simon Ser
1eb42e264e ci: enable meson --fatal-meson-warnings
And remove unnecessary -Dauto_features=enabled, since this library
doesn't have any feature options.
2022-07-27 09:07:05 +02:00
Simon Ser
091511af44 ci: build with ASan 2022-07-27 09:05:01 +02:00
Stephan Lachnit
dd154d6914
build: set c_std to c11
This follows https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/249 and fixes a pedantic warning when including libdrm as wrap.

Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2022-07-26 10:25:49 +02:00
Stephan Lachnit
493685ff1b
test: add includes to partial drm dependency
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2022-07-26 10:24:12 +02:00
Simon Ser
4a42a1a6a9 build: fix library version
Fixes the following error:

    ../meson.build:31:0: ERROR: Invalid Shared library version "0.3.0-dev". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.
2022-05-24 12:23:01 +02:00
Simon Ser
8a95d52890 build: bump version to 0.3.0-dev
Makes it clear this is a development version. See [1].

[1]: https://github.com/swaywm/sway/pull/6730
2022-05-24 12:15:11 +02:00
Simon Ser
ac919002ca build: bump version to 0.3.0 2022-02-10 13:57:06 +01:00