All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests
@ 2019-03-21 15:55 Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 1/6] kms_content_protection: Content type support Ramalingam C
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

This series adds tests for:
	1. content_type which is added for HDCP2.2.
	     Adds a new test for Type1.
	     Adds another test for Type1 -> Type0.
	2. teardown and rebuild of i915-mei interface.
	     Removes the mei_hdcp and reloads it and test for HDCP2.2.
	3. downstream info gathering and SRM revocation.
	     Retrieves the receivers ID from downstream_info
	     fabricates a SRM and test for the revocation of the device.

Wait for HDCP state change is implemented through the uevent handler.

v2:
  Type1->Type0 when CP is ENABLED is added as kernel supports it now.
  SRM configuration is moved into binary sysfs. Following kernel changes
  property names are changed as per kernel patch modifications.
v3:
  uevent is handled.
  patches are reshuffled.

Ramalingam C (6):
  kms_content_protection: Content type support
  kms_content_protection: test teardown and rebuild of I915-mei I/F
  kms_content_protection: test content type change
  kms_content_protection: uevent for HDCP status change
  kms_content_protection: srm and topology_info test
  DO NOT MERGE: CP in fast feedback list

 lib/igt_kms.c                         |   2 +
 lib/igt_kms.h                         |   2 +
 tests/intel-ci/fast-feedback.testlist |   3 +
 tests/kms_content_protection.c        | 491 ++++++++++++++++++++++++--
 4 files changed, 470 insertions(+), 28 deletions(-)

-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 1/6] kms_content_protection: Content type support
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

Adds a connector property called "CP_Content_Type"

Content Type takes two values which classifies the content stream:
	Type 0: Stream that can be tranmitted on HDCP1.4/HDCP2.2
	Type 1: Stream that needs HDCP2.2 encryption only.

So when Type 1 is set KMD is forced to enable HDCP2.2 only.

For Type 0 request, Kernel chooses the highest capable HDCP version
(v2.2) first. If that fails, then it fall back to the next availble
version(v1.4) before abondoning HDCP autehntication attempts.

Please note content_type is allowed to be updated when "Content
Protection" is in UNDESIRED state.

v2:
  s/cp_content_type/content_ptotection_type [danvet]
v3:
  s/content_protection_type/HDCP Content Type [Pekka]

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 lib/igt_kms.c                  |  1 +
 lib/igt_kms.h                  |  1 +
 tests/kms_content_protection.c | 77 ++++++++++++++++++++++++++++------
 3 files changed, 66 insertions(+), 13 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e1eacc1e6f03..37dec2cf0745 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -200,6 +200,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_BROADCAST_RGB] = "Broadcast RGB",
 	[IGT_CONNECTOR_CONTENT_PROTECTION] = "Content Protection",
 	[IGT_CONNECTOR_VRR_CAPABLE] = "vrr_capable",
+	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
 };
 
 /*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 407f3d644eeb..d281c4931b83 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -123,6 +123,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_BROADCAST_RGB,
        IGT_CONNECTOR_CONTENT_PROTECTION,
        IGT_CONNECTOR_VRR_CAPABLE,
+       IGT_CONNECTOR_HDCP_CONTENT_TYPE,
        IGT_NUM_CONNECTOR_PROPS
 };
 
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 7fc8542e769a..7682d3b03fcd 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -40,6 +40,13 @@ struct data {
 #define CP_DESIRED				1
 #define CP_ENABLED				2
 
+/*
+ * HDCP_CONTENT_TYPE_0 can be handled on both HDCP1.4 and HDCP2.2. Where as
+ * HDCP_CONTENT_TYPE_1 can be handled only through HDCP2.2.
+ */
+#define HDCP_CONTENT_TYPE_0				0
+#define HDCP_CONTENT_TYPE_1				1
+
 #define LIC_PERIOD_MSEC				(4 * 1000)
 /* Kernel retry count=3, Max time per authentication allowed = 6Sec */
 #define KERNEL_AUTH_TIME_ALLOWED_MSEC		(3 *  6 * 1000)
@@ -155,7 +162,8 @@ static void modeset_with_fb(const enum pipe pipe, igt_output_t *output,
 	commit_display_and_wait_for_flip(s);
 }
 
-static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s)
+static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s,
+			   int content_type)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
@@ -165,6 +173,10 @@ static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s)
 
 	igt_output_set_prop_value(output,
 				  IGT_CONNECTOR_CONTENT_PROTECTION, CP_DESIRED);
+	if (output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE])
+		igt_output_set_prop_value(output,
+					  IGT_CONNECTOR_HDCP_CONTENT_TYPE,
+					  content_type);
 	igt_display_commit2(display, s);
 
 	ret = wait_for_prop_value(output, CP_ENABLED,
@@ -201,13 +213,14 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
 }
 
 static void test_cp_enable_with_retry(igt_output_t *output,
-				      enum igt_commit_style s, int retry)
+				      enum igt_commit_style s, int retry,
+				      int content_type)
 {
 	bool ret;
 
 	do {
 		test_cp_disable(output, s);
-		ret = test_cp_enable(output, s);
+		ret = test_cp_enable(output, s, content_type);
 
 		if (!ret && --retry)
 			igt_debug("Retry (%d/2) ...\n", 3 - retry);
@@ -237,7 +250,7 @@ static void test_cp_lic(igt_output_t *output)
 
 static void test_content_protection_on_output(igt_output_t *output,
 					      enum igt_commit_style s,
-					      bool dpms_test)
+					      bool dpms_test, int content_type)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
@@ -258,7 +271,7 @@ static void test_content_protection_on_output(igt_output_t *output,
 			continue;
 
 		modeset_with_fb(pipe, output, s);
-		test_cp_enable_with_retry(output, s, 3);
+		test_cp_enable_with_retry(output, s, 3, content_type);
 		test_cp_lic(output);
 
 		if (dpms_test) {
@@ -273,7 +286,8 @@ static void test_content_protection_on_output(igt_output_t *output,
 			ret = wait_for_prop_value(output, CP_ENABLED,
 						  KERNEL_AUTH_TIME_ALLOWED_MSEC);
 			if (!ret)
-				test_cp_enable_with_retry(output, s, 2);
+				test_cp_enable_with_retry(output, s,
+							  2, content_type);
 		}
 
 		test_cp_disable(output, s);
@@ -300,7 +314,8 @@ static void __debugfs_read(int fd, const char *param, char *buf, int len)
 
 #define debugfs_read(fd, p, arr) __debugfs_read(fd, p, arr, sizeof(arr))
 
-#define MAX_SINK_HDCP_CAP_BUF_LEN	500
+#define MAX_SINK_HDCP_CAP_BUF_LEN	5000
+
 static bool sink_hdcp_capable(igt_output_t *output)
 {
 	char buf[MAX_SINK_HDCP_CAP_BUF_LEN];
@@ -318,9 +333,26 @@ static bool sink_hdcp_capable(igt_output_t *output)
 	return strstr(buf, "HDCP1.4");
 }
 
+static bool sink_hdcp2_capable(igt_output_t *output)
+{
+	char buf[MAX_SINK_HDCP_CAP_BUF_LEN];
+	int fd;
+
+	fd = igt_debugfs_connector_dir(data.drm_fd, output->name, O_RDONLY);
+	if (fd < 0)
+		return false;
+
+	debugfs_read(fd, "i915_hdcp_sink_capability", buf);
+	close(fd);
+
+	igt_debug("Sink capability: %s\n", buf);
+
+	return strstr(buf, "HDCP2.2");
+}
 
 static void
-test_content_protection(enum igt_commit_style s, bool dpms_test)
+test_content_protection(enum igt_commit_style s, bool dpms_test,
+			int content_type)
 {
 	igt_display_t *display = &data.display;
 	igt_output_t *output;
@@ -330,14 +362,24 @@ test_content_protection(enum igt_commit_style s, bool dpms_test)
 		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
 			continue;
 
+		if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] &&
+		    content_type)
+			continue;
+
 		igt_info("CP Test execution on %s\n", output->name);
-		if (!sink_hdcp_capable(output)) {
+
+		if (content_type && !sink_hdcp2_capable(output)) {
+			igt_info("\tSkip %s (Sink has no HDCP2.2 support)\n",
+				 output->name);
+			continue;
+		} else if (!sink_hdcp_capable(output)) {
 			igt_info("\tSkip %s (Sink has no HDCP support)\n",
 				 output->name);
 			continue;
 		}
 
-		test_content_protection_on_output(output, s, dpms_test);
+		test_content_protection_on_output(output, s, dpms_test,
+						  content_type);
 		valid_tests++;
 	}
 
@@ -355,16 +397,25 @@ igt_main
 	}
 
 	igt_subtest("legacy")
-		test_content_protection(COMMIT_LEGACY, false);
+		test_content_protection(COMMIT_LEGACY, false,
+					HDCP_CONTENT_TYPE_0);
 
 	igt_subtest("atomic") {
 		igt_require(data.display.is_atomic);
-		test_content_protection(COMMIT_ATOMIC, false);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_0);
 	}
 
 	igt_subtest("atomic-dpms") {
 		igt_require(data.display.is_atomic);
-		test_content_protection(COMMIT_ATOMIC, true);
+		test_content_protection(COMMIT_ATOMIC, true,
+					HDCP_CONTENT_TYPE_0);
+	}
+
+	igt_subtest("type1") {
+		igt_require(data.display.is_atomic);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_1);
 	}
 
 	igt_fixture
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 1/6] kms_content_protection: Content type support Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 3/6] kms_content_protection: test content type change Ramalingam C
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

To validate the teardown and rebuild of the interface between
I915 and mei hdcp this subtest execute the below sequence:
	1. Test HDCP2.2 Type 1 (expected to pass)
	2. Unload the mei_hdcp
	3. Test HDCP2.2 Type 1 (expected to fail)
	2. Reload the mei_hdcp
	1. Test HDCP2.2 Type 1 (expected to pass)

v2:
  Rebased.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/kms_content_protection.c | 63 ++++++++++++++++++++++++++--------
 1 file changed, 49 insertions(+), 14 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 7682d3b03fcd..88dd43660d65 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -27,6 +27,7 @@
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_kms.h"
+#include "igt_kmod.h"
 
 IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
 
@@ -214,7 +215,7 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
 
 static void test_cp_enable_with_retry(igt_output_t *output,
 				      enum igt_commit_style s, int retry,
-				      int content_type)
+				      int content_type, bool expect_failure)
 {
 	bool ret;
 
@@ -225,7 +226,12 @@ static void test_cp_enable_with_retry(igt_output_t *output,
 		if (!ret && --retry)
 			igt_debug("Retry (%d/2) ...\n", 3 - retry);
 	} while (retry && !ret);
-	igt_assert_f(ret, "Content Protection not enabled\n");
+
+	if (expect_failure)
+		igt_assert_f(!ret,
+			     "CP Enabled. Though it is expected to fail\n");
+	else
+		igt_assert_f(ret, "Content Protection not enabled\n");
 }
 
 static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
@@ -248,9 +254,10 @@ static void test_cp_lic(igt_output_t *output)
 	igt_assert_f(!ret, "Content Protection LIC Failed\n");
 }
 
-static void test_content_protection_on_output(igt_output_t *output,
-					      enum igt_commit_style s,
-					      bool dpms_test, int content_type)
+static void
+test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
+				  bool dpms_test, int content_type,
+				  bool mei_reload_test)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
@@ -271,7 +278,24 @@ static void test_content_protection_on_output(igt_output_t *output,
 			continue;
 
 		modeset_with_fb(pipe, output, s);
-		test_cp_enable_with_retry(output, s, 3, content_type);
+		test_cp_enable_with_retry(output, s, 3, content_type, false);
+
+		if (mei_reload_test) {
+			igt_assert_f(!igt_kmod_unload("mei_hdcp", 0),
+				     "mei_hdcp unload failed");
+
+			/* Expected to fail */
+			test_cp_enable_with_retry(output, s, 3,
+						  content_type, false, true);
+
+			igt_assert_f(!igt_kmod_load("mei_hdcp", NULL),
+				     "mei_hdcp load failed");
+
+			/* Expected to pass */
+			test_cp_enable_with_retry(output, s, 3,
+						  content_type, false, false);
+		}
+
 		test_cp_lic(output);
 
 		if (dpms_test) {
@@ -286,8 +310,8 @@ static void test_content_protection_on_output(igt_output_t *output,
 			ret = wait_for_prop_value(output, CP_ENABLED,
 						  KERNEL_AUTH_TIME_ALLOWED_MSEC);
 			if (!ret)
-				test_cp_enable_with_retry(output, s,
-							  2, content_type);
+				test_cp_enable_with_retry(output, s, 2,
+							  content_type, false);
 		}
 
 		test_cp_disable(output, s);
@@ -352,12 +376,16 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 
 static void
 test_content_protection(enum igt_commit_style s, bool dpms_test,
-			int content_type)
+			int content_type, bool mei_reload_test)
 {
 	igt_display_t *display = &data.display;
 	igt_output_t *output;
 	int valid_tests = 0;
 
+	if (mei_reload_test)
+		igt_require_f(igt_kmod_is_loaded("mei_hdcp"),
+			      "mei_hdcp module is not loaded\n");
+
 	for_each_connected_output(display, output) {
 		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
 			continue;
@@ -379,7 +407,8 @@ test_content_protection(enum igt_commit_style s, bool dpms_test,
 		}
 
 		test_content_protection_on_output(output, s, dpms_test,
-						  content_type);
+						  content_type,
+						  mei_reload_test);
 		valid_tests++;
 	}
 
@@ -398,24 +427,30 @@ igt_main
 
 	igt_subtest("legacy")
 		test_content_protection(COMMIT_LEGACY, false,
-					HDCP_CONTENT_TYPE_0);
+					HDCP_CONTENT_TYPE_0, false);
 
 	igt_subtest("atomic") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_0);
+					HDCP_CONTENT_TYPE_0, false);
 	}
 
 	igt_subtest("atomic-dpms") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, true,
-					HDCP_CONTENT_TYPE_0);
+					HDCP_CONTENT_TYPE_0, false);
 	}
 
 	igt_subtest("type1") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1);
+					HDCP_CONTENT_TYPE_1, false);
+	}
+
+	igt_subtest("type1_mei_interface") {
+		igt_require(data.display.is_atomic);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_1, true);
 	}
 
 	igt_fixture
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 3/6] kms_content_protection: test content type change
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 1/6] kms_content_protection: Content type support Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

Testing the content type change when the content protection already
enabled.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/kms_content_protection.c | 61 ++++++++++++++++++++++++----------
 1 file changed, 44 insertions(+), 17 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 88dd43660d65..af64e3efe861 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -164,7 +164,7 @@ static void modeset_with_fb(const enum pipe pipe, igt_output_t *output,
 }
 
 static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s,
-			   int content_type)
+			   int content_type, bool test_type_change)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
@@ -172,8 +172,11 @@ static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s,
 
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
-	igt_output_set_prop_value(output,
-				  IGT_CONNECTOR_CONTENT_PROTECTION, CP_DESIRED);
+	if (!test_type_change)
+		igt_output_set_prop_value(output,
+					  IGT_CONNECTOR_CONTENT_PROTECTION,
+					  CP_DESIRED);
+
 	if (output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE])
 		igt_output_set_prop_value(output,
 					  IGT_CONNECTOR_HDCP_CONTENT_TYPE,
@@ -215,13 +218,17 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
 
 static void test_cp_enable_with_retry(igt_output_t *output,
 				      enum igt_commit_style s, int retry,
-				      int content_type, bool expect_failure)
+				      int content_type, bool expect_failure,
+				      bool test_type_change)
 {
+	int retry_orig = retry;
 	bool ret;
 
 	do {
-		test_cp_disable(output, s);
-		ret = test_cp_enable(output, s, content_type);
+		if (!test_type_change || retry_orig != retry)
+			test_cp_disable(output, s);
+
+		ret = test_cp_enable(output, s, content_type, test_type_change);
 
 		if (!ret && --retry)
 			igt_debug("Retry (%d/2) ...\n", 3 - retry);
@@ -257,7 +264,7 @@ static void test_cp_lic(igt_output_t *output)
 static void
 test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 				  bool dpms_test, int content_type,
-				  bool mei_reload_test)
+				  bool mei_reload_test, bool test_type_change)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
@@ -278,7 +285,12 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 			continue;
 
 		modeset_with_fb(pipe, output, s);
-		test_cp_enable_with_retry(output, s, 3, content_type, false);
+		test_cp_enable_with_retry(output, s, 3, content_type, false,
+					  false);
+		if (test_type_change && content_type == HDCP_CONTENT_TYPE_1)
+			test_cp_enable_with_retry(output, s, 3,
+						  HDCP_CONTENT_TYPE_0, false,
+						  test_type_change);
 
 		if (mei_reload_test) {
 			igt_assert_f(!igt_kmod_unload("mei_hdcp", 0),
@@ -286,7 +298,7 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 
 			/* Expected to fail */
 			test_cp_enable_with_retry(output, s, 3,
-						  content_type, false, true);
+						  content_type, true, false);
 
 			igt_assert_f(!igt_kmod_load("mei_hdcp", NULL),
 				     "mei_hdcp load failed");
@@ -311,7 +323,8 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 						  KERNEL_AUTH_TIME_ALLOWED_MSEC);
 			if (!ret)
 				test_cp_enable_with_retry(output, s, 2,
-							  content_type, false);
+							  content_type, false,
+							  false);
 		}
 
 		test_cp_disable(output, s);
