[igt-dev] [PATCH i-g-t 06/12] tests/kms_rotation_crc: Fix bad-tiling testcase.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Feb 6 10:14:11 UTC 2018


bad-tiling test didn't work, LOCAL_DRM_FORMAT_MODE_NONE == 0, so
the fb was created with tiling = Y, but because test_bad_format
was set but override_tiling wasn't, we fell through to the success
case. Always assume failure if test_bad_format is set, and pass X
tiled for fb, so the format override works.

Also clear variables after subtests in main, so if the next subtest
doesn't run we still clear the variables.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 tests/kms_rotation_crc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 4f56d3d65db4..37e911846c88 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -411,7 +411,7 @@ static void __test_plane_rotation(data_t *data, int plane_type, bool test_bad_fo
 				igt_plane_set_size(plane, data->fb.height, data->fb.width);
 
 			ret = igt_display_try_commit2(display, commit);
-			if (test_bad_format && (data->override_fmt || data->override_tiling)) {
+			if (test_bad_format) {
 				igt_assert_eq(ret, -EINVAL);
 				continue;
 			}
@@ -775,6 +775,7 @@ igt_main
 			test_plane_rotation(&data, subtest->plane);
 		}
 	}
+	data.flips = 0;
 
 	igt_subtest_f("sprite-rotation-90-pos-100-0") {
 		igt_require(gen >= 9);
@@ -783,23 +784,24 @@ igt_main
 		data.pos_y = 0;
 		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
 	}
+	data.pos_x = 0,
+	data.pos_y = 0;
 
 	igt_subtest_f("bad-pixel-format") {
 		igt_require(gen >= 9);
-		data.pos_x = 0,
-		data.pos_y = 0;
 		data.rotation = IGT_ROTATION_90;
 		data.override_fmt = DRM_FORMAT_RGB565;
 		test_bad_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
+	data.override_fmt = 0;
 
 	igt_subtest_f("bad-tiling") {
 		igt_require(gen >= 9);
-		data.override_fmt = 0;
 		data.rotation = IGT_ROTATION_90;
-		data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE;
+		data.override_tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 		test_bad_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
 	}
+	data.override_tiling = 0;
 
 	igt_subtest_f("primary-rotation-90-Y-tiled") {
 		enum pipe pipe;
-- 
2.16.1



More information about the igt-dev mailing list