mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-11-16 19:47:55 +01:00
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.
This commit is contained in:
parent
95d16704b9
commit
f6b4cd6197
1 changed files with 4 additions and 2 deletions
2
device.c
2
device.c
|
@ -88,8 +88,10 @@ bool device_test_commit(struct liftoff_device *device,
|
|||
{
|
||||
int ret;
|
||||
|
||||
do {
|
||||
ret = drmModeAtomicCommit(device->drm_fd, req,
|
||||
DRM_MODE_ATOMIC_TEST_ONLY, NULL);
|
||||
} while (-ret == EINTR || -ret == EAGAIN);
|
||||
if (ret == 0) {
|
||||
*compatible = true;
|
||||
} else if (-ret == EINVAL || -ret == ERANGE) {
|
||||
|
|
Loading…
Reference in a new issue