@@ -376,7 +389,8 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 
 static void
 test_content_protection(enum igt_commit_style s, bool dpms_test,
-			int content_type, bool mei_reload_test)
+			int content_type, bool mei_reload_test,
+			bool test_type_change)
 {
 	igt_display_t *display = &data.display;
 	igt_output_t *output;
@@ -408,7 +422,8 @@ test_content_protection(enum igt_commit_style s, bool dpms_test,
 
 		test_content_protection_on_output(output, s, dpms_test,
 						  content_type,
-						  mei_reload_test);
+						  mei_reload_test,
+						  test_type_change);
 		valid_tests++;
 	}
 
@@ -427,30 +442,42 @@ igt_main
 
 	igt_subtest("legacy")
 		test_content_protection(COMMIT_LEGACY, false,
-					HDCP_CONTENT_TYPE_0, false);
+					HDCP_CONTENT_TYPE_0, false,
+					false);
 
 	igt_subtest("atomic") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_0, false);
+					HDCP_CONTENT_TYPE_0, false,
+					false);
 	}
 
 	igt_subtest("atomic-dpms") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, true,
-					HDCP_CONTENT_TYPE_0, false);
+					HDCP_CONTENT_TYPE_0, false,
+					false);
 	}
 
 	igt_subtest("type1") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, false);
+					HDCP_CONTENT_TYPE_1, false,
+					false);
 	}
 
 	igt_subtest("type1_mei_interface") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, true);
+					HDCP_CONTENT_TYPE_1, true,
+					false);
+	}
+
+	igt_subtest("content_type_change") {
+		igt_require(data.display.is_atomic);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_1, false,
+					true);
 	}
 
 	igt_fixture
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 4/6] kms_content_protection: uevent for HDCP status change
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (2 preceding siblings ...)
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 3/6] kms_content_protection: test content type change Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 5/6] kms_content_protection: srm and topology_info test Ramalingam C
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

To detect the HDCP status change we are reading the uevent sent with the
corresponding connector id and property id.

This avoids the polling of the property every mSec.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/kms_content_protection.c | 152 +++++++++++++++++++++++++++++++--
 1 file changed, 144 insertions(+), 8 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index af64e3efe861..abbecc4b0c56 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -24,6 +24,9 @@
 
 #include <poll.h>
 #include <fcntl.h>
+#include <sys/epoll.h>
+#include <sys/stat.h>
+#include <libudev.h>
 #include "igt.h"
 #include "igt_sysfs.h"
 #include "igt_kms.h"
@@ -95,20 +98,153 @@ static int wait_flip_event(void)
 	return rc;
 }
 
