Commit graph

25 commits

Author SHA1 Message Date
Simon Ser
1616f8ae6a test/alloc: document test_layer and test_setup 2021-06-24 19:05:01 +02:00
Simon Ser
b08bbaa5e6 Split liftoff_log_init into set_handler and set_priority
This allows callers to change only one of those, without the other.
Also rename importance to priority and func to handler.
2021-03-31 12:44:24 +02:00
Simon Ser
679e2bb0cd
Allow caller to pass commit flags
When the caller wants to perform a modeset, they will need to pass
DRM_MODE_ATOMIC_ALLOW_MODESET in the atomic commit flags, otherwise the driver
will fail the commit. libliftoff also needs to provide these flags in its
test-only commits.
2020-11-10 16:27:55 +01:00
Simon Ser
5603060a9b
Take disabled layers into account in non_composition_layers_len
Disabled layers (with FB_ID = 0) don't need a plane. Fix the
non_composition_layers_len count in this case.

Closes: https://github.com/emersion/libliftoff/issues/49
2020-05-26 20:08:12 +02:00
Simon Ser
6d4e22a5f8
test: a test-only commit doesn't apply properties
This fixes a misunderstanding of the DRM API. Only a regular commit applies
properties.

Fixes: b16078769e ("test/libdrm_mock: a test-only commit applies properties")
2020-05-26 18:49:04 +02:00
Simon Ser
b16078769e
test/libdrm_mock: a test-only commit applies properties
The previous mock library assumed the DRM client would always set all
properties in the atomic request. However, if a previous test-only commit
has set a property, there's no need to set it again.

Accomodate for this in libdrm_mock. This will be useful when we'll skip
setting properties that haven't changed in libliftoff.

References: https://github.com/emersion/libliftoff/issues/37
2020-01-13 12:14:33 +01:00
Simon Ser
7286146341
test: add a test with a zero FB_ID
References: 53a7bfebc9 ("Don't allocate planes for layers without a FB")
2019-12-19 17:54:49 +01:00
Simon Ser
71200724c5
test: add a test with a layer without any prop set
Makes sure libliftoff doesn't allocate a plane for the layer and doesn't crash.

References: 799f694587 ("Fix segfault when FB_ID isn't set")
References: 53a7bfebc9 ("Don't allocate planes for layers without a FB")
2019-12-19 17:50:40 +01:00
Simon Ser
657a9917c5
Add a way to force FB composition
Closes: https://github.com/emersion/libliftoff/issues/17
2019-12-13 11:38:14 +01:00
Simon Ser
e09ebdac27
test: add empty test
Make sure calling apply() with no layer works as expected.
2019-11-29 10:57:24 +01:00
Simon Ser
ceb4a1ff9e
Replace liftoff_device_apply with liftoff_output_apply
Compositors need to drive multiple connectors, each with its own vblank timings.
For each device, there's one separate rendering loop per output.

It's not possible to call liftoff_device_apply each time we want to submit a new
frame to one output, because this could touch another's output state, submitting
a new frame there in the process. When the other output will submit a new frame,
it'll get EBUSY (can't submit two frames without waiting for vblank).

Closes: https://github.com/emersion/libliftoff/issues/21
2019-11-24 18:13:40 +01:00
Simon Ser
44d65288d7
Fixup display → device bulk rename
I managed to do a bit of a mess here.

Fixes: b0e2b083f9 ("Rename display to device")
2019-11-24 13:07:12 +01:00
Simon Ser
5115e96cd9
test: add composition tests 2019-10-11 14:31:17 +03:00
Simon Ser
1ee86c6290
Add logging functions
This allows turning on and off debug logs, as well as defining a logging
callback.
2019-10-11 12:03:14 +03:00
Simon Ser
c63c8c0d15
test: add zpos-4x-disjoint-alt
And restore the original zpos-4x-disjoint test. Depending on the constraints on
the last two layers, one branch of the layer zpos check or the other is taken.

Fixes: 8617ddfd05 ("Add intersection check for planes under the current one")
2019-09-15 23:48:10 +03:00
Simon Ser
8617ddfd05
Add intersection check for planes under the current one
References: https://github.com/emersion/libliftoff/issues/3
2019-09-15 22:31:10 +03:00
Simon Ser
b447a3bc34
test: prevent layers from being assigned to primary plane
In these tests, we always want to use the same layer for the primary plane.
Prevent othr layers from ending up on the primary plane.
2019-09-15 16:56:24 +03:00
Simon Ser
8c93a6fc88
test: add alloc@zpos-4x-domino-partial
This is a variant of alloc@zpos-4x-domino-fail, with plane ordering changed so
that one layer can be mapped to a plane.
2019-09-14 21:18:20 +03:00
Simon Ser
a93ea4a300
test: add alloc@zpos-4x-domino-fail
This test makes sure composited layers make layers underneath fall back to
composition too, in a transitive manner. That is, if plane A is under plane B
which is itself under plane C, plane A falling back to composition means that
both planes B and C fall back to composition too (even if C isn't directly
underneath A).
2019-09-14 21:05:14 +03:00
Simon Ser
07e04a50b6
Make composited layers prevent plane allocation underneath
If a layer cannot be mapped to a plane, make it so all layers under it also fail
plane allocation so that they can be properly composited on the primary plane.

A test was incorrect and has been fixed. Another test had two possible solutions
and has been updated with the one libliftoff yields.
2019-09-14 21:03:30 +03:00
Simon Ser
a3b8bc33ea
test: add various zpos tests
Some of these are failing, so they are disabled for now.
2019-09-14 12:59:37 +03:00
Simon Ser
3200016033
test: add basic zpos tests
zpos-3x maps three layers to primary, cursor and one of the overlays planes.

zpos-4x-partial sets up 4 layers but is only able to find a plane for 3 layers,
because ordering between the two overlay planes is undefined.
2019-09-13 22:53:15 +03:00
Simon Ser
de8175c998
test: add an alloc test with 3 layers 2019-09-13 22:35:23 +03:00
Simon Ser
fccdebfd6e
test: introduce structured alloc tests
This is a new kind of tests defined by a static structure. The structure
contains the layers and planes to setup as well as the expected result.
2019-09-13 19:47:00 +03:00
Simon Ser
5afeeb531a
Add test framework
When testing the library, the libdrm dependency is swapped with a mock libdrm.
The test sets up the mock libdrm's internal state and then runs the test.
2019-09-13 10:33:49 +03:00