All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests
@ 2019-04-05  8:23 Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support Ramalingam C
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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.

v4:
  Handled the SRM sysfs is modification.
  Topology structure is provided with explicit padding, in sync with
	kernel.

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        | 498 ++++++++++++++++++++++++--
 4 files changed, 477 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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-12 15:13   ` Wentland, Harry
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 3/6] kms_content_protection: test content type change Ramalingam C
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 3/6] kms_content_protection: test content type change
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 4/6] kms_content_protection: uevent for HDCP status change
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
                   ` (2 preceding siblings ...)
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 3/6] kms_content_protection: test content type change Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 5/6] kms_content_protection: srm and topology_info test Ramalingam C
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 5/6] kms_content_protection: srm and topology_info test
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
                   ` (3 preceding siblings ...)
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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:
  srm sysfs is moved to /sys/class/drm as per kernel changes.
  explicit padding is added for topology struct, in sync with kernel.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 lib/igt_kms.c                  |   1 +
 lib/igt_kms.h                  |   1 +
 tests/kms_content_protection.c | 229 ++++++++++++++++++++++++++++++---
 3 files changed, 213 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..f958811365b7 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -58,6 +58,118 @@ 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 {
+	/* Version of HDCP authenticated (1.4/2.2) */
+	__u32 ver_in_force;
+
+	/* Applicable only for HDCP2.2 */
+	__u32 content_type;
+
+	/* KSV of immediate HDCP Sink. In Little-Endian Format. */
+	__u8 bksv[DRM_MODE_HDCP_KSV_LEN];
+
+	/* Whether Immediate HDCP sink is a repeater? */
+	__u8 is_repeater;
+
+	/* Depth received from immediate downstream repeater */
+	__u8 depth;
+	__u8 pad1;
+
+	/* 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.
+	 */
+	__u8 ksv_list[DRM_MODE_HDCP_KSV_LEN * DRM_MODE_HDCP_MAX_DEVICE_CNT];
+	__u8 pad2[5];
+} __packed;
+
+__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)
+{
+	__u8 *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 +467,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 +485,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 +512,36 @@ 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 __u8 *srm, int len)
+{
+	int fd, ret, total = 0;
+
+	fd = open("/sys/class/drm/hdcp_srm", O_WRONLY);
+	do {
+		ret = write(fd, srm + total, len - total);
+		if (ret < 0)
+			ret = -errno;
+		if (ret == -EINTR || ret == -EAGAIN)
+			continue;
+		if (ret <= 0)
+			break;
+		total += ret;
+	} while (total != len);
+
+	return total < len ? false : true;
+}
+
 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 +556,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 +572,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 __u8 *)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 __u8 *)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 +627,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 +693,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 +724,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 +745,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 +779,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] 10+ messages in thread

* [igt-dev] [PATCH i-g-t v4 6/6] DO NOT MERGE: CP in fast feedback list
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
                   ` (4 preceding siblings ...)
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 5/6] kms_content_protection: srm and topology_info test Ramalingam C
@ 2019-04-05  8:23 ` Ramalingam C
  2019-04-05  9:33 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev4) Patchwork
  2019-04-06  2:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  7 siblings, 0 replies; 10+ messages in thread
From: Ramalingam C @ 2019-04-05  8:23 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] 10+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev4)
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
                   ` (5 preceding siblings ...)
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
@ 2019-04-05  9:33 ` Patchwork
  2019-04-06  2:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  7 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-04-05  9:33 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev

== Series Details ==

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

== Summary ==

CI Bug Log - changes from IGT_4931 -> IGTPW_2794
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_2794:

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_content_protection@srm} (NEW):
    - fi-icl-y:           NOTRUN -> SKIP
    - {fi-icl-u3}:        NOTRUN -> SKIP
    - fi-icl-u2:          NOTRUN -> SKIP

  
New tests
---------

  New tests have been introduced between IGT_4931 and IGTPW_2794:

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

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

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_basic@gtt-bsd2:
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] +60

  * igt@gem_flink_basic@basic:
    - fi-icl-y:           PASS -> DMESG-WARN [fdo#109638]

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

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

  * igt@kms_busy@basic-flip-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
    - fi-byt-clapper:     NOTRUN -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_content_protection@atomic:
    - fi-skl-iommu:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-elk-e7500:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-whl-u:           NOTRUN -> SKIP [fdo#109271] +2
    - fi-cfl-8700k:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-snb-2520m:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-lmem:        NOTRUN -> FAIL [fdo#108739] +1
    - fi-apl-guc:         NOTRUN -> FAIL [fdo#108739] / [fdo#110321] +1

  * igt@kms_content_protection@legacy:
    - fi-cfl-guc:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-snb-2600:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-6770hq:      NOTRUN -> FAIL [fdo#108739]
    - fi-bxt-j4205:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-kbl-r:           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
    - fi-bwr-2160:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-hsw-4770:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-ivb-3770:        NOTRUN -> SKIP [fdo#109271] +2
    - fi-kbl-8809g:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-icl-y:           NOTRUN -> SKIP [fdo#109300] +1

  * {igt@kms_content_protection@srm} (NEW):
    - fi-ilk-650:         NOTRUN -> SKIP [fdo#109271] +2
    - fi-bsw-n3050:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-bsw-kefka:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-cfl-8109u:       NOTRUN -> SKIP [fdo#109271]
    - fi-bdw-5557u:       NOTRUN -> SKIP [fdo#109271] +2
    - {fi-kbl-7567u}:     NOTRUN -> SKIP [fdo#109271]
    - fi-skl-6600u:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-byt-j1900:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-lmem:        NOTRUN -> SKIP [fdo#109271]
    - fi-apl-guc:         NOTRUN -> SKIP [fdo#109271]
    - fi-byt-n2820:       NOTRUN -> SKIP [fdo#109271] +2
    - fi-skl-6770hq:      NOTRUN -> SKIP [fdo#109271] +1
    - fi-skl-6700k2:      NOTRUN -> SKIP [fdo#109271]
    - fi-skl-6260u:       NOTRUN -> SKIP [fdo#109271]
    - fi-skl-gvtdvm:      NOTRUN -> SKIP [fdo#109271]
    - fi-kbl-x1275:       NOTRUN -> SKIP [fdo#109271]

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

  * igt@kms_frontbuffer_tracking@basic:
    - fi-byt-clapper:     NOTRUN -> FAIL [fdo#103167]

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

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
    - fi-blb-e6850:       NOTRUN -> SKIP [fdo#109271] +51

  * igt@kms_pipe_crc_basic@read-crc-pipe-a:
    - fi-byt-clapper:     NOTRUN -> FAIL [fdo#107362] +1

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-byt-clapper:     NOTRUN -> FAIL [fdo#103191] / [fdo#107362] +1

  * igt@kms_psr@primary_mmap_gtt:
    - fi-skl-guc:         NOTRUN -> SKIP [fdo#109271] +52

  
#### Possible fixes ####

  * igt@gem_cpu_reloc@basic:
    - {fi-icl-u3}:        DMESG-WARN [fdo#107724] -> PASS

  * igt@gem_exec_suspend@basic-s3:
    - fi-blb-e6850:       INCOMPLETE [fdo#107718] -> PASS

  * igt@i915_selftest@live_contexts:
    - fi-bdw-gvtdvm:      DMESG-FAIL [fdo#110235 ] -> PASS

  
  {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#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108529]: https://bugs.freedesktop.org/show_bug.cgi?id=108529
  [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#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
  [fdo#109638]: https://bugs.freedesktop.org/show_bug.cgi?id=109638
  [fdo#110210]: https://bugs.freedesktop.org/show_bug.cgi?id=110210
  [fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235 
  [fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
  [fdo#110322]: https://bugs.freedesktop.org/show_bug.cgi?id=110322


Participating hosts (45 -> 41)
------------------------------

  Additional (2): fi-skl-guc fi-byt-clapper 
  Missing    (6): fi-kbl-soraka fi-ilk-m540 fi-hsw-peppy fi-byt-squawks fi-bsw-cyan fi-pnv-d510 


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

    * IGT: IGT_4931 -> IGTPW_2794

  CI_DRM_5877: 03f3a57c6df4ef469bd9f528bb9e0201ddd0ee14 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2794: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2794/
  IGT_4931: 019f892e5d1a0a9643cb726c47ce2d99c14b444f @ 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_2794/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for HDCP2.2 Tests (rev4)
  2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
                   ` (6 preceding siblings ...)
  2019-04-05  9:33 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev4) Patchwork