+static bool hdcp_event(struct udev_monitor *uevent_monitor,
+		       struct udev *udev, uint32_t conn_id, uint32_t prop_id)
+{
+	struct udev_device *dev;
+	dev_t udev_devnum;
+	struct stat s;
+	const char *hotplug, *connector, *property;
+	bool ret = false;
+
+	dev = udev_monitor_receive_device(uevent_monitor);
+	if (!dev)
+		goto out;
+
+	udev_devnum = udev_device_get_devnum(dev);
+	fstat(data.display.drm_fd, &s);
+
+	hotplug = udev_device_get_property_value(dev, "HOTPLUG");
+	if (!(memcmp(&s.st_rdev, &udev_devnum, sizeof(dev_t)) == 0 &&
+	    hotplug && atoi(hotplug) == 1)) {
+		igt_debug("Not a Hotplug event\n");
+		goto out_dev;
+	}
+
+	connector = udev_device_get_property_value(dev, "CONNECTOR");
+	if (!(memcmp(&s.st_rdev, &udev_devnum, sizeof(dev_t)) == 0 &&
+	    connector && atoi(connector) == conn_id)) {
+		igt_debug("Not for connector id: %u\n", conn_id);
+		goto out_dev;
+	}
+
+	property = udev_device_get_property_value(dev, "PROPERTY");
+	if (!(memcmp(&s.st_rdev, &udev_devnum, sizeof(dev_t)) == 0 &&
+	    property && atoi(property) == prop_id)) {
+		igt_debug("Not for property id: %u\n", prop_id);
+		goto out_dev;
+	}
+	ret = true;
+
+out_dev:
+	udev_device_unref(dev);
+out:
+	return ret;
+}
+
+static void hdcp_udev_fini(struct udev_monitor *uevent_monitor,
+			   struct udev *udev)
+{
+	if (uevent_monitor)
+		udev_monitor_unref(uevent_monitor);
+	if (udev)
+		udev_unref(udev);
+}
+
+static int hdcp_udev_init(struct udev_monitor *uevent_monitor,
+			  struct udev *udev)
+{
+	int ret = -EINVAL;
+
+	udev = udev_new();
+	if (!udev) {
+		igt_info("failed to create udev object\n");
+		goto out;
+	}
+
+	uevent_monitor = udev_monitor_new_from_netlink(udev, "udev");
+	if (!uevent_monitor) {
+		igt_info("failed to create udev event monitor\n");
+		goto out;
+	}
+
+	ret = udev_monitor_filter_add_match_subsystem_devtype(uevent_monitor,
+							      "drm",
+							      "drm_minor");
+	if (ret < 0) {
+		igt_info("failed to filter for drm events\n");
+		goto out;
+	}
+
+	ret = udev_monitor_enable_receiving(uevent_monitor);
+	if (ret < 0) {
+		igt_info("failed to enable udev event reception\n");
+		goto out;
+	}
+
+	return udev_monitor_get_fd(uevent_monitor);
+
+out:
+	hdcp_udev_fini(uevent_monitor, udev);
+	return ret;
+}
+
+#define MAX_EVENTS	10
+static bool wait_for_hdcp_event(uint32_t conn_id, uint32_t prop_id,
+				uint32_t timeout_mSec)
+{
+
+	struct udev_monitor *uevent_monitor = NULL;
+	struct udev *udev = NULL;
+	int udev_fd, epoll_fd;
+	struct epoll_event event, events[MAX_EVENTS];
+	bool ret = false;
+
+	udev_fd = hdcp_udev_init(uevent_monitor, udev);
+	if (udev_fd < 0)
+		return false;
+
+	epoll_fd = epoll_create1(0);
+	if (epoll_fd == -1) {
+		igt_info("Failed to create epoll fd. %d\n", epoll_fd);
+		goto out_ep_create;
+	}
+
+	event.events = EPOLLIN | EPOLLERR;
+	event.data.fd = 0;
+
+	if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, udev_fd, &event))
+	{
+		igt_info("failed to fd into epoll\n");
+		goto out_ep_ctl;
+	}
+
+	if (epoll_wait(epoll_fd, events, MAX_EVENTS, timeout_mSec))
+		ret = hdcp_event(uevent_monitor, udev, conn_id, prop_id);
+
+out_ep_ctl:
+	if (close(epoll_fd))
+		igt_info("failed to close the epoll fd\n");
+out_ep_create:
+	hdcp_udev_fini(uevent_monitor, udev);
+	return ret;
+}
+
 static bool
 wait_for_prop_value(igt_output_t *output, uint64_t expected,
 		    uint32_t timeout_mSec)
 {
 	uint64_t val;
-	int i;
 
-	for (i = 0; i < timeout_mSec; i++) {
-		val = igt_output_get_prop(output,
-					  IGT_CONNECTOR_CONTENT_PROTECTION);
-		if (val == expected)
-			return true;
-		usleep(1000);
-	}
+	if (wait_for_hdcp_event(output->id,
+				output->props[IGT_CONNECTOR_CONTENT_PROTECTION],
+				timeout_mSec))
+		igt_debug("hdcp event received\n");
+
+	val = igt_output_get_prop(output, IGT_CONNECTOR_CONTENT_PROTECTION);
+	if (val == expected)
+		return true;
+
 	igt_info("prop_value mismatch %" PRId64 " != %" PRId64 "\n",
 		 val, expected);
 
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 5/6] kms_content_protection: srm and topology_info test
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (3 preceding siblings ...)
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 17:44   ` [igt-dev] [PATCH i-g-t v4 " Ramalingam C
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

Retrieve the topology info and use that to stitch a srm and
verify the revocation process.

Adds a connector properties called "HDCP Topology"

SRM stitched here is polluted. Kernel trusts the userspace to validate
the SRM integrity through DCP signature. Actually this test exploits
that trust to test SRM and downstream_info features.

HDCP1.4 BKSV and HDCP2.2 receiver id of a HDCP sink is different. So we
need to force the KMD to use a single HDCP version across
downstream_info gathering and SRM setting and verifying teh revocation
process. So Type 1 is used.

v2:
  binary sysfs is used to write the srm into kernel [Daniel]
v3:
  s/CP_downstream_info/HDCP Topology

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 lib/igt_kms.c                  |   1 +
 lib/igt_kms.h                  |   1 +
 tests/kms_content_protection.c | 222 ++++++++++++++++++++++++++++++---
 3 files changed, 206 insertions(+), 18 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 37dec2cf0745..738deeababd0 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -201,6 +201,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_CONTENT_PROTECTION] = "Content Protection",
 	[IGT_CONNECTOR_VRR_CAPABLE] = "vrr_capable",
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
+	[IGT_CONNECTOR_HDCP_TOPOLOGY_INFO] = "HDCP Topology",
 };
 
 /*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index d281c4931b83..78b8920128ff 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -124,6 +124,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_CONTENT_PROTECTION,
        IGT_CONNECTOR_VRR_CAPABLE,
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
+       IGT_CONNECTOR_HDCP_TOPOLOGY_INFO,
        IGT_NUM_CONNECTOR_PROPS
 };
 
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index abbecc4b0c56..cf2e56543073 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -58,6 +58,116 @@ struct data {
 #define FLIP_EVENT_POLLING_TIMEOUT_MSEC		1000
 
 
+#define DRM_MODE_HDCP_KSV_LEN			5
+#define DRM_MODE_HDCP_MAX_DEVICE_CNT		127
+
+#define DRM_MODE_HDCP14_IN_FORCE		(1<<0)
+#define DRM_MODE_HDCP22_IN_FORCE		(1<<1)
+
+struct hdcp_topology_info {
+
+	/* HDCP ver in force */
+	__u32 ver_in_force;
+	__u8 content_type;
+
+	/* KSV of immediate HDCP Sink. In Little-Endian Format. */
+	char bksv[DRM_MODE_HDCP_KSV_LEN];
+
+	/* Whether Immediate HDCP sink is a repeater? */
+	bool is_repeater;
+
+	/* Depth received from immediate downstream repeater */
+	__u8 depth;
+
+	/* Device count received from immediate downstream repeater */
+	__u32 device_count;
+
+	/*
+	 * Max buffer required to hold ksv list received from immediate
+	 * repeater. In this array first device_count * DRM_MODE_HDCP_KSV_LEN
+	 * will hold the valid ksv bytes.
+	 * If authentication specification is
+	 *      HDCP1.4 - each KSV's Bytes will be in Little-Endian format.
+	 *      HDCP2.2 - each KSV's Bytes will be in Big-Endian format.
+	 */
+	char ksv_list[DRM_MODE_HDCP_KSV_LEN * DRM_MODE_HDCP_MAX_DEVICE_CNT];
+};
+
+
+__u8 facsimile_srm[] = {
+	0x80, 0x0, 0x0, 0x05, 0x01, 0x0, 0x0, 0x36, 0x02, 0x51, 0x1E, 0xF2,
+	0x1A, 0xCD, 0xE7, 0x26, 0x97, 0xF4, 0x01, 0x97, 0x10, 0x19, 0x92, 0x53,
+	0xE9, 0xF0, 0x59, 0x95, 0xA3, 0x7A, 0x3B, 0xFE, 0xE0, 0x9C, 0x76, 0xDD,
+	0x83, 0xAA, 0xC2, 0x5B, 0x24, 0xB3, 0x36, 0x84, 0x94, 0x75, 0x34, 0xDB,
+	0x10, 0x9E, 0x3B, 0x23, 0x13, 0xD8, 0x7A, 0xC2, 0x30, 0x79, 0x84};
+
+static void parse_topology_info(struct hdcp_topology_info *ds_info)
+{
+	char *ksvs;
+	int i;
+
+	if (ds_info->ver_in_force & DRM_MODE_HDCP14_IN_FORCE)
+		igt_info("HDCP1.4 is Enabled\n");
+	else if (ds_info->ver_in_force & DRM_MODE_HDCP22_IN_FORCE)
+		igt_info("HDCP2.2 is Enabled. Type%d\n",
+			 ds_info->content_type & HDCP_CONTENT_TYPE_1 ?
+			 1 : 0);
+	else
+		return;
+
+	igt_info("\tReceiver ID: %#04x %#04x %#04x %#04x %#04x\n",
+			ds_info->bksv[0] & 0xFF, ds_info->bksv[1] & 0xFF,
+			ds_info->bksv[2] & 0xFF, ds_info->bksv[3] & 0xFF,
+			ds_info->bksv[4] & 0xFF);
+
+	if (ds_info->is_repeater) {
+		igt_info("\tHDCP sink is a Repeater\n");
+
+		igt_info("\tDepth: %d, Device count: %d\n", ds_info->depth,
+							ds_info->device_count);
+		ksvs = ds_info->ksv_list;
+
+		for (i = 0; i < ds_info->device_count; i++) {
+			igt_info("\tksv-%d: %#04x %#04x %#04x %#04x %#04x\n", i,
+					ksvs[0] & 0xFF, ksvs[1] & 0xFF,
+					ksvs[2] & 0xFF, ksvs[3] & 0xFF,
+					ksvs[4] & 0xFF);
+			ksvs += DRM_MODE_HDCP_KSV_LEN;
+		}
+	} else {
+		igt_info("\tHDCP sink is a Receiver\n");
+	}
+}
+
+static void retrieve_topology_info_prepare_srm(igt_output_t *output)
+{
+	drmModePropertyBlobRes *ds_info_prop = NULL;
+	uint64_t topology_blob_id;
+	struct hdcp_topology_info *ds_info;
+	int i;
+
+	igt_info("HDCP topology property is attached\n");
+
+	topology_blob_id = igt_output_get_prop(output,
+				IGT_CONNECTOR_HDCP_TOPOLOGY_INFO);
+
+	igt_assert_f(topology_blob_id,
+				"Invalid topology blob id\n");
+
+	ds_info_prop = drmModeGetPropertyBlob(data.drm_fd,
+						topology_blob_id);
+
+	igt_assert(ds_info_prop);
+	igt_assert_eq(ds_info_prop->length,
+				sizeof(struct hdcp_topology_info));
+	ds_info = ds_info_prop->data;
+
+	parse_topology_info(ds_info);
+
+	for (i = 0; i < 5; i++)
+		facsimile_srm[i + 9] = ds_info->bksv[i];
+}
+
 static void flip_handler(int fd, unsigned int sequence, unsigned int tv_sec,
 			 unsigned int tv_usec, void *_data)
 {
@@ -355,7 +465,7 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
 static void test_cp_enable_with_retry(igt_output_t *output,
 				      enum igt_commit_style s, int retry,
 				      int content_type, bool expect_failure,
-				      bool test_type_change)
+				      bool test_type_change, bool test_srm)
 {
 	int retry_orig = retry;
 	bool ret;
@@ -373,6 +483,9 @@ static void test_cp_enable_with_retry(igt_output_t *output,
 	if (expect_failure)
 		igt_assert_f(!ret,
 			     "CP Enabled. Though it is expected to fail\n");
+	else if (test_srm)
+		igt_assert_f(!ret,
+			     "CP Enabled. Though ID is revoked through SRM\n");
 	else
 		igt_assert_f(ret, "Content Protection not enabled\n");
 }
@@ -397,15 +510,31 @@ static void test_cp_lic(igt_output_t *output)
 	igt_assert_f(!ret, "Content Protection LIC Failed\n");
 }
 
+static bool write_srm_into_sysfs(const char *srm, int len)
+{
+	int fd;
+	bool ret = false;
+
+	fd = igt_sysfs_open(data.drm_fd, NULL);
+	if (fd > 0) {
+		if (igt_sysfs_write(fd, "hdcp_srm", srm, len) == len)
+			ret = true;
+		close(fd);
+	}
+	return ret;
+}
+
 static void
 test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 				  bool dpms_test, int content_type,
-				  bool mei_reload_test, bool test_type_change)
+				  bool mei_reload_test, bool test_type_change,
+				  bool test_srm)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
 	enum pipe pipe;
-	bool ret;
+	bool ret, srm_modified = false;
+	int i;
 
 	for_each_pipe(display, pipe) {
 		if (!igt_pipe_connector_valid(pipe, output))
@@ -420,13 +549,15 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 		if (!igt_pipe_is_free(display, pipe))
 			continue;
 
+		srm_modified = false;
 		modeset_with_fb(pipe, output, s);
 		test_cp_enable_with_retry(output, s, 3, content_type, false,
-					  false);
+					  false, false);
+
 		if (test_type_change && content_type == HDCP_CONTENT_TYPE_1)
 			test_cp_enable_with_retry(output, s, 3,
 						  HDCP_CONTENT_TYPE_0, false,
-						  test_type_change);
+						  test_type_change, false);
 
 		if (mei_reload_test) {
 			igt_assert_f(!igt_kmod_unload("mei_hdcp", 0),
@@ -434,18 +565,47 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 
 			/* Expected to fail */
 			test_cp_enable_with_retry(output, s, 3,
-						  content_type, true, false);
+						  content_type, true, false,
+						  false);
 
 			igt_assert_f(!igt_kmod_load("mei_hdcp", NULL),
 				     "mei_hdcp load failed");
 
 			/* Expected to pass */
 			test_cp_enable_with_retry(output, s, 3,
-						  content_type, false, false);
+						  content_type, false, false,
+						  false);
 		}
 
 		test_cp_lic(output);
 
+		if (output->props[IGT_CONNECTOR_HDCP_TOPOLOGY_INFO] &&
+		    test_srm) {
+			retrieve_topology_info_prepare_srm(output);
+			srm_modified =
+				write_srm_into_sysfs((const char *)facsimile_srm,
+						     sizeof(facsimile_srm));
+			igt_assert_f(srm_modified, "SRM update failed");
+		}
+
+		if (test_srm && srm_modified) {
+			test_cp_disable(output, s);
+			test_cp_enable_with_retry(output, s, 3, content_type,
+						  false, false, test_srm);
+
+			/* Removing the sink's Receiver ID from SRM Blob */
+			for (i = 0; i < 5; i++)
+				facsimile_srm[i + 9] = 0;
+
+			srm_modified =
+				write_srm_into_sysfs((const char *)facsimile_srm,
+						     sizeof(facsimile_srm));
+			igt_assert_f(srm_modified, "SRM update failed");
+
+			test_cp_enable_with_retry(output, s, 1, content_type,
+						  false, false, false);
+		}
+
 		if (dpms_test) {
 			igt_pipe_set_prop_value(display, pipe,
 						IGT_CRTC_ACTIVE, 0);
@@ -460,7 +620,7 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 			if (!ret)
 				test_cp_enable_with_retry(output, s, 2,
 							  content_type, false,
-							  false);
+							  false, false);
 		}
 
 		test_cp_disable(output, s);
@@ -526,7 +686,7 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 static void
 test_content_protection(enum igt_commit_style s, bool dpms_test,
 			int content_type, bool mei_reload_test,
-			bool test_type_change)
+			bool test_type_change, bool test_srm)
 {
 	igt_display_t *display = &data.display;
 	igt_output_t *output;
@@ -557,9 +717,8 @@ test_content_protection(enum igt_commit_style s, bool dpms_test,
 		}
 
 		test_content_protection_on_output(output, s, dpms_test,
-						  content_type,
-						  mei_reload_test,
-						  test_type_change);
+						  content_type, mei_reload_test,
+						  test_type_change, test_srm);
 		valid_tests++;
 	}
 
@@ -579,33 +738,33 @@ igt_main
 	igt_subtest("legacy")
 		test_content_protection(COMMIT_LEGACY, false,
 					HDCP_CONTENT_TYPE_0, false,
-					false);
+					false, false);
 
 	igt_subtest("atomic") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_0, false,
+					HDCP_CONTENT_TYPE_0, false, false,
 					false);
 	}
 
 	igt_subtest("atomic-dpms") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, true,
-					HDCP_CONTENT_TYPE_0, false,
+					HDCP_CONTENT_TYPE_0, false, false,
 					false);
 	}
 
 	igt_subtest("type1") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, false,
+					HDCP_CONTENT_TYPE_1, false, false,
 					false);
 	}
 
 	igt_subtest("type1_mei_interface") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, true,
+					HDCP_CONTENT_TYPE_1, true, false,
 					false);
 	}
 
@@ -613,9 +772,36 @@ igt_main
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
 					HDCP_CONTENT_TYPE_1, false,
-					true);
+					true, false);
+	}
+
+	/*
+	 * SRM subtest perform the HDCP authentication, and then retrive the
+	 * receiver id through topology info.
+	 *
+	 * Using the receiver ID, facsimile SRM table is modified with
+	 * receiver ID retrieved from teh topology info. After modification
+	 * SRM table is not intact as per DCP Signature.
+	 *
+	 * But Kernel believes userspace and doesn't verify the DCP signature.
+	 * So we can exploite that trust to test the SRM and topology info
+	 * features.
+	 *
+	 * So when modified SRM is applied Authentication will fail due to
+	 * receiver ID revocation.
+	 *
+	 * And Kernel attempts HDCP2.2 always and on failure of it HDCP1.4
+	 * will be attempted. But their ID of the sink varies between 1.4 and
+	 * 2.2 versions. So we need to stick to one version. Hence HDCP2.2 is
+	 * choosen using Type 1.
+	 */
+	igt_subtest("srm") {
+		igt_require(data.display.is_atomic);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_1, false, false, true);
 	}
 
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
-- 
2.19.1

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

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

* [igt-dev] [PATCH i-g-t v3 6/6] DO NOT MERGE: CP in fast feedback list
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (4 preceding siblings ...)
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 5/6] kms_content_protection: srm and topology_info test Ramalingam C
@ 2019-03-21 15:55 ` Ramalingam C
  2019-03-21 16:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for HDCP2.2 Tests (rev2) Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 15:55 UTC (permalink / raw)
  To: igt-dev, daniel

