[Intel-gfx] [PATCH i-g-t v4 3/7] tests/kms_atomic_transition: Add TEST_ONLY flag

Mika Kahola mika.kahola at intel.com
Thu Mar 23 12:48:27 UTC 2017


Add TEST_ONLY flag to test atomic transition display commits without
actual real-life commit.

v2: use flag to force atomic commit with TEST_ONLY flag
v3: Rebase

Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
 tests/kms_atomic_transition.c | 72 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 13 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 70bff20..466280e 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -397,7 +397,8 @@ static void atomic_commit(igt_display_t *display, enum pipe pipe, unsigned int f
  */
 static void
 run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output,
-		enum transition_type type, bool nonblocking, bool fencing)
+		    enum transition_type type, bool nonblocking, bool fencing,
+		    bool force_test_atomic)
 {
 	struct igt_fb fb, argb_fb, sprite_fb;
 	drmModeModeInfo *mode, override_mode;
@@ -408,6 +409,8 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 	unsigned flags = DRM_MODE_PAGE_FLIP_EVENT;
 	int ret;
 
+	display->force_test_atomic = force_test_atomic;
+
 	if (fencing)
 		prepare_fencing(display, pipe);
 
@@ -782,12 +785,15 @@ cleanup:
 
 }
 
-static void run_modeset_transition(igt_display_t *display, int requested_outputs, bool nonblocking, bool fencing)
+static void run_modeset_transition(igt_display_t *display, int requested_outputs,
+				   bool nonblocking, bool fencing, bool force_test_atomic)
 {
 	igt_output_t *outputs[I915_MAX_PIPES] = {};
 	int num_outputs = 0;
 	enum pipe pipe;
 
+	display->force_test_atomic = force_test_atomic;
+
 	for_each_pipe(display, pipe) {
 		igt_output_t *output;
 
@@ -845,44 +851,84 @@ igt_main
 
 	igt_subtest("plane-all-transition")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, false, false);
+
+	igt_subtest("plane-all-transition-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, false, true);
 
 	igt_subtest("plane-all-transition-fencing")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, true);
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, true, false);
+
+	igt_subtest("plane-all-transition-fencing-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false, true, true);
 
 	igt_subtest("plane-all-transition-nonblocking")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, false, false);
+
+	igt_subtest("plane-all-transition-nonblocking-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, false, true);
 
 	igt_subtest("plane-all-transition-nonblocking-fencing")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, true);
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, true, false);
+
+	igt_subtest("plane-all-transition-nonblocking-fencing-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true, true, true);
 
 	igt_subtest("plane-all-modeset-transition")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, false, false);
+
+	igt_subtest("plane-all-modeset-transition-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, false, true);
 
 	igt_subtest("plane-all-modeset-transition-fencing")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, true);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, true, false);
+
+	igt_subtest("plane-all-modeset-transition-fencing-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false, true, true);
 
 	igt_subtest("plane-toggle-modeset-transition")
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false, false, false);
+
+	igt_subtest("plane-toggle-modeset-transition-with-test")
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false, false, true);
 
 	for (i = 1; i <= I915_MAX_PIPES; i++) {
 		igt_subtest_f("%ix-modeset-transitions", i)
-			run_modeset_transition(&display, i, false, false);
+			run_modeset_transition(&display, i, false, false, false);
+
+		igt_subtest_f("%ix-modeset-transitions-with-test", i)
+			run_modeset_transition(&display, i, false, false, true);
 
 		igt_subtest_f("%ix-modeset-transitions-nonblocking", i)
-			run_modeset_transition(&display, i, true, false);
+			run_modeset_transition(&display, i, true, false, false);
+
+		igt_subtest_f("%ix-modeset-transitions-nonblocking-with-test", i)
+			run_modeset_transition(&display, i, true, false, true);
 
 		igt_subtest_f("%ix-modeset-transitions-fencing", i)
-			run_modeset_transition(&display, i, false, true);
+			run_modeset_transition(&display, i, false, true, false);
+
+		igt_subtest_f("%ix-modeset-transitions-fencing-with-test", i)
+			run_modeset_transition(&display, i, false, true, true);
 
 		igt_subtest_f("%ix-modeset-transitions-nonblocking-fencing", i)
-			run_modeset_transition(&display, i, true, true);
+			run_modeset_transition(&display, i, true, true, false);
+
+		igt_subtest_f("%ix-modeset-transitions-nonblocking-fencing-with-test", i)
+			run_modeset_transition(&display, i, true, true, true);
 	}
 
 	igt_fixture {
-- 
2.7.4



More information about the Intel-gfx mailing list