From f1249a92dd5d890b9827b5b5bc9ecde8f6427d69 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 13 Sep 2018 13:56:17 +0100 Subject: igt/prime_vgem: Skip flip if no display 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 Acked-by: Antonio Argenziano --- tests/prime_vgem.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/prime_vgem.c') diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 5e0c4e28..60bb951c 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -766,11 +766,13 @@ static void test_flip(int i915, int vgem, unsigned hang) strides[0] = bo[i].pitch; - do_or_die(__kms_addfb(i915, handle[i], - bo[i].width, bo[i].height, - DRM_FORMAT_XRGB8888, I915_TILING_NONE, - strides, offsets, 1, - 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, + DRM_FORMAT_XRGB8888, I915_TILING_NONE, + strides, offsets, 1, + LOCAL_DRM_MODE_FB_MODIFIERS, + &fb_id[i]) == 0); igt_assert(fb_id[i]); } -- cgit v1.2.3