[PATCH i-g-t 2/2] lib: Skip drmModeReources()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



An alternative to requiring the display is to mark the attached display
as empty (no available CRTC, no outputs) and let the tests skip if they
required any output. This allows the binary to open the display once in
its global fixture, even if it doesn't use the display in every subtest
and so avoid skipping the subtests that didn't require the display.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 lib/igt_kms.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0e6f91475..b38d64415 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1857,7 +1857,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 
 	resources = drmModeGetResources(display->drm_fd);
-	igt_require(resources);
+	if (!resources)
+		goto out;
 
 	/*
 	 * We cache the number of pipes, that number is a physical limit of the
@@ -2005,6 +2006,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	igt_display_reset(display);
 	igt_kms_disallow_hotplug(drm_fd);
 
+out:
 	LOG_UNINDENT(display);
 }
 
-- 
2.19.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux