diff mbox

[i-g-t,v4,4/7] tests/kms_plane_scaling: Add TEST_ONLY flag

Message ID 1490273311-9794-6-git-send-email-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kahola March 23, 2017, 12:48 p.m. UTC
Add TEST_ONLY flag to test atomic scaling without
actually committing the changes.

v2: Create subtests with TEST_ONLY flag and one without
v3: Rename subtest 'force-atomic-test' as 'with-atomic-test'

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_plane_scaling.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 1457894..8db91c3 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -310,21 +310,33 @@  static void test_plane_scaling(data_t *d)
 	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }
 
-igt_simple_main
+igt_main
 {
 	data_t data = {};
 
 	igt_skip_on_simulation();
 
+	igt_fixture {
+		data.drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_pipe_crc(data.drm_fd);
+		igt_display_init(&data.display, data.drm_fd);
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+	}
 
-	data.drm_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc(data.drm_fd);
-	igt_display_init(&data.display, data.drm_fd);
-	data.devid = intel_get_drm_devid(data.drm_fd);
+	igt_subtest("with-atomic-test") {
+		data.display.force_test_atomic = true;
+		test_plane_scaling(&data);
+	}
 
-	data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+	igt_subtest("normal") {
+		data.display.force_test_atomic = false;
+		test_plane_scaling(&data);
+	}
 
-	test_plane_scaling(&data);
+	igt_fixture {
+		igt_display_fini(&data.display);
+	}
 
-	igt_display_fini(&data.display);
+	igt_exit();
 }