All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit
@ 2017-02-01 13:18 Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

This test case adds TEST_ONLY flag to the following test cases to test
atomic commit correctness.

 - kms_plane_multiple
 - kms_atomic_transitions
 - kms_plane_scaling
 - kms_rotation_crc
 - kms_plane_lowres
 
The test randomly selects one of the above test cases and tests atomic
commit. If the test fails with TEST_ONLY flag the real deal atomic commit
is executed and the outcome is verified.

v2: Add flag to toggle TEST_ONLY for atomic commit.
    Remove DRM_MODE_PAGE_FLIP_EVENT flag, if enabled, before trying atomic
    commit with TEST_ONLY flag (Maarten)

v3: flag to indicate TEST_ONLY selection in igt core
    separate test cases for TEST_ONLY atomic commits (Maarten)

For: VIZ-6956

Mika Kahola (7):
  lib/igt_kms: Add forcing TEST_ONLY for atomic commits
  tests/kms_plane_multiple: Add TEST_ONLY flag
  tests/kms_atomic_transition: Add TEST_ONLY flag
  tests/kms_plane_scaling: Add TEST_ONLY flag
  tests/kms_rotation_crc: Add TEST_ONLY flag
  tests/kms_plane_lowres: Add TEST_ONLY flag
  tests/kms_cursor_legacy: Add TEST_ONLY flag

 lib/igt_kms.c                 |  18 +++-
 lib/igt_kms.h                 |   1 +
 tests/kms_atomic_transition.c |  66 ++++++++++--
 tests/kms_cursor_legacy.c     | 230 +++++++++++++++++++++++++++++++++++++-----
 tests/kms_plane_lowres.c      |  40 +++++++-
 tests/kms_plane_multiple.c    |  35 +++++++
 tests/kms_plane_scaling.c     |  29 ++++--
 tests/kms_rotation_crc.c      | 139 +++++++++++++++++++++++++
 8 files changed, 509 insertions(+), 49 deletions(-)

-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-03-08 14:59   ` Maarten Lankhorst
  2017-02-01 13:18 ` [PATCH i-g-t v3 2/7] tests/kms_plane_multiple: Add TEST_ONLY flag Mika Kahola
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

Add an option to force atomic commits to do commits with TEST_ONLY flag
first before doing the actual commit.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 lib/igt_kms.c | 18 +++++++++++++++++-
 lib/igt_kms.h |  1 +
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 4ba6316..c513ef8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2453,7 +2453,23 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
 		igt_atomic_prepare_connector_commit(output, req);
 	}
 
-	ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+	if (display->force_test_atomic &&
+	    !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
+		unsigned int test_flags = flags & ~DRM_MODE_PAGE_FLIP_EVENT;
+		int test_ret;
+
+		test_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
+
+		test_ret = drmModeAtomicCommit(display->drm_fd, req, test_flags, user_data);
+		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+
+		if (test_ret)
+			igt_assert_eq(test_ret, ret);
+		else
+			igt_assert(ret != -EINVAL);
+	} else
+		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+
 	drmModeAtomicFree(req);
 	return ret;
 
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 2562618..e45fc21 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -338,6 +338,7 @@ struct igt_display {
 	igt_pipe_t *pipes;
 	bool has_cursor_plane;
 	bool is_atomic;
+	bool force_test_atomic;
 };
 
 void igt_display_init(igt_display_t *display, int drm_fd);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 2/7] tests/kms_plane_multiple: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 3/7] tests/kms_atomic_transition: " Mika Kahola
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

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

v2: Use flag to indicate to test with TEST_ONLY flag with atomic
    commit

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_plane_multiple.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index bb84878..2104976 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -412,9 +412,37 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int n_planes,
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
+	igt_subtest_f("atomic-pipe-%s-tiling-x-planes-with-tests",
+		      kmstest_pipe_name(pipe)) {
+		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = true;
+		for (int planes = 0; planes < n_planes; planes++)
+			test_plane_position(data, pipe, true, n_planes,
+				planes, LOCAL_I915_FORMAT_MOD_X_TILED);
+	}
+
+	igt_subtest_f("atomic-pipe-%s-tiling-y-planes-with-tests",
+		      kmstest_pipe_name(pipe)) {
+		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = true;
+		for (int planes = 0; planes < n_planes; planes++)
+			test_plane_position(data, pipe, true, n_planes,
+				planes, LOCAL_I915_FORMAT_MOD_X_TILED);
+	}
+
+	igt_subtest_f("atomic-pipe-%s-tiling-yf-planes-with-tests",
+		      kmstest_pipe_name(pipe)) {
+		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = true;
+		for (int planes = 0; planes < n_planes; planes++)
+			test_plane_position(data, pipe, true, n_planes,
+				planes, LOCAL_I915_FORMAT_MOD_X_TILED);
+	}
+
 	igt_subtest_f("legacy-pipe-%s-tiling-none-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, false,  n_planes,
 				planes, LOCAL_DRM_FORMAT_MOD_NONE);