For adding the HDCP tests into fastfeedback list

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 tests/intel-ci/fast-feedback.testlist | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 9b71194670da..00450c52f80c 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -184,6 +184,9 @@ igt@kms_chamelium@hdmi-crc-fast
 igt@kms_chamelium@vga-hpd-fast
 igt@kms_chamelium@vga-edid-read
 igt@kms_chamelium@common-hpd-after-suspend
+igt@kms_content_protection@legacy
+igt@kms_content_protection@atomic
+igt@kms_content_protection@srm
 igt@kms_prop_blob@basic
 igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic
 igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy
-- 
2.19.1

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for HDCP2.2 Tests (rev2)
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (5 preceding siblings ...)
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
@ 2019-03-21 16:01 ` Patchwork
  2019-03-21 18:30 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev3) Patchwork
  2019-03-22 10:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  8 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-03-21 16:01 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev

== Series Details ==

Series: HDCP2.2 Tests (rev2)
URL   : https://patchwork.freedesktop.org/series/57756/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
0f9c061247fb7aba21c9459f19f437927a28f32c tests/kms_plane_scaling: Ensure minimum height and width for planar uyv formats

[114/772] Linking target lib/libigt.so.
[115/772] Generating symbol file 'lib/lib@@igt@sha/libigt.so.symbols'.
[116/772] Linking target tests/kms_fbcon_fbt.
[117/772] Linking target lib/tests/igt_can_fail_simple.
[118/772] Linking target lib/tests/igt_exit_handler.
[119/772] Linking target lib/tests/igt_assert.
[120/772] Linking target lib/tests/igt_can_fail.
[121/772] Linking target tests/kms_rmfb.
[122/772] Linking target lib/tests/igt_fork.
[123/772] Linking target lib/tests/igt_invalid_subtest_name.
[124/772] Linking target lib/tests/igt_hdmi_inject.
[125/772] Linking target lib/tests/igt_fork_helper.
[126/772] Linking target lib/tests/igt_list_only.
[127/772] Linking target lib/tests/igt_no_exit.
[128/772] Linking target lib/tests/igt_segfault.
[129/772] Linking target lib/tests/igt_simulation.
[130/772] Linking target lib/tests/igt_stats.
[131/772] Linking target lib/tests/igt_subtest_group.
[132/772] Linking target lib/tests/igt_no_subtest.
[133/772] Linking target lib/tests/igt_simple_test_subtests.
[134/772] Linking target lib/tests/igt_timeout.
[135/772] Linking target tests/core_getclient.
[136/772] Linking target tests/core_auth.
[137/772] Linking target tests/core_getstats.
[138/772] Linking target tests/debugfs_test.
[139/772] Linking target tests/core_setmaster_vs_auth.
[140/772] Linking target tests/core_getversion.
[141/772] Linking target tests/drm_import_export.
[142/772] Linking target tests/drm_mm.
[143/772] Linking target tests/drm_read.
[144/772] Linking target tests/kms_3d.
[145/772] Linking target tests/kms_atomic.
[146/772] Linking target tests/kms_addfb_basic.
[147/772] Linking target tests/kms_atomic_interruptible.
[148/772] Linking target tests/kms_ccs.
[149/772] Linking target tests/kms_atomic_transition.
[150/772] Linking target tests/kms_available_modes_crc.
[151/772] Linking target tests/kms_busy.
[152/772] Compiling C object 'tests/tests@@kms_content_protection@exe/kms_content_protection.c.o'.
FAILED: tests/tests@@kms_content_protection@exe/kms_content_protection.c.o 
ccache cc -Itests/tests@@kms_content_protection@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/igt/include -I/opt/igt/include/libdrm -I/usr/include/x86_64-linux-gnu -I/usr/include -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -D_GNU_SOURCE -include config.h -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -pthread  -MD -MQ 'tests/tests@@kms_content_protection@exe/kms_content_protection.c.o' -MF 'tests/tests@@kms_content_protection@exe/kms_content_protection.c.o.d' -o 'tests/tests@@kms_content_protection@exe/kms_content_protection.c.o' -c ../tests/kms_content_protection.c
../tests/kms_content_protection.c: In function ‘write_srm_into_sysfs’:
../tests/kms_content_protection.c:518:7: error: too many arguments to function ‘igt_sysfs_open’
  fd = igt_sysfs_open(data.drm_fd, NULL);
       ^~~~~~~~~~~~~~
In file included from ../tests/kms_content_protection.c:31:0:
../lib/igt_sysfs.h:32:5: note: declared here
 int igt_sysfs_open(int device);
     ^~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

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

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

* [igt-dev] [PATCH i-g-t v4 5/6] kms_content_protection: srm and topology_info test
  2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 5/6] kms_content_protection: srm and topology_info test Ramalingam C
@ 2019-03-21 17:44   ` Ramalingam C
  0 siblings, 0 replies; 11+ messages in thread
