Skip to contentSkip to conversation

lib/drmtest: Decode driver flags on failure

PATCH In review Daniel Vetter 3 participants 3 messages Jul 25, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 lib/drmtest.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
lib/drmtest.c +20 -1
index 480bd0b132cd..944c6e02fd31 100644
@@ -341,6 +341,24 @@ 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";
+	default:
+		return "any";
+	}
+}
+
 /**
  * drm_open_driver:
  * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
@@ -356,7 +374,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
Signature · 6 lines
2.13.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Quoting Daniel Vetter (2017-07-25 12:37:08)

Quoted 20 lines

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.

---
 lib/drmtest.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
lib/drmtest.c +3 -0
index 480bd0b132cd..944c6e02fd31 100644
@@ -341,6 +341,24 @@ 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) {

lib/drmtest.c static void quiescent_gpu_at_exit_render(int sig) · line 356

Quoted 10 lines
lib/drmtest.c +10 -0
+       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:

lib/drmtest.c static void quiescent_gpu_at_exit_render(int sig) · line 358

Quoted 2 lines
lib/drmtest.c +2 -0
+               return "any";
+       default:
		return "other";

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 32 lines · Chris Wilson

Quoting Daniel Vetter (2017-07-25 12:37:08)

Quoted 20 lines

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.

---
 lib/drmtest.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
lib/drmtest.c +3 -0
index 480bd0b132cd..944c6e02fd31 100644
@@ -341,6 +341,24 @@ 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) {

lib/drmtest.c static void quiescent_gpu_at_exit_render(int sig) · line 356

Quoted 10 lines
lib/drmtest.c +10 -0
+       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:

Quoted 3 lines

lib/drmtest.c static void quiescent_gpu_at_exit_render(int sig) · line 358

Quoted 2 lines
lib/drmtest.c +2 -0
+               return "any";
+       default:
		return "other";

Revised and pushed with Chris' irc-r-b.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx