Thread (2 messages) 2 messages, 2 authors, 2018-09-13

[Intel-gfx] [PATCH i-g-t] igt/prime_vgem: Skip flip if no display

From: Chris Wilson <hidden>
Date: 2018-09-13 12:58:22
Also in: intel-gfx
Subsystem: the rest · Maintainer: Linus Torvalds

We try flipping a vgem surface onto a  i915 scanout. However, if there
is no display we want to disable the kms interface, including the addfb
ioctl. On such systems the call to kms_addfb will naturally fail and the
test cannot be run.

Signed-off-by: Chris Wilson <redacted>
---
 tests/prime_vgem.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 993a35894..952fb017a 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -764,10 +764,13 @@ static void test_flip(int i915, int vgem, unsigned hang)
 		igt_assert(handle[i]);
 		close(fd);
 
-		do_or_die(__kms_addfb(i915, handle[i],
-				      bo[i].width, bo[i].height, bo[i].pitch,
-				      DRM_FORMAT_XRGB8888, I915_TILING_NONE, NULL,
-				      LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id[i]));
+		/* May skip if i915 has no displays */
+		igt_require(__kms_addfb(i915, handle[i],
+					bo[i].width, bo[i].height, bo[i].pitch,
+					DRM_FORMAT_XRGB8888,
+					I915_TILING_NONE, NULL,
+					LOCAL_DRM_MODE_FB_MODIFIERS,
+					&fb_id[i]) == 0);
 		igt_assert(fb_id[i]);
 	}
 
-- 
2.19.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help