Commit graph

287 commits

Author SHA1 Message Date
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
Simon Ser
378ccb4f84 test/alloc: add zpos-3x-zero-alpha
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/59
2022-01-31 14:29:16 +01:00
Simon Ser
223e288ae6 test/alloc: add zpos-3x-zero-fb-id
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/59
2022-01-31 14:26:20 +01:00
Simon Ser
b9ca919009 Ignore invisible layers in layer_intersects
Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/59
2022-01-31 14:25:54 +01:00
Simon Ser
7a06f8c597 test/alloc: rename composition-zero-fb-id to composition-no-props
This is more consistent with other test names.
2022-01-31 14:05:58 +01:00
Simon Ser
3004a0dcbd test/alloc: move zero-fb-id-fail to test data 2022-01-31 14:03:47 +01:00
Simon Ser
998d8c6a59 test/alloc: drop test_needs_composition logic
This was fine for simple test cases, but would need to become
more complicated for cases where e.g. zero FB_ID or alpha is
involved. Let's just hardcode the expected value in the test data
instead.
2022-01-31 14:00:20 +01:00
Simon Ser
61a8b85059 test/alloc: pass full test_case to run_test
More metadata will be added to the test_case struct soon.
2022-01-31 14:00:20 +01:00
Simon Ser
addeaf6097 test/alloc: replace test_layer.zpos with test_prop
This allows setting arbitrary props.
2022-01-31 13:39:47 +01:00
Simon Ser
32f97b1c51 test/alloc: check test_layer.compat length
Avoid iterating past the array bounds as a safety net. We should
have more than enough room for now, but let's make sure we don't
get caught.
2022-01-31 13:30:45 +01:00
Simon Ser
3ced3be25a test/alloc: make test data const
We should never mutate the test data.
2022-01-31 13:29:58 +01:00
Simon Ser
2e1dd93b60 test/alloc: add zpos-2x-fail 2021-12-14 18:57:04 +01:00
Simon Ser
1db99c213c test/alloc: add zpos-2x-reverse 2021-12-14 18:57:04 +01:00
Simon Ser
76f456d62e Check layers zpos over the primary plane
The following commits contain tests for the pathological cases.
2021-12-14 18:57:04 +01:00
Simon Ser
40ba530616 ci: add .gitlab-ci.yml 2021-12-14 17:05:49 +01:00
Simon Ser
28d074e5ab ci: drop py3-setuptools from Alpine packages
The upstream bug has been fixed.
2021-10-25 15:16:23 +02:00
Simon Ser
6166e23127 Migrate to gitlab.freedesktop.org 2021-10-25 15:01:58 +02:00
Simon Ser
b7a6958bca ENOSPC is not fatal for test-only commits
drm_atomic_plane_check may return it for an invalid SRC coord.
2021-10-08 13:00:40 +02:00
Simon Ser
70eca070b6 Make plane_get_property static 2021-09-30 14:57:19 +02:00
Simon Ser
408b6e5463 test/test_prop: add unmatched test case
Add a test case where the plane doesn't have a property set on the
layer.
2021-09-30 14:54:33 +02:00
Simon Ser
aa30b8fb97 Log number of atomic test-only commits 2021-09-30 09:41:39 +02:00
Simon Ser
bc0d0617ac Remove test/include/
Let's just put header files in test/, no need for a separate subdir.
2021-08-13 22:04:28 +02:00
Simon Ser
32683879e7 Add newline after function return type
Aligns our style with Linux' and Weston's.
2021-08-13 22:02:33 +02:00
Simon Ser
120ad6fb73 build: turn on additional warnings
Functions without a prototype can be static, we don't want to deal
with alloca, and undefined definitions should be tested with #ifdef.
2021-08-13 15:40:35 +02:00
Simon Ser
447a9e8921 Document why the primary plane is a special case
For instance, i915 requires the primary plane to be enabled.
2021-08-13 12:38:05 +02:00
Simon Ser
8a971695bd test: introduce liftoff_mock_require_primary_plane
This allows to mimick i915's requirement of failing all commits
which don't have the primary plane enabled.

We could expand our test matrix to test with the param *and* without
it, but since enabling the param just makes the atomic check more
strict there's no real benefit of doing that. Enabling the param
can only make tests fail more often, not the other way around.
2021-08-13 12:28:13 +02:00
Simon Ser
149e149643 Improve alloc debug logging
Don't increase indent when skipping a plane. Better indent layer
and plane logs.
2021-08-13 09:23:16 +02:00