public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_content_protection: CP cleanup exit handler
@ 2020-05-19  6:10 Anshuman Gupta
  2020-05-19  6:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anshuman Gupta @ 2020-05-19  6:10 UTC (permalink / raw)
  To: igt-dev; +Cc: chris

Add HDCP content protection cleanup igt exit handler,
earlier it was done through igt_fixture which doesn't
trigger hdcp cleanup on igt abortion due to any signal.
This should avoid any HDCP content protection leak.

Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/kms_content_protection.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 3b9cedcb..f3101b8a 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -651,12 +651,21 @@ static void test_content_protection_cleanup(void)
 	}
 }
 
+static void test_content_protection_exit_handler(int sig)
+{
+	igt_fixture {
+		test_content_protection_cleanup();
+		igt_display_fini(&data.display);
+	}
+}
+
 igt_main
 {
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
 		igt_display_require(&data.display, data.drm_fd);
+		igt_install_exit_handler(test_content_protection_exit_handler);
 	}
 
 	igt_subtest("legacy") {
@@ -723,9 +732,4 @@ igt_main
 		igt_assert_f(ret, "SRM update failed");
 		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
 	}
-
-	igt_fixture {
-		test_content_protection_cleanup();
-		igt_display_fini(&data.display);
-	}
 }
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-19 11:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19  6:10 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: CP cleanup exit handler Anshuman Gupta
2020-05-19  6:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-05-19  7:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-19  8:42 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2020-05-19 10:27   ` Anshuman Gupta
2020-05-19 11:10     ` Petri Latvala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox