[igt-dev] [PATCH i-g-t] kms_content_protection: Set CP prop to UNDESIRED at igt exit
Anshuman Gupta
anshuman.gupta at intel.com
Thu Sep 26 04:31:29 UTC 2019
We require to clear HDCP state to UNDESIRED at igt exit on
every success/failure in order to avoid any HDCP operations in
subsequent IGT tests.
v2: commit message change.
Cc: Ramalingam C <ramalingam.c at intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta at intel.com>
---
tests/kms_content_protection.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index e676b60b..fce4b591 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -617,6 +617,26 @@ test_content_protection(enum igt_commit_style s, int content_type)
igt_require_f(valid_tests, "No connector found with HDCP capability\n");
}
+static void test_content_protection_cleanup(void)
+{
+ igt_display_t *display = &data.display;
+ igt_output_t *output;
+ uint64_t val;
+
+ for_each_connected_output(display, output) {
+ if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+ continue;
+
+ val = igt_output_get_prop(output,
+ IGT_CONNECTOR_CONTENT_PROTECTION);
+ if (val == CP_UNDESIRED)
+ continue;
+
+ igt_info("CP Prop being UNDESIRED on %s\n", output->name);
+ test_cp_disable(output, COMMIT_ATOMIC);
+ }
+}
+
igt_main
{
igt_fixture {
@@ -692,6 +712,8 @@ igt_main
test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
}
- igt_fixture
+ igt_fixture {
+ test_content_protection_cleanup();
igt_display_fini(&data.display);
+ }
}
--
2.21.0
More information about the igt-dev
mailing list