summaryrefslogtreecommitdiff
path: root/lib/drmtest.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-07-25 13:36:17 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-07-25 14:17:57 +0200
commit542658a452e7fbd63071dd4be3aa22b1fcc33cf0 (patch)
treeb04b4ab1ef643a448dcdfd09f290f22696b37e3f /lib/drmtest.c
parent76bce77388bcb4f1c0fc8d6245279ec50e12161a (diff)
lib/drmtest: Decode driver flags on failure
I spent too much time going wtf why does this test not run until realizing that vgem is missing. This should help a lot for tests that need multiple different drm drivers. v2: Distinguish "any" and "other" (Chris). Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r--lib/drmtest.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 480bd0b1..158af682 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -341,6 +341,26 @@ static void quiescent_gpu_at_exit_render(int sig)
at_exit_drm_render_fd = -1;
}
+static const char *chipset_to_str(int chipset)
+{
+ switch (chipset) {
+ case DRIVER_INTEL:
+ return "intel";
+ case DRIVER_VC4:
+ return "vc4";
+ case DRIVER_VGEM:
+ return "vgem";
+ case DRIVER_VIRTIO:
+ return "virtio";
+ case DRIVER_AMDGPU:
+ return "amdgpu";
+ case DRIVER_ANY:
+ return "any";
+ default:
+ return "otehr";
+ }
+}
+
/**
* drm_open_driver:
* @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
@@ -356,7 +376,8 @@ int drm_open_driver(int chipset)
int fd;
fd = __drm_open_driver(chipset);
- igt_skip_on_f(fd<0, "No known gpu found\n");
+ igt_skip_on_f(fd<0, "No known gpu found for chipset flags 0x%u (%s)\n",
+ chipset, chipset_to_str(chipset));
/* For i915, at least, we ensure that the driver is idle before
* starting a test and we install an exit handler to wait until