From: Ramalingam C @ 2019-03-21 17:44 UTC (permalink / raw)
  To: igt-dev, daniel

Retrieve the topology info and use that to stitch a srm and
verify the revocation process.

Adds a connector properties called "HDCP Topology"

SRM stitched here is polluted. Kernel trusts the userspace to validate
the SRM integrity through DCP signature. Actually this test exploits
that trust to test SRM and downstream_info features.

HDCP1.4 BKSV and HDCP2.2 receiver id of a HDCP sink is different. So we
need to force the KMD to use a single HDCP version across
downstream_info gathering and SRM setting and verifying teh revocation
process. So Type 1 is used.

v2:
  binary sysfs is used to write the srm into kernel [Daniel]
v3:
  s/CP_downstream_info/HDCP Topology
v4:
  Rebased.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 lib/igt_kms.c                  |   1 +
 lib/igt_kms.h                  |   1 +
 tests/kms_content_protection.c | 222 ++++++++++++++++++++++++++++++---
 3 files changed, 206 insertions(+), 18 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 63962e958455..3b897164630f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -202,6 +202,7 @@ const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	[IGT_CONNECTOR_CONTENT_PROTECTION] = "Content Protection",
 	[IGT_CONNECTOR_VRR_CAPABLE] = "vrr_capable",
 	[IGT_CONNECTOR_HDCP_CONTENT_TYPE] = "HDCP Content Type",
+	[IGT_CONNECTOR_HDCP_TOPOLOGY_INFO] = "HDCP Topology",
 };
 
 /*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index d281c4931b83..78b8920128ff 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -124,6 +124,7 @@ enum igt_atomic_connector_properties {
        IGT_CONNECTOR_CONTENT_PROTECTION,
        IGT_CONNECTOR_VRR_CAPABLE,
        IGT_CONNECTOR_HDCP_CONTENT_TYPE,
+       IGT_CONNECTOR_HDCP_TOPOLOGY_INFO,
        IGT_NUM_CONNECTOR_PROPS
 };
 
diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index abbecc4b0c56..1c2b263a253e 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -58,6 +58,116 @@ struct data {
 #define FLIP_EVENT_POLLING_TIMEOUT_MSEC		1000
 
 
+#define DRM_MODE_HDCP_KSV_LEN			5
+#define DRM_MODE_HDCP_MAX_DEVICE_CNT		127
+
+#define DRM_MODE_HDCP14_IN_FORCE		(1<<0)
+#define DRM_MODE_HDCP22_IN_FORCE		(1<<1)
+
+struct hdcp_topology_info {
+
+	/* HDCP ver in force */
+	__u32 ver_in_force;
+	__u8 content_type;
+
+	/* KSV of immediate HDCP Sink. In Little-Endian Format. */
+	char bksv[DRM_MODE_HDCP_KSV_LEN];
+
+	/* Whether Immediate HDCP sink is a repeater? */
+	bool is_repeater;
+
+	/* Depth received from immediate downstream repeater */
+	__u8 depth;
+
+	/* Device count received from immediate downstream repeater */
+	__u32 device_count;
+
+	/*
+	 * Max buffer required to hold ksv list received from immediate
+	 * repeater. In this array first device_count * DRM_MODE_HDCP_KSV_LEN
+	 * will hold the valid ksv bytes.
+	 * If authentication specification is
+	 *      HDCP1.4 - each KSV's Bytes will be in Little-Endian format.
+	 *      HDCP2.2 - each KSV's Bytes will be in Big-Endian format.
+	 */
+	char ksv_list[DRM_MODE_HDCP_KSV_LEN * DRM_MODE_HDCP_MAX_DEVICE_CNT];
+};
+
+
+__u8 facsimile_srm[] = {
+	0x80, 0x0, 0x0, 0x05, 0x01, 0x0, 0x0, 0x36, 0x02, 0x51, 0x1E, 0xF2,
+	0x1A, 0xCD, 0xE7, 0x26, 0x97, 0xF4, 0x01, 0x97, 0x10, 0x19, 0x92, 0x53,
+	0xE9, 0xF0, 0x59, 0x95, 0xA3, 0x7A, 0x3B, 0xFE, 0xE0, 0x9C, 0x76, 0xDD,
+	0x83, 0xAA, 0xC2, 0x5B, 0x24, 0xB3, 0x36, 0x84, 0x94, 0x75, 0x34, 0xDB,
+	0x10, 0x9E, 0x3B, 0x23, 0x13, 0xD8, 0x7A, 0xC2, 0x30, 0x79, 0x84};
+
+static void parse_topology_info(struct hdcp_topology_info *ds_info)
+{
+	char *ksvs;
+	int i;
+
+	if (ds_info->ver_in_force & DRM_MODE_HDCP14_IN_FORCE)
+		igt_info("HDCP1.4 is Enabled\n");
+	else if (ds_info->ver_in_force & DRM_MODE_HDCP22_IN_FORCE)
+		igt_info("HDCP2.2 is Enabled. Type%d\n",
+			 ds_info->content_type & HDCP_CONTENT_TYPE_1 ?
+			 1 : 0);
+	else
+		return;
+
+	igt_info("\tReceiver ID: %#04x %#04x %#04x %#04x %#04x\n",
+			ds_info->bksv[0] & 0xFF, ds_info->bksv[1] & 0xFF,
+			ds_info->bksv[2] & 0xFF, ds_info->bksv[3] & 0xFF,
+			ds_info->bksv[4] & 0xFF);
+
+	if (ds_info->is_repeater) {
+		igt_info("\tHDCP sink is a Repeater\n");
+
+		igt_info("\tDepth: %d, Device count: %d\n", ds_info->depth,
+							ds_info->device_count);
+		ksvs = ds_info->ksv_list;
+
+		for (i = 0; i < ds_info->device_count; i++) {
+			igt_info("\tksv-%d: %#04x %#04x %#04x %#04x %#04x\n", i,
+					ksvs[0] & 0xFF, ksvs[1] & 0xFF,
+					ksvs[2] & 0xFF, ksvs[3] & 0xFF,
+					ksvs[4] & 0xFF);
+			ksvs += DRM_MODE_HDCP_KSV_LEN;
+		}
+	} else {
+		igt_info("\tHDCP sink is a Receiver\n");
+	}
+}
+
+static void retrieve_topology_info_prepare_srm(igt_output_t *output)
+{
+	drmModePropertyBlobRes *ds_info_prop = NULL;
+	uint64_t topology_blob_id;
+	struct hdcp_topology_info *ds_info;
+	int i;
+
+	igt_info("HDCP topology property is attached\n");
+
+	topology_blob_id = igt_output_get_prop(output,
+				IGT_CONNECTOR_HDCP_TOPOLOGY_INFO);
+
+	igt_assert_f(topology_blob_id,
+				"Invalid topology blob id\n");
+
+	ds_info_prop = drmModeGetPropertyBlob(data.drm_fd,
+						topology_blob_id);
+
+	igt_assert(ds_info_prop);
+	igt_assert_eq(ds_info_prop->length,
+				sizeof(struct hdcp_topology_info));
+	ds_info = ds_info_prop->data;
+
+	parse_topology_info(ds_info);
+
+	for (i = 0; i < 5; i++)
+		facsimile_srm[i + 9] = ds_info->bksv[i];
+}
+
 static void flip_handler(int fd, unsigned int sequence, unsigned int tv_sec,
 			 unsigned int tv_usec, void *_data)
 {
@@ -355,7 +465,7 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
 static void test_cp_enable_with_retry(igt_output_t *output,
 				      enum igt_commit_style s, int retry,
 				      int content_type, bool expect_failure,
-				      bool test_type_change)
+				      bool test_type_change, bool test_srm)
 {
 	int retry_orig = retry;
 	bool ret;
@@ -373,6 +483,9 @@ static void test_cp_enable_with_retry(igt_output_t *output,
 	if (expect_failure)
 		igt_assert_f(!ret,
 			     "CP Enabled. Though it is expected to fail\n");
+	else if (test_srm)
+		igt_assert_f(!ret,
+			     "CP Enabled. Though ID is revoked through SRM\n");
 	else
 		igt_assert_f(ret, "Content Protection not enabled\n");
 }
@@ -397,15 +510,31 @@ static void test_cp_lic(igt_output_t *output)
 	igt_assert_f(!ret, "Content Protection LIC Failed\n");
 }
 
