[igt-dev] [PATCH 2/2] tests/kms_hdr: Add suspend and DPMS Colorspace tests

Harry Wentland harry.wentland at amd.com
Mon Dec 12 19:24:25 UTC 2022


These test that Colorspace settings aren't lost over a
DPMS or suspend cycle.

Signed-off-by: Harry Wentland <harry.wentland at amd.com>
Cc: Pekka Paalanen <ppaalanen at gmail.com>
Cc: Sebastian Wick <sebastian.wick at redhat.com>
Cc: Vitaly.Prosyak at amd.com
Cc: Uma Shankar <uma.shankar at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Joshua Ashton <joshua at froggi.es>
Cc: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
Cc: Alex Hung <Alex.Hung at amd.com>
---
 tests/kms_hdr.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index b656dc7a7ed5..1c7c04191df4 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -336,6 +336,13 @@ static void test_colorspace_switch_on_output(data_t *data, enum pipe pipe,
 			igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 			/* get and check current colorspace */
 			igt_assert_output_colorspace_equal(data->fd, pipe, colorspaces[i]);
+			/* test suspend only once since it's slow */
+			if (flags & TEST_SUSPEND) {
+				test_cycle_flags(data, flags);
+				igt_assert_output_colorspace_equal(data->fd, pipe, colorspaces[i]);
+				break;
+			}
+
 		}
 	}
 
@@ -741,6 +748,12 @@ igt_main
 	igt_describe("Tests switching Colorspace property, .i.e., the display colorimetry");
 	igt_subtest_with_dynamic("colorspace-switch")
 		test_colorspace_switch(&data, TEST_NONE);
+	igt_describe("Tests Colorspace switch with DPMS");
+	igt_subtest_with_dynamic("colorspace-switch-dpms")
+		test_colorspace_switch(&data, TEST_DPMS);
+	igt_describe("Tests Colorspace switch with suspend");
+	igt_subtest_with_dynamic("colorspace-switch-suspend")
+		test_colorspace_switch(&data, TEST_SUSPEND);
 
 	igt_describe("Tests entering and exiting HDR mode");
 	igt_subtest_with_dynamic("static-toggle")
-- 
2.38.1



More information about the igt-dev mailing list