Commit graph

16 commits

Author SHA1 Message Date
Simon Ser
ec86735763 test/bench: disable timeout 2024-05-21 10:52:15 +02:00
Simon Ser
35c06e8995 Add option to set timeout for liftoff_output_apply()
The default limit of 1ms might be too short if the compositor
calls liftoff_output_apply() early in the vblank cycle, or too
long if the refresh rate is high. The compositor is in a better
spot to decide how much time should be spent on atomic tests, so
add an option for that.

Closes: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/78
2024-05-21 08:45:56 +00:00
Simon Ser
c63676eda7 test: add silent mode to libdrm_mock
Useful for benchmarks.
2024-05-21 10:25:35 +02:00
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
ce325b1ee6 Turn on -Wsign-conversion
References: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/74
2023-02-16 21:33:36 +01:00
Simon Ser
99ed53677a Turn on -Wdeclaration-after-statement
Enforces code style.
2023-02-16 20:03:42 +01: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
61fd4c099a Make liftoff_output_apply return an int
Callers may want to get more details about the failure, in
particular EPERM indicates that the user isn't DRM master (can
happen on VT switch).
2021-07-27 12:28:00 +02:00
Simon Ser
562f8b0af6 Allow to choose which planes are managed by libliftoff
Closes: https://github.com/emersion/libliftoff/issues/10
2021-07-01 11:37:10 +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
Jan Beich
0095702303 build: ignore warnings in libdrm headers
In file included from ../log.c:4:
In file included from ../include/log.h:4:
In file included from ../include/libliftoff.h:8:
/usr/local/include/xf86drmMode.h:551:19: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
        uint32_t lessees[0];
                         ^
/usr/local/include/xf86drmMode.h:558:19: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
        uint32_t objects[0];
                         ^
2020-10-31 09:17:13 +01:00
Jan Beich
ca097d55bc test: bump POSIX version for CLOCK_MONOTONIC
test/bench.c:99:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &start);
                      ^
test/bench.c:106:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &end);
                      ^
2020-10-31 09:17:13 +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
8272b61150
test: add benchmark
This is a pretty basic benchmark measuring the time spent in
liftoff_display_apply.

The current behaviour tries to reproduce the worst case scenario: layers don't
intersect and one plane is incompatible with all layers.
2019-10-30 21:16:42 +01:00