+static bool write_srm_into_sysfs(const char *srm, int len)
+{
+	int fd;
+	bool ret = false;
+
+	fd = igt_sysfs_open(data.drm_fd);
+	if (fd > 0) {
+		if (igt_sysfs_write(fd, "hdcp_srm", srm, len) == len)
+			ret = true;
+		close(fd);
+	}
+	return ret;
+}
+
 static void
 test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 				  bool dpms_test, int content_type,
-				  bool mei_reload_test, bool test_type_change)
+				  bool mei_reload_test, bool test_type_change,
+				  bool test_srm)
 {
 	igt_display_t *display = &data.display;
 	igt_plane_t *primary;
 	enum pipe pipe;
-	bool ret;
+	bool ret, srm_modified = false;
+	int i;
 
 	for_each_pipe(display, pipe) {
 		if (!igt_pipe_connector_valid(pipe, output))
@@ -420,13 +549,15 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 		if (!igt_pipe_is_free(display, pipe))
 			continue;
 
+		srm_modified = false;
 		modeset_with_fb(pipe, output, s);
 		test_cp_enable_with_retry(output, s, 3, content_type, false,
-					  false);
+					  false, false);
+
 		if (test_type_change && content_type == HDCP_CONTENT_TYPE_1)
 			test_cp_enable_with_retry(output, s, 3,
 						  HDCP_CONTENT_TYPE_0, false,
-						  test_type_change);
+						  test_type_change, false);
 
 		if (mei_reload_test) {
 			igt_assert_f(!igt_kmod_unload("mei_hdcp", 0),
@@ -434,18 +565,47 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 
 			/* Expected to fail */
 			test_cp_enable_with_retry(output, s, 3,
-						  content_type, true, false);
+						  content_type, true, false,
+						  false);
 
 			igt_assert_f(!igt_kmod_load("mei_hdcp", NULL),
 				     "mei_hdcp load failed");
 
 			/* Expected to pass */
 			test_cp_enable_with_retry(output, s, 3,
-						  content_type, false, false);
+						  content_type, false, false,
+						  false);
 		}
 
 		test_cp_lic(output);
 
+		if (output->props[IGT_CONNECTOR_HDCP_TOPOLOGY_INFO] &&
+		    test_srm) {
+			retrieve_topology_info_prepare_srm(output);
+			srm_modified =
+				write_srm_into_sysfs((const char *)facsimile_srm,
+						     sizeof(facsimile_srm));
+			igt_assert_f(srm_modified, "SRM update failed");
+		}
+
+		if (test_srm && srm_modified) {
+			test_cp_disable(output, s);
+			test_cp_enable_with_retry(output, s, 3, content_type,
+						  false, false, test_srm);
+
+			/* Removing the sink's Receiver ID from SRM Blob */
+			for (i = 0; i < 5; i++)
+				facsimile_srm[i + 9] = 0;
+
+			srm_modified =
+				write_srm_into_sysfs((const char *)facsimile_srm,
+						     sizeof(facsimile_srm));
+			igt_assert_f(srm_modified, "SRM update failed");
+
+			test_cp_enable_with_retry(output, s, 1, content_type,
+						  false, false, false);
+		}
+
 		if (dpms_test) {
 			igt_pipe_set_prop_value(display, pipe,
 						IGT_CRTC_ACTIVE, 0);
@@ -460,7 +620,7 @@ test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
 			if (!ret)
 				test_cp_enable_with_retry(output, s, 2,
 							  content_type, false,
-							  false);
+							  false, false);
 		}
 
 		test_cp_disable(output, s);
@@ -526,7 +686,7 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 static void
 test_content_protection(enum igt_commit_style s, bool dpms_test,
 			int content_type, bool mei_reload_test,
-			bool test_type_change)
+			bool test_type_change, bool test_srm)
 {
 	igt_display_t *display = &data.display;
 	igt_output_t *output;
@@ -557,9 +717,8 @@ test_content_protection(enum igt_commit_style s, bool dpms_test,
 		}
 
 		test_content_protection_on_output(output, s, dpms_test,
-						  content_type,
-						  mei_reload_test,
-						  test_type_change);
+						  content_type, mei_reload_test,
+						  test_type_change, test_srm);
 		valid_tests++;
 	}
 
@@ -579,33 +738,33 @@ igt_main
 	igt_subtest("legacy")
 		test_content_protection(COMMIT_LEGACY, false,
 					HDCP_CONTENT_TYPE_0, false,
-					false);
+					false, false);
 
 	igt_subtest("atomic") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_0, false,
+					HDCP_CONTENT_TYPE_0, false, false,
 					false);
 	}
 
 	igt_subtest("atomic-dpms") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, true,
-					HDCP_CONTENT_TYPE_0, false,
+					HDCP_CONTENT_TYPE_0, false, false,
 					false);
 	}
 
 	igt_subtest("type1") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, false,
+					HDCP_CONTENT_TYPE_1, false, false,
 					false);
 	}
 
 	igt_subtest("type1_mei_interface") {
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
-					HDCP_CONTENT_TYPE_1, true,
+					HDCP_CONTENT_TYPE_1, true, false,
 					false);
 	}
 
@@ -613,9 +772,36 @@ igt_main
 		igt_require(data.display.is_atomic);
 		test_content_protection(COMMIT_ATOMIC, false,
 					HDCP_CONTENT_TYPE_1, false,
-					true);
+					true, false);
+	}
+
+	/*
+	 * SRM subtest perform the HDCP authentication, and then retrive the
+	 * receiver id through topology info.
+	 *
+	 * Using the receiver ID, facsimile SRM table is modified with
+	 * receiver ID retrieved from teh topology info. After modification
+	 * SRM table is not intact as per DCP Signature.
+	 *
+	 * But Kernel believes userspace and doesn't verify the DCP signature.
+	 * So we can exploite that trust to test the SRM and topology info
+	 * features.
+	 *
+	 * So when modified SRM is applied Authentication will fail due to
+	 * receiver ID revocation.
+	 *
+	 * And Kernel attempts HDCP2.2 always and on failure of it HDCP1.4
+	 * will be attempted. But their ID of the sink varies between 1.4 and
+	 * 2.2 versions. So we need to stick to one version. Hence HDCP2.2 is
+	 * choosen using Type 1.
+	 */
+	igt_subtest("srm") {
+		igt_require(data.display.is_atomic);
+		test_content_protection(COMMIT_ATOMIC, false,
+					HDCP_CONTENT_TYPE_1, false, false, true);
 	}
 
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
-- 
2.19.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev3)
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (6 preceding siblings ...)
  2019-03-21 16:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for HDCP2.2 Tests (rev2) Patchwork
