[PATCH i-g-t v2 2/2] tests/xe_ccs: Update compression in config based on platform

Akshata Jahagirdar akshata.jahagirdar at intel.com
Fri Mar 29 16:30:13 UTC 2024


In Xe2+ platforms, we need to run this test regardless of the status of
flat-ccs. The entore flow of the test should work even in case of flat-ccs
disabled, Everything should "just work".
Check if the platform supports compression and has flat ccs enabled, before
the execution if this test, and if it doesn't, then update to compression
disabled and proceed with the test.

Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar at intel.com>
---
 tests/intel/xe_ccs.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_ccs.c b/tests/intel/xe_ccs.c
index ad2eeb259..9f427e730 100644
--- a/tests/intel/xe_ccs.c
+++ b/tests/intel/xe_ccs.c
@@ -116,7 +116,6 @@ static void surf_copy(int xe,
 	uint16_t cpu_caching = __xe_default_cpu_caching(xe, sysmem, 0);
 	int result;
 
-	igt_assert(mid->compression);
 	if (AT_LEAST_GEN(intel_get_drm_devid(xe), 20) && mid->compression) {
 		comp_pat_index  = intel_get_pat_idx_uc_comp(xe);
 		cpu_caching = DRM_XE_GEM_CPU_CACHING_WC;
@@ -193,7 +192,8 @@ static void surf_copy(int xe,
 	intel_ctx_xe_sync(ctx, true);
 	WRITE_PNG(xe, run_id, "corrupted", &blt.dst, dst->x2, dst->y2, bpp);
 	result = memcmp(src->ptr, dst->ptr, src->size);
-	igt_assert(result != 0);
+	if(mid->compression)
+		igt_assert(result != 0);
 
 	/* retrieve back ccs */
 	memcpy(ccsmap, ccscopy, ccssize);
@@ -747,6 +747,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 	igt_subtest_with_dynamic("block-copy-compressed") {
 		struct test_config config = { .compression = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_COPY);
 	}
 
@@ -756,6 +759,10 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 					      .width_increment = 15,
 					      .width_steps = 512 };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
+		igt_info("p1: config.compression:%d\n",config.compression);
 		block_copy_test(xe, &config, set, BLOCK_COPY);
 	}
 
@@ -763,6 +770,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 	igt_subtest_with_dynamic("block-multicopy-compressed") {
 		struct test_config config = { .compression = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_MULTICOPY);
 	}
 
@@ -771,6 +781,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 		struct test_config config = { .compression = true,
 					      .inplace = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_MULTICOPY);
 	}
 
@@ -779,6 +792,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 		struct test_config config = { .compression = true,
 					      .surfcopy = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_COPY);
 	}
 
@@ -789,6 +805,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 					      .surfcopy = true,
 					      .new_ctx = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_COPY);
 	}
 
@@ -798,6 +817,9 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL)
 					      .surfcopy = true,
 					      .suspend_resume = true };
 
+		if(AT_LEAST_GEN(xe, 20) && !blt_platform_supports_compression(xe))
+			config.compression = false;
+
 		block_copy_test(xe, &config, set, BLOCK_COPY);
 	}
 
-- 
2.34.1



More information about the igt-dev mailing list