@@ -423,6 +451,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("atomic-pipe-%s-tiling-none-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, true, n_planes,
 				planes,	LOCAL_I915_FORMAT_MOD_X_TILED);
@@ -431,6 +460,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("legacy-pipe-%s-tiling-x-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, false, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_X_TILED);
@@ -439,6 +469,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("atomic-pipe-%s-tiling-x-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, true, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_X_TILED);
@@ -447,6 +478,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("legacy-pipe-%s-tiling-y-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, false, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_Y_TILED);
@@ -455,6 +487,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("atomic-pipe-%s-tiling-y-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, true, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_Y_TILED);
@@ -463,6 +496,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("legacy-pipe-%s-tiling-yf-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, false, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_Yf_TILED);
@@ -471,6 +505,7 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 	igt_subtest_f("atomic-pipe-%s-tiling-yf-planes",
 		      kmstest_pipe_name(pipe)) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		data->display.force_test_atomic = false;
 		for (int planes = 0; planes < n_planes; planes++)
 			test_plane_position(data, pipe, true, n_planes,
 				planes, LOCAL_I915_FORMAT_MOD_Yf_TILED);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 3/7] tests/kms_atomic_transition: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 2/7] tests/kms_plane_multiple: Add TEST_ONLY flag Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 4/7] tests/kms_plane_scaling: " Mika Kahola
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

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

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_atomic_transition.c | 66 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 56 insertions(+), 10 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 5fdb617..a1fa5b9 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -670,28 +670,74 @@ igt_main
 		igt_require_f(valid_outputs, "no valid crtc/connector combinations found\n");
 	}
 
-	igt_subtest("plane-all-transition")
+	igt_subtest("plane-all-transition") {
+		display.force_test_atomic = false;
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false);
+	}
+
+	igt_subtest("plane-all-transition-with-test") {
+		display.force_test_atomic = true;
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, false);
+	}
+
+	igt_subtest("plane-all-transition-nonblocking") {
+		display.force_test_atomic = false;
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true);
+	}
+
+	igt_subtest("plane-all-transition-nonblocking-with-test") {
+		display.force_test_atomic = true;
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_PLANES, true);
+	}
+
+	igt_subtest("plane-all-modeset-transition") {
+		display.force_test_atomic = false;
+		for_each_pipe_with_valid_output(&display, pipe, output)
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false);
+	}
 
-	igt_subtest("plane-all-transition-nonblocking")
+	igt_subtest("plane-all-modeset-transition-with-test") {
+		display.force_test_atomic = true;
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_PLANES, true);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET, false);
+	}
 
-	igt_subtest("plane-all-modeset-transition")
+	igt_subtest("plane-toggle-modeset-transition") {
+		display.force_test_atomic = false;
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_MODESET, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false);
+	}
 
-	igt_subtest("plane-toggle-modeset-transition")
+	igt_subtest("plane-toggle-modeset-transition-with-test") {
+		display.force_test_atomic = true;
 		for_each_pipe_with_valid_output(&display, pipe, output)
-			run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false);
+		        run_transition_test(&display, pipe, output, TRANSITION_MODESET_DISABLE, false);
+	}
 
 	for (i = 1; i <= I915_MAX_PIPES; i++) {
-		igt_subtest_f("%ix-modeset-transitions", i)
+		igt_subtest_f("%ix-modeset-transitions", i) {
+			display.force_test_atomic = false;
+			run_modeset_transition(&display, i, false);
+		}
+
+		igt_subtest_f("%ix-modeset-transitions-with-test", i) {
+			display.force_test_atomic = true;
 			run_modeset_transition(&display, i, false);
+		}
+
+		igt_subtest_f("%ix-modeset-transitions-nonblocking", i) {
+			display.force_test_atomic = false;
+			run_modeset_transition(&display, i, true);
+		}
 
-		igt_subtest_f("%ix-modeset-transitions-nonblocking", i)
+		igt_subtest_f("%ix-modeset-transitions-nonblocking-with-test", i) {
+			display.force_test_atomic = true;
 			run_modeset_transition(&display, i, true);
+		}
 	}
 
 	igt_fixture {
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 4/7] tests/kms_plane_scaling: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
                   ` (2 preceding siblings ...)
  2017-02-01 13:18 ` [PATCH i-g-t v3 3/7] tests/kms_atomic_transition: " Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 5/7] tests/kms_rotation_crc: " Mika Kahola
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

Add TEST_ONLY flag to test atomic scaling without
actually committing the changes.

