[PATCH i-g-t v3] tests/kms_content_protection: Add a test for HDCP-MST with suspend resume

Santhosh Reddy Guddati santhosh.reddy.guddati at intel.com
Wed Jul 2 03:37:50 UTC 2025


From: Jeevan B <jeevan.b at intel.com>

adding new test to validate HDCP-MST with suspend resume
test check for valid output which supports MST and HDCP
then commits and check if the content protection is enabled
before and after suspend-resume.

v2: Change type-0 to type-1, try to authenticate hdcp few more times
as suggested. (Suraj)

v3: Add a new test for suspend-resume non-mst.
    Added suspend-resume handling to existing mst and non-mst test paths
    Updated test description and documentation.

Signed-off-by: Jeevan B <jeevan.b at intel.com>
Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
 tests/kms_content_protection.c | 38 ++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 51fc1d3be..d17d1702b 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -74,6 +74,7 @@
  * @atomic-dpms:    DPMS ON/OFF during atomic modesetting.
  * @legacy:         legacy style commit
  * @type1:          content type 1 that can be handled only through HDCP2.2.
+ * @suspend-resume: Suspend and resume the system
  */
 
 /**
@@ -86,6 +87,7 @@
  * @lic-type-1:   Type 1 with LIC.
  * @type-0:       Type 0
  * @type-1:       Type 1
+ * @suspend-resume: Suspend and resume the system
  */
 
 IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
@@ -104,6 +106,7 @@ struct data {
 #define CP_MEI_RELOAD				(1 << 2)
 #define CP_TYPE_CHANGE				(1 << 3)
 #define CP_UEVENT				(1 << 4)
+#define SUSPEND_RESUME				(1 << 5)
 
 #define CP_UNDESIRED				0
 #define CP_DESIRED				1
@@ -479,6 +482,18 @@ static void test_content_protection_on_output(igt_output_t *output,
 						  content_type, false,
 						  false);
 	}
+
+	if (data.cp_tests & SUSPEND_RESUME) {
+		igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
+		igt_display_commit2(display, COMMIT_ATOMIC);
+
+		ret = wait_for_prop_value(output, CP_ENABLED,
+					  KERNEL_AUTH_TIME_ALLOWED_MSEC);
+		if (!ret)
+			test_cp_enable_with_retry(output, commit_style, 2,
+						  content_type, false,
+						  false);
+	}
 }
 
 static void __debugfs_read(int fd, const char *param, char *buf, int len)
@@ -813,6 +828,18 @@ test_content_protection_mst(int content_type)
 
 	test_mst_cp_enable_with_retry(hdcp_mst_output, valid_outputs, 2, content_type);
 
+	if (data.cp_tests & SUSPEND_RESUME) {
+		igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
+		igt_display_commit2(display, COMMIT_ATOMIC);
+
+		ret = wait_for_prop_value(hdcp_mst_output[0],
+						 CP_ENABLED,
+						 KERNEL_AUTH_TIME_ALLOWED_MSEC);
+		if (!ret)
+			test_mst_cp_enable_with_retry(hdcp_mst_output, valid_outputs,
+						      2, content_type);
+	}
+
 	if (data.cp_tests & CP_LIC)
 		test_cp_lic_on_mst(hdcp_mst_output, valid_outputs, 0);
 
@@ -833,6 +860,7 @@ test_content_protection_mst(int content_type)
 		test_cp_lic_on_mst(hdcp_mst_output, valid_outputs, 1);
 }
 
+
 static void test_content_protection_cleanup(void)
 {
 	igt_display_t *display = &data.display;
@@ -941,6 +969,11 @@ static const struct {
 	  .cp_tests = 0,
 	  .content_type = HDCP_CONTENT_TYPE_0,
 	},
+	{.desc = "Test to verify the behaviour of HDCP after suspend resume cycles.",
+	 .name = "suspend-resume",
+	 .cp_tests = SUSPEND_RESUME,
+	 .content_type = HDCP_CONTENT_TYPE_0,
+	}
 };
 
 static const struct {
@@ -969,6 +1002,11 @@ static const struct {
 	  .cp_tests = CP_LIC,
 	  .content_type = HDCP_CONTENT_TYPE_1,
 	},
+	{ .desc = "Test Content protection(Type 1) over DP MST with suspend resume.",
+	  .name = "dp-mst-suspend-resume",
+	  .cp_tests = SUSPEND_RESUME,
+	  .content_type = HDCP_CONTENT_TYPE_1,
+	},
 };
 
 igt_main
-- 
2.34.1



More information about the igt-dev mailing list