Commit graph

13 commits

Author SHA1 Message Date
Simon Ser
a003206c38 Add kernel tracing instrumentation 2021-10-25 17:28:14 +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
aa30b8fb97 Log number of atomic test-only commits 2021-09-30 09:41:39 +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
f5a2b541ce Make liftoff_device_register_all_planes return an int
For consistency with liftoff_output_apply.
2021-07-30 16:19:29 +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
24abeb923f
Remove DRM_MODE_PAGE_FLIP_EVENT from commit flags
It's illegal to request a page-flip event when performing a test-only commit.
The kernel returns EINVAL in this case [1].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_atomic_uapi.c?id=407ab579637ced6dc32cfb2295afb7259cca4b22#n1318
2020-11-10 16:42:06 +01: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
f6b4cd6197
Retry atomic commit on EINTR and EAGAIN
From the kernel docs:

> -EINTR, -EAGAIN or -ERESTARTSYS, if the IOCTL should be restarted. This can
> either be due to a pending signal, or because the driver needs to completely
> bail out to recover from an exceptional situation like a GPU hang. From a
> userspace point of view all errors are treated equally.

We're not handling ERESTARTSYS because it's non-POSIX.
2020-01-13 12:28:39 +01:00
Simon Ser
95d16704b9
Move device_test_commit to device.c 2020-01-13 12:22:47 +01:00
Simon Ser
cfeee41ec1
Allow NULL to be passed to destructors
In this case, the destructor will be a no-op. This is similar to free(3)'s
behavior and allows to omit a NULL check for callers.
2019-12-31 20:46:08 +01:00
Simon Ser
49b4f46762
Rename display.c to device.c
Forgot to do that when renaming the struct.
2019-11-29 01:51:22 +01:00
Renamed from display.c (Browse further)