v2: Create subtests with TEST_ONLY flag and one without

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

diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
index 18ba86c..4e0d16d 100644
--- a/tests/kms_plane_scaling.c
+++ b/tests/kms_plane_scaling.c
@@ -310,21 +310,34 @@ 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();
+		igt_display_init(&data.display, data.drm_fd);
+		data.devid = intel_get_drm_devid(data.drm_fd);
 
-	data.drm_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc();
-	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.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+	igt_subtest("force-atomic-test") {
+		data.display.force_test_atomic = true;
+		test_plane_scaling(&data);
+	}
 
-	test_plane_scaling(&data);
+	igt_subtest("normal") {
+		data.display.force_test_atomic = false;
+		test_plane_scaling(&data);
+	}
+
+	igt_fixture {
+		igt_display_fini(&data.display);
+	}
 
-	igt_display_fini(&data.display);
+	igt_exit();
 }
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 5/7] tests/kms_rotation_crc: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
                   ` (3 preceding siblings ...)
  2017-02-01 13:18 ` [PATCH i-g-t v3 4/7] tests/kms_plane_scaling: " Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 6/7] tests/kms_plane_lowres: " Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 7/7] tests/kms_cursor_legacy: " Mika Kahola
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

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

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_rotation_crc.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 9bfcde3..2d2606d 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -522,46 +522,109 @@ igt_main
 		igt_display_init(&data.display, data.gfx_fd);
 	}
 	igt_subtest_f("primary-rotation-180") {
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_180;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("primary-rotation-180-with-test") {
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_180;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
 	igt_subtest_f("sprite-rotation-180") {
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_180;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+	}
+
+	igt_subtest_f("sprite-rotation-180-with-test") {
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_180;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
 	}
 
 	igt_subtest_f("cursor-rotation-180") {
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_180;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_CURSOR);
+	}
+
+	igt_subtest_f("cursor-rotation-180-with-test") {
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_180;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_CURSOR);
 	}
 
 	igt_subtest_f("primary-rotation-90") {
 		igt_require(gen >= 9);
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_90;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("primary-rotation-90-with-test") {
+		igt_require(gen >= 9);
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_90;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
 	igt_subtest_f("primary-rotation-270") {
 		igt_require(gen >= 9);
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_270;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("primary-rotation-270-with-test") {
+		igt_require(gen >= 9);
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_270;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
 	igt_subtest_f("sprite-rotation-90") {
 		igt_require(gen >= 9);
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_90;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+	}
+
+	igt_subtest_f("sprite-rotation-90-with-test") {
+		igt_require(gen >= 9);
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_90;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
 	}
 
 	igt_subtest_f("sprite-rotation-270") {
 		igt_require(gen >= 9);
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_270;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+	}
+
+	igt_subtest_f("sprite-rotation-270-with-test") {
+		igt_require(gen >= 9);
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_270;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
 	}
 
 	igt_subtest_f("sprite-rotation-90-pos-100-0") {
 		igt_require(gen >= 9);
+		data.display.force_test_atomic = false;
+		data.rotation = IGT_ROTATION_90;
+		data.pos_x = 100,
+		data.pos_y = 0;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+	}
+
+	igt_subtest_f("sprite-rotation-90-pos-100-0-with-test") {
+		igt_require(gen >= 9);
+		data.display.force_test_atomic = true;
 		data.rotation = IGT_ROTATION_90;
 		data.pos_x = 100,
 		data.pos_y = 0;
@@ -574,6 +637,17 @@ igt_main
 		data.pos_y = 0;
 		data.rotation = IGT_ROTATION_90;
 		data.override_fmt = DRM_FORMAT_RGB565;
+		data.display.force_test_atomic = false;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("bad-pixel-format-with-test") {
+		igt_require(gen >= 9);
+		data.pos_x = 0,
+		data.pos_y = 0;
+		data.rotation = IGT_ROTATION_90;
+		data.override_fmt = DRM_FORMAT_RGB565;
+		data.display.force_test_atomic = true;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
@@ -582,6 +656,16 @@ igt_main
 		data.override_fmt = 0;
 		data.rotation = IGT_ROTATION_90;
 		data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE;
+		data.display.force_test_atomic = false;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("bad-tiling-with-test") {
+		igt_require(gen >= 9);
+		data.override_fmt = 0;
+		data.rotation = IGT_ROTATION_90;
+		data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE;
+		data.display.force_test_atomic = true;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
@@ -590,6 +674,16 @@ igt_main
 		data.override_tiling = 0;
 		data.flip_stress = 60;
 		data.rotation = IGT_ROTATION_90;
+		data.display.force_test_atomic = false;
+		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
+	}
+
+	igt_subtest_f("primary-rotation-90-flip-stress-with-test") {
+		igt_require(gen >= 9);
+		data.override_tiling = 0;
+		data.flip_stress = 60;
+		data.rotation = IGT_ROTATION_90;
+		data.display.force_test_atomic = true;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
 
@@ -600,6 +694,28 @@ igt_main
 
 		igt_require(gen >= 9);
 		data.rotation = IGT_ROTATION_90;
+		data.display.force_test_atomic = false;
+
+		for_each_pipe_with_valid_output(&data.display, pipe, output) {
+			igt_output_set_pipe(output, pipe);
+
+			test_plane_rotation_ytiled_obj(&data, output, DRM_PLANE_TYPE_PRIMARY);
+
+			valid_tests++;
+			break;
+		}
+
+		igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+	}
+
+	igt_subtest_f("primary-rotation-90-Y-tiled-with-test") {
+		enum pipe pipe;
+		igt_output_t *output;
+		int valid_tests = 0;
+
+		igt_require(gen >= 9);
+		data.rotation = IGT_ROTATION_90;
+		data.display.force_test_atomic = true;
 
 		for_each_pipe_with_valid_output(&data.display, pipe, output) {
 			igt_output_set_pipe(output, pipe);
@@ -620,6 +736,29 @@ igt_main
 
 		igt_require(gen >= 9);
 
+		data.display.force_test_atomic = false;
+
+		for_each_pipe_with_valid_output(&data.display, pipe, output) {
+			igt_output_set_pipe(output, pipe);
+
+			test_plane_rotation_exhaust_fences(&data, output, DRM_PLANE_TYPE_PRIMARY);
+
+			valid_tests++;
+			break;
+		}
+
+		igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+	}
+
+	igt_subtest_f("exhaust-fences-with-test") {
+		enum pipe pipe;
+		igt_output_t *output;
+		int valid_tests = 0;
+
+		igt_require(gen >= 9);
+
+		data.display.force_test_atomic = true;
+
 		for_each_pipe_with_valid_output(&data.display, pipe, output) {
 			igt_output_set_pipe(output, pipe);
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 6/7] tests/kms_plane_lowres: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
                   ` (4 preceding siblings ...)
  2017-02-01 13:18 ` [PATCH i-g-t v3 5/7] tests/kms_rotation_crc: " Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  2017-02-01 13:18 ` [PATCH i-g-t v3 7/7] tests/kms_cursor_legacy: " Mika Kahola
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

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

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_plane_lowres.c | 40 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 689c248..c23660f 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -320,21 +320,53 @@ test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier)
 static void
 run_tests_for_pipe(data_t *data, enum pipe pipe)
 {
+	igt_subtest_f("pipe-%s-tiling-none-with-test",
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = true;
+		test_plane_position(data, pipe, LOCAL_DRM_FORMAT_MOD_NONE);
+	}
+
 	igt_subtest_f("pipe-%s-tiling-none",
-		      kmstest_pipe_name(pipe))
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = false;
 		test_plane_position(data, pipe, LOCAL_DRM_FORMAT_MOD_NONE);
+	}
+
+	igt_subtest_f("pipe-%s-tiling-x-with-test",
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = true;
+		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_X_TILED);
+	}
 
 	igt_subtest_f("pipe-%s-tiling-x",
-		      kmstest_pipe_name(pipe))
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = false;
 		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_X_TILED);
+	}
+
+	igt_subtest_f("pipe-%s-tiling-y-with-test",
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = true;
+		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Y_TILED);
+	}
 
 	igt_subtest_f("pipe-%s-tiling-y",
-		      kmstest_pipe_name(pipe))
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = false;
 		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Y_TILED);
+	}
+
+	igt_subtest_f("pipe-%s-tiling-yf-with-test",
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = true;
+		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Yf_TILED);
+	}
 
 	igt_subtest_f("pipe-%s-tiling-yf",
-		      kmstest_pipe_name(pipe))
+		      kmstest_pipe_name(pipe)) {
+		data->display.force_test_atomic = false;
 		test_plane_position(data, pipe, LOCAL_I915_FORMAT_MOD_Yf_TILED);
+	}
 }
 
 static data_t data;
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t v3 7/7] tests/kms_cursor_legacy: Add TEST_ONLY flag
  2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
                   ` (5 preceding siblings ...)
  2017-02-01 13:18 ` [PATCH i-g-t v3 6/7] tests/kms_plane_lowres: " Mika Kahola
