From b7432bf309d5d5a6e07e8a0d8b522302fb0b4502 Mon Sep 17 00:00:00 2001 From: Katarzyna Dec Date: Tue, 15 May 2018 10:40:55 +0200 Subject: lib/igt_device: Add information why cannot drop drm master Let's add additional information to igt_device_drop_master in case we try to run tests with e.g. x11 enabled. v2: Changed comment and added listing clients. v3: Changed igt_require to igt_assert. v4: Added checking if we are master already. References: https://bugs.freedesktop.org/show_bug.cgi?id=105990 Signed-off-by: Katarzyna Dec Cc: Chris Wilson Reviewed-by: Chris Wilson --- lib/igt_device.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/igt_device.c b/lib/igt_device.c index 8a2dd0e3..5b3722c8 100644 --- a/lib/igt_device.c +++ b/lib/igt_device.c @@ -70,9 +70,17 @@ int __igt_device_drop_master(int fd) * @fd: the device * * Tell the kernel we no longer want this device fd to be the DRM master; - * asserting that we lose the privilege. + * asserting that we lose the privilege. Return if we are master already. */ void igt_device_drop_master(int fd) { - igt_assert_eq(__igt_device_drop_master(fd), 0); + /* Check if we are master before dropping */ + if (__igt_device_set_master(fd)) + return; + + if (__igt_device_drop_master(fd)) { + igt_debugfs_dump(fd, "clients"); + igt_assert_f(__igt_device_drop_master(fd) == 0, + "Failed to drop DRM master.\n"); + } } -- cgit v1.2.3