@ 2019-04-06  2:19 ` Patchwork
  7 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2019-04-06  2:19 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev

== Series Details ==

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

== Summary ==

CI Bug Log - changes from IGT_4931_full -> IGTPW_2794_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_2794_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_2794_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_2794_full:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_create@create-clear:
    - shard-hsw:          PASS -> DMESG-WARN

  * igt@runner@aborted:
    - shard-hsw:          NOTRUN -> FAIL

  
New tests
---------

  New tests have been introduced between IGT_4931_full and IGTPW_2794_full:

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

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

  * igt@kms_content_protection@srm:
    - Statuses : 5 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 : 5 skip(s)
    - Exec time: [0.00] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_stolen@stolen-clear:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] +33

  * igt@kms_busy@basic-modeset-f:
    - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3

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

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

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

  * igt@kms_cursor_crc@cursor-128x128-offscreen:
    - shard-snb:          PASS -> SKIP [fdo#109271] +5

  * igt@kms_cursor_crc@cursor-64x64-onscreen:
    - shard-glk:          NOTRUN -> FAIL [fdo#103232]

  * igt@kms_cursor_edge_walk@pipe-b-128x128-right-edge:
    - shard-snb:          PASS -> SKIP [fdo#109271] / [fdo#109278]

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          PASS -> FAIL [fdo#105767]

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-render:
    - shard-glk:          PASS -> FAIL [fdo#103167]

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-spr-indfb-draw-render:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] +46

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

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

  * igt@kms_setmode@basic:
    - shard-apl:          PASS -> FAIL [fdo#99912]
    - shard-kbl:          PASS -> FAIL [fdo#99912]

  * igt@kms_universal_plane@universal-plane-gen9-features-pipe-e:
    - shard-hsw:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2

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

  * igt@kms_vblank@pipe-c-wait-busy:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3

  * igt@perf@rc6-disable:
    - shard-snb:          NOTRUN -> SKIP [fdo#109271] +35

  * igt@perf_pmu@rc6:
    - shard-kbl:          PASS -> SKIP [fdo#109271]

  
#### Possible fixes ####

  * igt@kms_busy@extended-modeset-hang-newfb-render-b:
    - shard-hsw:          DMESG-WARN [fdo#110222] -> PASS
    - shard-kbl:          DMESG-WARN [fdo#110222] -> PASS
    - shard-snb:          DMESG-WARN [fdo#110222] -> PASS

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - shard-apl:          DMESG-WARN [fdo#108566] -> PASS

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

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-kbl:          FAIL [fdo#109016] -> PASS

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

  
  {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#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (7 -> 5)
------------------------------

  Missing    (2): shard-skl shard-iclb 


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

    * IGT: IGT_4931 -> IGTPW_2794

  CI_DRM_5877: 03f3a57c6df4ef469bd9f528bb9e0201ddd0ee14 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_2794: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2794/
  IGT_4931: 019f892e5d1a0a9643cb726c47ce2d99c14b444f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

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

* Re: [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support
  2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support Ramalingam C
@ 2019-04-12 15:13   ` Wentland, Harry
  0 siblings, 0 replies; 10+ messages in thread
From: Wentland, Harry @ 2019-04-12 15:13 UTC (permalink / raw)
  To: Ramalingam C, igt-dev, daniel

On 2019-04-05 4:23 a.m., Ramalingam C wrote:
> 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);

This looks like functionality that can be shared between drivers. Can we give it a generic name (i.e. drop i915)?

Harry

> +	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
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-04-12 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05  8:23 [igt-dev] [PATCH i-g-t v4 0/6] HDCP2.2 Tests Ramalingam C
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 1/6] kms_content_protection: Content type support Ramalingam C
2019-04-12 15:13   ` Wentland, Harry
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 2/6] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 3/6] kms_content_protection: test content type change Ramalingam C
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 4/6] kms_content_protection: uevent for HDCP status change Ramalingam C
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 5/6] kms_content_protection: srm and topology_info test Ramalingam C
2019-04-05  8:23 ` [igt-dev] [PATCH i-g-t v4 6/6] DO NOT MERGE: CP in fast feedback list Ramalingam C
2019-04-05  9:33 ` [igt-dev] ✓ Fi.CI.BAT: success for HDCP2.2 Tests (rev4) Patchwork
2019-04-06  2:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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.