@ 2017-02-01 13:18 ` Mika Kahola
  6 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-02-01 13:18 UTC (permalink / raw)
  To: intel-gfx

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

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_cursor_legacy.c | 230 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 204 insertions(+), 26 deletions(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index c7083a0..97adf8c 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1441,53 +1441,165 @@ igt_main
 	igt_subtest("all-pipes-torture-move")
 		stress(&display, -1, -ncpus, DRM_MODE_CURSOR_MOVE, 20);
 
-	igt_subtest("nonblocking-modeset-vs-cursor-atomic")
+	igt_subtest("nonblocking-modeset-vs-cursor-atomic") {
+		display.force_test_atomic = false;
 		nonblocking_modeset_vs_cursor(&display, 1);
+	}
+
+	igt_subtest("nonblocking-modeset-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
+		nonblocking_modeset_vs_cursor(&display, 1);
+	}
 
-	igt_subtest("long-nonblocking-modeset-vs-cursor-atomic")
+	igt_subtest("long-nonblocking-modeset-vs-cursor-atomic") {
+		display.force_test_atomic = false;
 		nonblocking_modeset_vs_cursor(&display, 16);
+	}
 
-	igt_subtest("2x-flip-vs-cursor-legacy")
+	igt_subtest("long-nonblocking-modeset-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
+		nonblocking_modeset_vs_cursor(&display, 16);
+	}
+
+	igt_subtest("2x-flip-vs-cursor-legacy") {
+		display.force_test_atomic = false;
+		two_screens_flip_vs_cursor(&display, 8, false, false);
+	}
+
+	igt_subtest("2x-flip-vs-cursor-legacy-with-test") {
+		display.force_test_atomic = true;
 		two_screens_flip_vs_cursor(&display, 8, false, false);
+	}
+
+	igt_subtest("2x-flip-vs-cursor-atomic") {
+		display.force_test_atomic = false;
+		two_screens_flip_vs_cursor(&display, 4, false, true);
+	}
 
-	igt_subtest("2x-flip-vs-cursor-atomic")
+	igt_subtest("2x-flip-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
 		two_screens_flip_vs_cursor(&display, 4, false, true);
+	}
 
-	igt_subtest("2x-cursor-vs-flip-legacy")
+	igt_subtest("2x-cursor-vs-flip-legacy") {
+		display.force_test_atomic = false;
 		two_screens_cursor_vs_flip(&display, 8, false);
+	}
+
+	igt_subtest("2x-cursor-vs-flip-legacy-with-test") {
+		display.force_test_atomic = true;
+		two_screens_cursor_vs_flip(&display, 8, false);
+	}
 
-	igt_subtest("2x-long-flip-vs-cursor-legacy")
+	igt_subtest("2x-long-flip-vs-cursor-legacy") {
+		display.force_test_atomic = false;
 		two_screens_flip_vs_cursor(&display, 150, false, false);
+	}
+
+	igt_subtest("2x-long-flip-vs-cursor-legacy-with-test") {
+		display.force_test_atomic = true;
+		two_screens_flip_vs_cursor(&display, 150, false, false);
+	}
+
+	igt_subtest("2x-long-flip-vs-cursor-atomic") {
+		display.force_test_atomic = false;
+		two_screens_flip_vs_cursor(&display, 150, false, true);
+	}
 
-	igt_subtest("2x-long-flip-vs-cursor-atomic")
+	igt_subtest("2x-long-flip-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
 		two_screens_flip_vs_cursor(&display, 150, false, true);
+	}
 
-	igt_subtest("2x-long-cursor-vs-flip-legacy")
+	igt_subtest("2x-long-cursor-vs-flip-legacy") {
+		display.force_test_atomic = false;
 		two_screens_cursor_vs_flip(&display, 50, false);
+	}
 
-	igt_subtest("2x-nonblocking-modeset-vs-cursor-atomic")
+	igt_subtest("2x-long-cursor-vs-flip-legacy-with-test") {
+		display.force_test_atomic = true;
+		two_screens_cursor_vs_flip(&display, 50, false);
+	}
+
+	igt_subtest("2x-nonblocking-modeset-vs-cursor-atomic") {
+		display.force_test_atomic = false;
 		two_screens_flip_vs_cursor(&display, 8, true, true);
+	}
+
+	igt_subtest("2x-nonblocking-modeset-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
+		two_screens_flip_vs_cursor(&display, 8, true, true);
+	}
+
+	igt_subtest("2x-cursor-vs-flip-atomic") {
+		display.force_test_atomic = false;
+		two_screens_cursor_vs_flip(&display, 8, true);
+	}
 
-	igt_subtest("2x-cursor-vs-flip-atomic")
+	igt_subtest("2x-cursor-vs-flip-atomic-with-test") {
+		display.force_test_atomic = true;
 		two_screens_cursor_vs_flip(&display, 8, true);
+	}
 
-	igt_subtest("2x-long-nonblocking-modeset-vs-cursor-atomic")
+	igt_subtest("2x-long-nonblocking-modeset-vs-cursor-atomic") {
+		display.force_test_atomic = false;
 		two_screens_flip_vs_cursor(&display, 150, true, true);
+	}
 
-	igt_subtest("2x-long-cursor-vs-flip-atomic")
+	igt_subtest("2x-long-nonblocking-modeset-vs-cursor-atomic-with-test") {
+		display.force_test_atomic = true;
+		two_screens_flip_vs_cursor(&display, 150, true, true);
+	}
+
+	igt_subtest("2x-long-cursor-vs-flip-atomic") {
+		display.force_test_atomic = false;
 		two_screens_cursor_vs_flip(&display, 50, true);
+	}
 
-	igt_subtest("flip-vs-cursor-crc-legacy")
+	igt_subtest("2x-long-cursor-vs-flip-atomic-with-test") {
+		display.force_test_atomic = true;
+		two_screens_cursor_vs_flip(&display, 50, true);
+	}
+
+	igt_subtest("flip-vs-cursor-crc-legacy") {
+		display.force_test_atomic = false;
+		flip_vs_cursor_crc(&display, false);
+	}
+
+	igt_subtest("flip-vs-cursor-crc-legacy-with-test") {
+		display.force_test_atomic = true;
 		flip_vs_cursor_crc(&display, false);
+	}
 
-	igt_subtest("flip-vs-cursor-crc-atomic")
+	igt_subtest("flip-vs-cursor-crc-atomic") {
+		display.force_test_atomic = false;
 		flip_vs_cursor_crc(&display, true);
+	}
+
+	igt_subtest("flip-vs-cursor-crc-atomic-with-test") {
+		display.force_test_atomic = true;
+		flip_vs_cursor_crc(&display, true);
+	}
 
-	igt_subtest("flip-vs-cursor-busy-crc-legacy")
+	igt_subtest("flip-vs-cursor-busy-crc-legacy") {
+		display.force_test_atomic = false;
 		flip_vs_cursor_busy_crc(&display, false);
+	}
 
-	igt_subtest("flip-vs-cursor-busy-crc-atomic")
+	igt_subtest("flip-vs-cursor-busy-crc-legacy-with-test") {
+		display.force_test_atomic = true;
+		flip_vs_cursor_busy_crc(&display, false);
+	}
+
+	igt_subtest("flip-vs-cursor-busy-crc-atomic") {
+		display.force_test_atomic = false;
+		flip_vs_cursor_busy_crc(&display, true);
+	}
+
+	igt_subtest("flip-vs-cursor-busy-crc-atomic-with-test") {
+		display.force_test_atomic = true;
 		flip_vs_cursor_busy_crc(&display, true);
+	}
 
 	for (i = 0; i <= flip_test_last; i++) {
 		const char *modes[flip_test_last+1] = {
@@ -1509,33 +1621,99 @@ igt_main
 		default: break;
 		}
 
-		igt_subtest_f("%sflip-before-cursor-%s", prefix, modes[i])
+		igt_subtest_f("%sflip-before-cursor-%s", prefix, modes[i]) {
+			display.force_test_atomic = false;
+			basic_flip_cursor(&display, i, FLIP_BEFORE_CURSOR, 0);
+		}
+
+		igt_subtest_f("%sflip-before-cursor-%s-with-test", prefix, modes[i]) {
+			display.force_test_atomic = true;
 			basic_flip_cursor(&display, i, FLIP_BEFORE_CURSOR, 0);
+		}
 
-		if (!cursor_slowpath(i))
-			igt_subtest_f("%sbusy-flip-before-cursor-%s", prefix, modes[i])
+		if (!cursor_slowpath(i)) {
+			igt_subtest_f("%sbusy-flip-before-cursor-%s", prefix, modes[i]) {
+				display.force_test_atomic = false;
 				basic_flip_cursor(&display, i, FLIP_BEFORE_CURSOR,
 						  BASIC_BUSY);
+			}
 
-		igt_subtest_f("%sflip-after-cursor-%s", prefix, modes[i])
+			igt_subtest_f("%sbusy-flip-before-cursor-%s-with-test", prefix, modes[i]) {
+				display.force_test_atomic = true;
+				basic_flip_cursor(&display, i, FLIP_BEFORE_CURSOR,
+						  BASIC_BUSY);
+			}
+		}
+
+		igt_subtest_f("%sflip-after-cursor-%s", prefix, modes[i]) {
+			display.force_test_atomic = false;
+			basic_flip_cursor(&display, i, FLIP_AFTER_CURSOR, 0);
+		}
+
+		igt_subtest_f("%sflip-after-cursor-%s-with-test", prefix, modes[i]) {
+			display.force_test_atomic = true;
 			basic_flip_cursor(&display, i, FLIP_AFTER_CURSOR, 0);
+		}
 
-		igt_subtest_f("flip-vs-cursor-%s", modes[i])
+		igt_subtest_f("flip-vs-cursor-%s", modes[i]) {
+			display.force_test_atomic = false;
 			flip_vs_cursor(&display, i, 150);
-		igt_subtest_f("cursor-vs-flip-%s", modes[i])
+		}
+
+		igt_subtest_f("flip-vs-cursor-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
+			flip_vs_cursor(&display, i, 150);
+		}
+
+		igt_subtest_f("cursor-vs-flip-%s", modes[i]) {
+			display.force_test_atomic = false;
 			cursor_vs_flip(&display, i, 50);
+		}
 
-		igt_subtest_f("cursorA-vs-flipA-%s", modes[i])
+		igt_subtest_f("cursor-vs-flip-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
+			cursor_vs_flip(&display, i, 50);
+		}
+
+		igt_subtest_f("cursorA-vs-flipA-%s", modes[i]) {
+			display.force_test_atomic = false;
+			flip(&display, 0, 0, 10, i);
+		}
+
+		igt_subtest_f("cursorA-vs-flipA-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
 			flip(&display, 0, 0, 10, i);
+		}
 
-		igt_subtest_f("cursorA-vs-flipB-%s", modes[i])
+		igt_subtest_f("cursorA-vs-flipB-%s", modes[i]) {
+			display.force_test_atomic = false;
 			flip(&display, 0, 1, 10, i);
+		}
+
+		igt_subtest_f("cursorA-vs-flipB-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
+			flip(&display, 0, 1, 10, i);
+		}
+
+		igt_subtest_f("cursorB-vs-flipA-%s", modes[i]) {
+			display.force_test_atomic = false;
+			flip(&display, 1, 0, 10, i);
+		}
 
-		igt_subtest_f("cursorB-vs-flipA-%s", modes[i])
+		igt_subtest_f("cursorB-vs-flipA-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
 			flip(&display, 1, 0, 10, i);
+		}
+
+		igt_subtest_f("cursorB-vs-flipB-%s", modes[i]) {
+			display.force_test_atomic = false;
+			flip(&display, 1, 1, 10, i);
+		}
 
-		igt_subtest_f("cursorB-vs-flipB-%s", modes[i])
+		igt_subtest_f("cursorB-vs-flipB-%s-with-test", modes[i]) {
+			display.force_test_atomic = true;
 			flip(&display, 1, 1, 10, i);
+		}
 	}
 
 	igt_fixture {
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits
  2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
@ 2017-03-08 14:59   ` Maarten Lankhorst
  2017-03-23 12:31     ` Mika Kahola
  0 siblings, 1 reply; 10+ messages in thread
From: Maarten Lankhorst @ 2017-03-08 14:59 UTC (permalink / raw)
  To: Mika Kahola, intel-gfx

Op 01-02-17 om 14:18 schreef Mika Kahola:
> Add an option to force atomic commits to do commits with TEST_ONLY flag
> first before doing the actual commit.
>
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  lib/igt_kms.c | 18 +++++++++++++++++-
>  lib/igt_kms.h |  1 +
>  2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 4ba6316..c513ef8 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2453,7 +2453,23 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
>  		igt_atomic_prepare_connector_commit(output, req);
>  	}
>  
> -	ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
> +	if (display->force_test_atomic &&
> +	    !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
> +		unsigned int test_flags = flags & ~DRM_MODE_PAGE_FLIP_EVENT;
> +		int test_ret;
> +
> +		test_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
> +
> +		test_ret = drmModeAtomicCommit(display->drm_fd, req, test_flags, user_data);
> +		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
> +
> +		if (test_ret)
> +			igt_assert_eq(test_ret, ret);
> +		else
> +			igt_assert(ret != -EINVAL);
> +	} else
> +		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
> +
>  	drmModeAtomicFree(req);
>  	return ret;
>  
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 2562618..e45fc21 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -338,6 +338,7 @@ struct igt_display {
>  	igt_pipe_t *pipes;
>  	bool has_cursor_plane;
>  	bool is_atomic;
> +	bool force_test_atomic;
>  };
>  
>  void igt_display_init(igt_display_t *display, int drm_fd);

Sorry, didn't notice it before but force_test_atomic is a big behavioral switch that
might force other tests to potentially fail. If this a subtest fails and the flag is
not explictly cleared. This is also why you need to set it separately even if false.

I really wish there was a igt_subtest_exit_handler, I could remove a lot of boilerplate in the KMS tests with that.

My personal wishlist for it:
- Complete all sw_sync fences
- Remove all allocated pipe_crc's, so next test won't fail due to fd already being assigned.
- Clean igt_display_t with a synchronous commit.
- Clear any pending drm events without blocking.
- Remove any leftover framebuffers allocated in the subtest. This may fail if fb's become
  invalid, like in the kms_rmfb test.

Be careful with dereferencing fb's, the previous pointer may not be valid any more if it
was allocated on the stack. It should probably require an extra memory allocation during
fb alloc to keep track.

This would allow us to kill most of the teardown boilerplate in igt kms tests, and increases
reliability when a subtest fails, the next subtest is a lot more likely to succeed.

~Maarten

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits
  2017-03-08 14:59   ` Maarten Lankhorst