@ 2019-03-21 18:30 ` Patchwork
  2019-03-22 10:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  8 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-03-21 18:30 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev

== Series Details ==

Series: HDCP2.2 Tests (rev3)
URL   : https://patchwork.freedesktop.org/series/57756/
State : success

== Summary ==

CI Bug Log - changes from IGT_4897 -> IGTPW_2685
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/57756/revisions/3/mbox/

New tests
---------

  New tests have been introduced between IGT_4897 and IGTPW_2685:

### New IGT tests (1) ###

  * igt@kms_content_protection@srm:
    - Statuses : 33 skip(s)
    - Exec time: [0.0, 0.00] s

  

Known issues
------------

  Here are the changes found in IGTPW_2685 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_param@basic:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] +109

  * igt@gem_exec_basic@gtt-bsd1:
    - fi-bxt-j4205:       NOTRUN -> SKIP [fdo#109271] +50

  * igt@gem_exec_store@basic-bsd2:
    - fi-hsw-4770:        NOTRUN -> SKIP [fdo#109271] +44

  * igt@i915_module_load@reload:
    - fi-skl-6770hq:      PASS -> DMESG-WARN [fdo#108529] +2

  * igt@kms_busy@basic-flip-a:
    - fi-bsw-n3050:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_busy@basic-flip-c:
    - fi-gdg-551:         NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_chamelium@dp-edid-read:
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] +59

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-bsw-n3050:       NOTRUN -> SKIP [fdo#109271] +65

  * igt@kms_content_protection@atomic:
    - fi-hsw-4770r:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-gvtdvm:      NOTRUN -> FAIL [fdo#108597] / [fdo#108739] +1
    - fi-skl-6770hq:      NOTRUN -> SKIP [fdo#109271] +1
    - fi-elk-e7500:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-6600u:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-whl-u:           NOTRUN -> SKIP [fdo#109271] +2
    - fi-cfl-8700k:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-pnv-d510:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-apl-guc:         NOTRUN -> FAIL [fdo#108597] / [fdo#108739] +1

  * igt@kms_content_protection@legacy:
    - fi-ivb-3770:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-ilk-650:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-cfl-guc:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-6770hq:      NOTRUN -> FAIL [fdo#108597] / [fdo#108739]
    - fi-kbl-r:           NOTRUN -> SKIP [fdo#109271] +2
    - fi-kbl-8809g:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-cfl-8109u:       NOTRUN -> FAIL [fdo#108739] +1
    - fi-kbl-guc:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-bdw-gvtdvm:      NOTRUN -> SKIP [fdo#109271] +2

  * {igt@kms_content_protection@srm} (NEW):
    - fi-skl-iommu:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-6260u:       NOTRUN -> SKIP [fdo#109271]
    - fi-skl-gvtdvm:      NOTRUN -> SKIP [fdo#109271]
    - fi-kbl-x1275:       NOTRUN -> SKIP [fdo#109271]
    - fi-cfl-8109u:       NOTRUN -> SKIP [fdo#109271]
    - fi-bwr-2160:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-guc:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-bdw-5557u:       NOTRUN -> SKIP [fdo#109271] +2
    - {fi-skl-lmem}:      NOTRUN -> SKIP [fdo#109271]
    - fi-apl-guc:         NOTRUN -> SKIP [fdo#109271]
    - fi-skl-6700k2:      NOTRUN -> SKIP [fdo#109271]

  * igt@kms_flip@basic-flip-vs-dpms:
    - fi-skl-6770hq:      PASS -> SKIP [fdo#109271] +33

  * igt@kms_pipe_crc_basic@bad-source:
    - fi-skl-6770hq:      PASS -> DMESG-WARN [fdo#108833]

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
    - fi-blb-e6850:       PASS -> INCOMPLETE [fdo#107718]

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-bsw-kefka:       DMESG-WARN [fdo#107407] -> PASS

  * igt@i915_selftest@live_uncore:
    - fi-skl-gvtdvm:      DMESG-FAIL [fdo#110210] -> PASS
    - fi-ivb-3770:        DMESG-FAIL [fdo#110210] -> PASS

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#107407]: https://bugs.freedesktop.org/show_bug.cgi?id=107407
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#108529]: https://bugs.freedesktop.org/show_bug.cgi?id=108529
  [fdo#108597]: https://bugs.freedesktop.org/show_bug.cgi?id=108597
  [fdo#108739]: https://bugs.freedesktop.org/show_bug.cgi?id=108739
  [fdo#108833]: https://bugs.freedesktop.org/show_bug.cgi?id=108833
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#110210]: https://bugs.freedesktop.org/show_bug.cgi?id=110210


Participating hosts (37 -> 35)
------------------------------

  Additional (6): fi-bsw-n3050 fi-hsw-4770 fi-bxt-j4205 fi-gdg-551 fi-skl-lmem fi-byt-n2820 
  Missing    (8): fi-kbl-7567u fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


Build changes
-------------

    * IGT: IGT_4897 -> IGTPW_2685

  CI_DRM_5789: 93b3614e8c493860dc63c3028460efb02036c6ea @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2685: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2685/
  IGT_4897: e12d69496a6bef09ac6c0f792b8d60a65cf5e0bf @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_content_protection@content_type_change
+igt@kms_content_protection@srm
+igt@kms_content_protection@type1
+igt@kms_content_protection@type1_mei_interface

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2685/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for HDCP2.2 Tests (rev3)
  2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
                   ` (7 preceding siblings ...)
  2019-03-21 18:30 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev3) Patchwork
@ 2019-03-22 10:55 ` Patchwork
  8 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2019-03-22 10:55 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev

== Series Details ==

Series: HDCP2.2 Tests (rev3)
URL   : https://patchwork.freedesktop.org/series/57756/
State : success

== Summary ==

CI Bug Log - changes from IGT_4897_full -> IGTPW_2685_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/57756/revisions/3/mbox/

New tests
---------

  New tests have been introduced between IGT_4897_full and IGTPW_2685_full:

### New IGT tests (4) ###

  * igt@kms_content_protection@content_type_change:
    - Statuses : 4 skip(s)
    - Exec time: [0.0] s

  * igt@kms_content_protection@srm:
    - Statuses : 4 skip(s)
    - Exec time: [0.0] s

  * igt@kms_content_protection@type1:
    - Statuses : 4 skip(s)
    - Exec time: [0.0] s

  * igt@kms_content_protection@type1_mei_interface:
    - Statuses : 4 skip(s)
    - Exec time: [0.00] s

  

Known issues
------------

  Here are the changes found in IGTPW_2685_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_schedule@preempt-other-chain-blt:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +37

  * igt@kms_atomic_transition@3x-modeset-transitions-fencing:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
    - shard-kbl:          PASS -> DMESG-WARN [fdo#110222]

  * igt@kms_busy@extended-modeset-hang-oldfb-render-e:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +6

  * igt@kms_color@pipe-b-ctm-max:
    - shard-glk:          NOTRUN -> FAIL [fdo#108147]

  * igt@kms_concurrent@pipe-d:
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * {igt@kms_content_protection@type1_mei_interface} (NEW):
    - shard-kbl:          NOTRUN -> SKIP [fdo#109271] +11

  * igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
    - shard-glk:          PASS -> FAIL [fdo#105454] / [fdo#106509]

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-wc:
    - shard-apl:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-fullscreen:
    - shard-apl:          NOTRUN -> SKIP [fdo#109271] +15

  * igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-mmap-cpu:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +50

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-glk:          NOTRUN -> FAIL [fdo#108145] +1

  * igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
    - shard-glk:          PASS -> FAIL [fdo#108145]

  * igt@kms_plane_scaling@pipe-a-scaler-with-rotation:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1

  * igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format:
    - shard-glk:          PASS -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_vblank@pipe-c-ts-continuation-suspend:
    - shard-apl:          PASS -> FAIL [fdo#104894] +2
    - shard-kbl:          PASS -> FAIL [fdo#104894] +1

  * igt@tools_test@tools_test:
    - shard-apl:          PASS -> SKIP [fdo#109271]

  
#### Possible fixes ####

  * igt@i915_suspend@sysfs-reader:
    - shard-kbl:          INCOMPLETE [fdo#103665] -> PASS

  * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
    - shard-snb:          DMESG-WARN [fdo#110222] -> PASS +1

  * igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
    - shard-apl:          FAIL [fdo#108145] -> PASS +1

  * igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
    - shard-glk:          SKIP [fdo#109271] / [fdo#109278] -> PASS +1

  * igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
    - shard-kbl:          FAIL [fdo#104894] -> PASS

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-apl:          FAIL [fdo#104894] -> PASS +3

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105454]: https://bugs.freedesktop.org/show_bug.cgi?id=105454
  [fdo#106509]: https://bugs.freedesktop.org/show_bug.cgi?id=106509
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#110038]: https://bugs.freedesktop.org/show_bug.cgi?id=110038
  [fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222


Participating hosts (7 -> 4)
------------------------------

  Missing    (3): shard-skl shard-hsw shard-iclb 


Build changes
-------------

    * IGT: IGT_4897 -> IGTPW_2685

  CI_DRM_5789: 93b3614e8c493860dc63c3028460efb02036c6ea @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2685: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2685/
  IGT_4897: e12d69496a6bef09ac6c0f792b8d60a65cf5e0bf @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2685/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-03-22 10:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 15:55 [igt-dev] [PATCH i-g-t v3 0/6] HDCP2.2 Tests Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 1/6] kms_content_protection: Content type support Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 3/6] kms_content_protection: test content type change Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 5/6] kms_content_protection: srm and topology_info test Ramalingam C
2019-03-21 17:44   ` [igt-dev] [PATCH i-g-t v4 " Ramalingam C
2019-03-21 15:55 ` [igt-dev] [PATCH i-g-t v3 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
2019-03-21 16:01 ` [igt-dev] ✗ Fi.CI.BAT: failure for HDCP2.2 Tests (rev2) Patchwork
2019-03-21 18:30 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev3) Patchwork
2019-03-22 10:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.