summaryrefslogtreecommitdiff
path: root/lib/igt_device.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-05-15 11:18:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-05-15 21:11:33 +0100
commit61dd8eec659062eac67823ccd9f2189c3aa36201 (patch)
tree83d24f52555427bf0accf1f71c30c9d8c0f04d73 /lib/igt_device.c
parent24500748e2cc2c4c4e8f3dd037d2da06d4711d35 (diff)
lib: Show other clients when SETMASTER fails
Currently we only show the clients at DEBUG level which is not automatically shown for a SKIP. However, failing to SETMASTER is more often a mistake and we do want to see the other clients. The choice is at what level to show them? If we want to avoid having extra WARNs in CI, we should keep them to INFO, but on the other hand failing to acquire SETMASTER is tantamount to failure, so WARN. References: https://bugs.freedesktop.org/show_bug.cgi?id=110682 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Martin Peres <martin.peres@free.fr> Acked-by: Martin Peres <martin.peres@free.fr>
Diffstat (limited to 'lib/igt_device.c')
-rw-r--r--lib/igt_device.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/igt_device.c b/lib/igt_device.c
index 08f39c8b1..9469e5de2 100644
--- a/lib/igt_device.c
+++ b/lib/igt_device.c
@@ -32,13 +32,20 @@ int __igt_device_set_master(int fd)
int err;
err = 0;
- if (drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL))
+ if (drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL)) {
err = -errno;
+ igt_assume(err);
+ }
errno = 0;
return err;
}
+static void show_clients(int fd)
+{
+ __igt_debugfs_dump(fd, "clients", IGT_LOG_WARN);
+}
+
/**
* igt_device_set_master: Set the device fd to be DRM master
* @fd: the device
@@ -48,7 +55,7 @@ int __igt_device_set_master(int fd)
void igt_device_set_master(int fd)
{
if (__igt_device_set_master(fd)) {
- igt_debugfs_dump(fd, "clients");
+ show_clients(fd);
igt_require_f(__igt_device_set_master(fd) == 0,
"Can't become DRM master, "
"please check if no other DRM client is running.\n");
@@ -60,8 +67,10 @@ int __igt_device_drop_master(int fd)
int err;
err = 0;
- if (drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL))
+ if (drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL)) {
err = -errno;
+ igt_assume(err);
+ }
errno = 0;
return err;
@@ -81,7 +90,7 @@ void igt_device_drop_master(int fd)
return;
if (__igt_device_drop_master(fd)) {
- igt_debugfs_dump(fd, "clients");
+ show_clients(fd);
igt_assert_f(__igt_device_drop_master(fd) == 0,
"Failed to drop DRM master.\n");
}