@ 2017-03-23 12:31     ` Mika Kahola
  0 siblings, 0 replies; 10+ messages in thread
From: Mika Kahola @ 2017-03-23 12:31 UTC (permalink / raw)
  To: Maarten Lankhorst, intel-gfx

On Wed, 2017-03-08 at 15:59 +0100, Maarten Lankhorst wrote:
> Op 01-02-17 om 14:18 schreef Mika Kahola:
> > 
> > Add an option to force atomic commits to do commits with TEST_ONLY
> > flag
> > first before doing the actual commit.
> > 
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > ---
> >  lib/igt_kms.c | 18 +++++++++++++++++-
> >  lib/igt_kms.h |  1 +
> >  2 files changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 4ba6316..c513ef8 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -2453,7 +2453,23 @@ static int igt_atomic_commit(igt_display_t
> > *display, uint32_t flags, void *user_
> >  		igt_atomic_prepare_connector_commit(output, req);
> >  	}
> >  
> > -	ret = drmModeAtomicCommit(display->drm_fd, req, flags,
> > user_data);
> > +	if (display->force_test_atomic &&
> > +	    !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
> > +		unsigned int test_flags = flags &
> > ~DRM_MODE_PAGE_FLIP_EVENT;
> > +		int test_ret;
> > +
> > +		test_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
> > +
> > +		test_ret = drmModeAtomicCommit(display->drm_fd,
> > req, test_flags, user_data);
> > +		ret = drmModeAtomicCommit(display->drm_fd, req,
> > flags, user_data);
> > +
> > +		if (test_ret)
> > +			igt_assert_eq(test_ret, ret);
> > +		else
> > +			igt_assert(ret != -EINVAL);
> > +	} else
> > +		ret = drmModeAtomicCommit(display->drm_fd, req,
> > flags, user_data);
> > +
> >  	drmModeAtomicFree(req);
> >  	return ret;
> >  
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 2562618..e45fc21 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -338,6 +338,7 @@ struct igt_display {
> >  	igt_pipe_t *pipes;
> >  	bool has_cursor_plane;
> >  	bool is_atomic;
> > +	bool force_test_atomic;
> >  };
> >  
> >  void igt_display_init(igt_display_t *display, int drm_fd);
> Sorry, didn't notice it before but force_test_atomic is a big
> behavioral switch that
> might force other tests to potentially fail. If this a subtest fails
> and the flag is
> not explictly cleared. This is also why you need to set it separately
> even if false.
So for this test it would be adequate if we clear this flag in case of
error? I'll spin another round of this patch series. It also requires
some rebasing too.

> 
> I really wish there was a igt_subtest_exit_handler, I could remove a
> lot of boilerplate in the KMS tests with that.
> 
> My personal wishlist for it:
> - Complete all sw_sync fences
> - Remove all allocated pipe_crc's, so next test won't fail due to fd
> already being assigned.
> - Clean igt_display_t with a synchronous commit.
> - Clear any pending drm events without blocking.
> - Remove any leftover framebuffers allocated in the subtest. This may
> fail if fb's become
>   invalid, like in the kms_rmfb test.
> 
This would be nice. Asserts may leave things in unstable state.

> Be careful with dereferencing fb's, the previous pointer may not be
> valid any more if it
> was allocated on the stack. It should probably require an extra
> memory allocation during
> fb alloc to keep track.
> 
> This would allow us to kill most of the teardown boilerplate in igt
> kms tests, and increases
> reliability when a subtest fails, the next subtest is a lot more
> likely to succeed.
> 
> ~Maarten
> 
-- 
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-23 12:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 13:18 [PATCH i-g-t v3 0/7] Validate TEST_ONLY correctness against full atomic commit Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 1/7] lib/igt_kms: Add forcing TEST_ONLY for atomic commits Mika Kahola
2017-03-08 14:59   ` Maarten Lankhorst
2017-03-23 12:31     ` Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 2/7] tests/kms_plane_multiple: Add TEST_ONLY flag Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 3/7] tests/kms_atomic_transition: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 4/7] tests/kms_plane_scaling: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 5/7] tests/kms_rotation_crc: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 6/7] tests/kms_plane_lowres: " Mika Kahola
2017-02-01 13:18 ` [PATCH i-g-t v3 7/7] tests/kms_cursor_legacy: " Mika Kahola

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.