[PATCH i-g-t v2] tests/intel/kms_ccs: add suspend tests

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Oct 31 15:09:01 UTC 2024


Add crc testing for suspend/resume while compressed framebuffer is on screen.
Test use only XR24 and P016 formats for testing. After resume is checked
framebuffer did stay compressed.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 tests/intel/kms_ccs.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/intel/kms_ccs.c b/tests/intel/kms_ccs.c
index a5d3ff5e6..13103d4d5 100644
--- a/tests/intel/kms_ccs.c
+++ b/tests/intel/kms_ccs.c
@@ -96,6 +96,7 @@
  * arg[1]:
  *
  * @crc-primary-basic:           Primary plane CRC compatibility
+ * @crc-primary-suspend:         Primary plane CRC after suspend
  * @crc-sprite-planes-basic:     Sprite plane CRC compatability
  * @random-ccs-data:             Random CCS data
  *
@@ -159,6 +160,7 @@ enum test_flags {
 	TEST_BAD_AUX_STRIDE		= 1 << 7,
 	TEST_RANDOM			= 1 << 8,
 	TEST_ALL_PLANES			= 1 << 9,
+	TEST_SUSPEND			= 1 << 10,
 };
 
 #define TEST_BAD_CCS_PLANE	(TEST_NO_AUX_BUFFER | TEST_BAD_CCS_HANDLE | \
@@ -252,6 +254,7 @@ static const struct {
 	{TEST_BAD_CCS_HANDLE, "ccs-on-another-bo", "Test CCS with different BO with given modifier"},
 	{TEST_BAD_AUX_STRIDE, "bad-aux-stride", "Test with bad AUX stride with given CCS modifier"},
 	{TEST_CRC | TEST_ALL_PLANES, "crc-sprite-planes-basic", "Test sprite plane CRC compatibility with given CCS modifier"},
+	{TEST_CRC | TEST_SUSPEND, "crc-primary-suspend", "Test primary plane CRC with suspend on XR24 and P016 formats"},
 };
 
 /*
@@ -817,8 +820,18 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
 
 	ret = igt_display_try_commit2(display, data->commit);
 
-	if (ret == 0 && !(fb_flags & TEST_BAD_ROTATION_90) && crc)
+	if (ret == 0 && !(fb_flags & TEST_BAD_ROTATION_90) && crc) {
+		if (data->flags & TEST_SUSPEND && fb_flags & FB_COMPRESSED) {
+			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+						      SUSPEND_TEST_NONE);
+
+			/* on resume check flat ccs is still compressed */
+			if (is_xe_device(data->drm_fd) &&
+			    HAS_FLATCCS(intel_get_drm_devid(data->drm_fd)))
+				access_flat_ccs_surface(&fb, true);
+		}
 		igt_pipe_crc_collect_crc(data->pipe_crc, crc);
+	}
 
 	igt_debug_wait_for_keypress("ccs");
 
@@ -846,6 +859,11 @@ static int test_ccs(data_t *data)
 	igt_crc_t crc, ref_crc;
 	enum test_fb_flags fb_flags = 0;
 
+	if (data->flags & TEST_SUSPEND &&
+	    !(data->format == DRM_FORMAT_XRGB8888 ||
+	      data->format == DRM_FORMAT_P016))
+	      return 0;
+
 	igt_info("Testing format " IGT_FORMAT_FMT " / modifier " IGT_MODIFIER_FMT "\n",
 		 IGT_FORMAT_ARGS(data->format), IGT_MODIFIER_ARGS(data->ccs_modifier));
 
-- 
2.45.2



More information about the igt-dev mailing list