diff mbox

[i-g-t,v1,3/7] tests/kms_flip: Create tiled BOs only when needed

Message ID 1460979775-21702-4-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso April 18, 2016, 11:42 a.m. UTC
Because attempts to create a tiled BO will cause a igt_require call to
fail on drivers that don't support tiling, do so in the subtest that
actually needs it so that other subtests aren't skipped without reason.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---

 tests/kms_flip.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 3d4454407709..524a8a3c2d14 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1346,13 +1346,16 @@  static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	o->fb_ids[1] = igt_create_fb_with_bo_size(drm_fd, o->fb_width, o->fb_height,
 					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
 					 tiling, &o->fb_info[1], bo_size, 0);
-	o->fb_ids[2] = igt_create_fb(drm_fd, o->fb_width, o->fb_height,
-					 igt_bpp_depth_to_drm_format(o->bpp, o->depth),
-					 LOCAL_I915_FORMAT_MOD_X_TILED, &o->fb_info[2]);
+
 	igt_assert(o->fb_ids[0]);
 	igt_assert(o->fb_ids[1]);
-	if (o->flags & TEST_FB_BAD_TILING)
+
+	if (o->flags & TEST_FB_BAD_TILING) {
+		o->fb_ids[2] = igt_create_fb(drm_fd, o->fb_width, o->fb_height,
+				igt_bpp_depth_to_drm_format(o->bpp, o->depth),
+				LOCAL_I915_FORMAT_MOD_X_TILED, &o->fb_info[2]);
 		igt_require(o->fb_ids[2]);
+	}
 
 	paint_flip_mode(&o->fb_info[0], false);
 	if (!(o->flags & TEST_BO_TOOBIG))