summaryrefslogtreecommitdiff
path: root/lib/igt_device.c
diff options
context:
space:
mode:
authorKatarzyna Dec <katarzyna.dec@intel.com>2018-05-15 10:40:55 +0200
committerMichaƂ Winiarski <michal.winiarski@intel.com>2018-05-15 17:14:51 +0200
commitb7432bf309d5d5a6e07e8a0d8b522302fb0b4502 (patch)
tree196ff27520e5e334d79de57d55d780f79b544f12 /lib/igt_device.c
parente3df327574ea246031a3de5e7b06b4ba704c89eb (diff)
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 <katarzyna.dec@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_device.c')
-rw-r--r--lib/igt_device.c12
1 files 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");
+ }
}