[igt-dev] [PATCH i-g-t v5 3/3] tests/kms_ccs: Add GEN12 CCS render compression format modifiers

Mika Kahola mika.kahola at intel.com
Tue Nov 12 11:55:38 UTC 2019


Add GEN12 CCS format modifiers for render compression. Render
compression is not supported for 90/270 rotation.

v2: Added new subtests for each format modifier.
v3: Add IGT description for each subtest (GitLab)
v4: Fix errorneous subtest execution and listing

Bspec: 49252

Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
 tests/kms_ccs.c | 110 ++++++++++++++++++++++++++++--------------------
 1 file changed, 65 insertions(+), 45 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 1ce66cde..41916bb1 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -70,10 +70,14 @@ static const struct {
 	{0.0, 1.0, 0.0}
 };
 
-static const uint64_t ccs_modifiers[] = {
-	LOCAL_I915_FORMAT_MOD_Y_TILED_CCS,
-	LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS,
-};
+static const struct {
+	uint64_t modifier;
+	char name[8];
+} ccs_modifiers[3] = {
+	{LOCAL_I915_FORMAT_MOD_Y_TILED_CCS, "Y"},
+	{LOCAL_I915_FORMAT_MOD_Yf_TILED_CCS, "Yf"},
+	{LOCAL_I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, "Y-rc"},
+ };
 
 /*
  * Limit maximum used sprite plane width so this test will not mistakenly
@@ -300,17 +304,14 @@ static int test_ccs(data_t *data)
 static int __test_output(data_t *data)
 {
 	igt_display_t *display = &data->display;
-	int i, valid_tests = 0;
+	int valid_tests = 0;
 
 	data->output = igt_get_single_output_for_pipe(display, data->pipe);
 	igt_require(data->output);
 
 	igt_output_set_pipe(data->output, data->pipe);
 
-	for (i = 0; i < ARRAY_SIZE(ccs_modifiers); i++) {
-		data->ccs_modifier = ccs_modifiers[i];
-		valid_tests += test_ccs(data);
-	}
+	valid_tests += test_ccs(data);
 
 	igt_output_set_pipe(data->output, PIPE_NONE);
 	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
@@ -320,7 +321,12 @@ static int __test_output(data_t *data)
 
 static void test_output(data_t *data)
 {
-	int valid_tests = __test_output(data);
+	int valid_tests;
+
+	igt_skip_on(!igt_display_has_format_mod(&data->display, DRM_FORMAT_XRGB8888,
+						data->ccs_modifier));
+
+	valid_tests = __test_output(data);
 	igt_require_f(valid_tests > 0, "CCS not supported, skipping\n");
 }
 
@@ -328,12 +334,14 @@ static data_t data;
 
 igt_main
 {
+	int i, gen;
 	enum pipe pipe;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
-		igt_require(intel_gen(intel_get_drm_devid(data.drm_fd)) >= 9);
+		gen = intel_gen(intel_get_drm_devid(data.drm_fd));
+		igt_require(gen >= 9);
 		kmstest_set_vt_graphics_mode();
 		igt_require_pipe_crc(data.drm_fd);
 
@@ -345,51 +353,63 @@ igt_main
 
 		data.pipe = pipe;
 
-		data.flags = TEST_BAD_PIXEL_FORMAT;
-		igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name)
-			test_output(&data);
+		for (i = 0; i < ARRAY_SIZE(ccs_modifiers); i++) {
+			data.ccs_modifier = ccs_modifiers[i].modifier;
 
-		data.flags = TEST_BAD_ROTATION_90;
-		igt_subtest_f("pipe-%s-bad-rotation-90", pipe_name)
-			test_output(&data);
+			data.flags = TEST_BAD_PIXEL_FORMAT;
+			igt_describe("Test bad pixel format with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-bad-pixel-format", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
 
-		data.flags = TEST_CRC;
-		igt_subtest_f("pipe-%s-crc-primary-basic", pipe_name)
-			test_output(&data);
+			data.flags = TEST_BAD_ROTATION_90;
+			igt_describe("Test 90 degree rotation with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-bad-rotation-90", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
 
-		data.flags = TEST_CRC | TEST_ROTATE_180;
-		igt_subtest_f("pipe-%s-crc-primary-rotation-180", pipe_name)
-			test_output(&data);
+			data.flags = TEST_CRC;
+			igt_describe("Test primary plane CRC compatibility with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-crc-primary-basic", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
 
-		data.flags = TEST_CRC;
-		igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) {
-			int valid_tests = 0;
+			data.flags = TEST_CRC | TEST_ROTATE_180;
+			igt_describe("Test 180 degree rotation with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-crc-primary-rotation-180", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
 
-			igt_display_require_output_on_pipe(&data.display, data.pipe);
+			data.flags = TEST_CRC;
+			igt_describe("Test sprite plane CRC compatibility with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-crc-sprite-planes-basic", pipe_name, ccs_modifiers[i].name) {
+				int valid_tests = 0;
 
-			for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
-				if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
-					continue;
-				valid_tests += __test_output(&data);
-			}
+				igt_display_require_output_on_pipe(&data.display, data.pipe);
 
-			igt_require_f(valid_tests > 0,
-				      "CCS not supported, skipping\n");
-		}
+				for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
+					if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
+						continue;
+					valid_tests += __test_output(&data);
+				}
 
-		data.plane = NULL;
+				igt_require_f(valid_tests > 0,
+					      "CCS not supported, skipping\n");
+			}
 
-		data.flags = TEST_NO_AUX_BUFFER;
-		igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name)
-			test_output(&data);
+			data.plane = NULL;
 
-		data.flags = TEST_BAD_CCS_HANDLE;
-		igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name)
-			test_output(&data);
+			data.flags = TEST_NO_AUX_BUFFER;
+			igt_describe("Test missing CCS buffer with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-missing-ccs-buffer", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
 
-		data.flags = TEST_BAD_AUX_STRIDE;
-		igt_subtest_f("pipe-%s-bad-aux-stride", pipe_name)
-			test_output(&data);
+			data.flags = TEST_BAD_CCS_HANDLE;
+			igt_describe("Test CCS with different BO with given modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-ccs-on-another-bo", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
+
+			data.flags = TEST_BAD_AUX_STRIDE;
+			igt_describe("Test with bad AUX stride with given CCS modifier");
+			igt_subtest_f("pipe-%s-tiling-%s-bad-aux-stride", pipe_name, ccs_modifiers[i].name)
+				test_output(&data);
+		}
 	}
 
 	igt_fixture
-- 
2.17.1



More information about the igt-dev mailing list