All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements
@ 2020-06-01  8:39 Ankit Nautiyal
  2020-06-01  8:39 ` [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ankit Nautiyal @ 2020-06-01  8:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, petri.latvala, martin.peres

This patch series adds support for testing HDCP1.4 and HDCP2.2 version.
This is continuation of the earlier patch series:
https://patchwork.freedesktop.org/patch/358240/

It also enhances the IGT to test the cases, where SRM table is not
present.

Ankit Nautiyal (2):
  tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  tests/kms_content_protection: Remove pre-existing SRM table before the
    test

 tests/kms_content_protection.c | 240 +++++++++++++++++++++++----------
 1 file changed, 166 insertions(+), 74 deletions(-)

-- 
2.17.1

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

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

* [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-06-01  8:39 [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements Ankit Nautiyal
@ 2020-06-01  8:39 ` Ankit Nautiyal
  2020-06-01 10:41   ` Ramalingam C
  2020-06-01  8:40 ` [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test Ankit Nautiyal
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Ankit Nautiyal @ 2020-06-01  8:39 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, petri.latvala, martin.peres

Currently, the test kms_content_protection does not distinguish
between HDCP1.4 and HDCP2.2 tests. Since the driver by default
always chooses HDCP2.2 protocol if the panel supports HDCP1.4 &
HDCP2.2, HDCP1.4 does not get tested.

This patch makes two versions of the existing subtests for testing
HDCP1.4 and HDCP2.2. For making sure that the required HDCP version
is chosen by the kernel, the test utilizes the debugfs
'i915_hdcp_version_request' for each HDCP supporting connector.
The desired HDCP version is written via the debugfs and is considered
by the kernel, if the platform and the panel support that
HDCP version.

This patch also makes the existing subtests as dynamic sub-subtests
based on all outputs supporting the protocol under test.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 tests/kms_content_protection.c | 230 ++++++++++++++++++++++-----------
 1 file changed, 158 insertions(+), 72 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 3b9cedcb..a6a64a28 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -59,6 +59,9 @@ struct data {
 #define HDCP_CONTENT_TYPE_0				0
 #define HDCP_CONTENT_TYPE_1				1
 
+#define HDCP_14						1
+#define HDCP_22						2
+
 #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)
@@ -593,44 +596,6 @@ static bool sink_hdcp2_capable(igt_output_t *output)
 	return strstr(buf, "HDCP2.2");
 }
 
-static void
-test_content_protection(enum igt_commit_style s, int content_type)
-{
-	igt_display_t *display = &data.display;
-	igt_output_t *output;
-	int valid_tests = 0;
-
-	if (data.cp_tests & CP_MEI_RELOAD)
-		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;
-
-		if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] &&
-		    content_type)
-			continue;
-
-		igt_info("CP Test execution on %s\n", output->name);
-
-		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, content_type);
-		valid_tests++;
-	}
-
-	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
-}
-
 static void test_content_protection_cleanup(void)
 {
 	igt_display_t *display = &data.display;
@@ -651,58 +616,63 @@ static void test_content_protection_cleanup(void)
 	}
 }
 
-igt_main
-{
-	igt_fixture {
-		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+static bool
+is_valid_output(igt_output_t *output, int content_type) {
+	if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+		return false;
 
-		igt_display_require(&data.display, data.drm_fd);
+	if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] && content_type)
+		return false;
+
+	if (content_type && !sink_hdcp2_capable(output)) {
+		igt_info("\tSkip %s (Sink has no HDCP2.2 support)\n",
+			 output->name);
+		return false;
+
+	} else if (!sink_hdcp_capable(output)) {
+		igt_info("\tSkip %s (Sink has no HDCP support)\n",
+			 output->name);
+		return false;
 	}
+	return true;
+}
+
+static void
+test_content_protection_dynamic(igt_output_t *output, int content_type)
+{
 
-	igt_subtest("legacy") {
+	igt_dynamic_f("legacy-%s", output->name) {
 		data.cp_tests = 0;
-		test_content_protection(COMMIT_LEGACY, HDCP_CONTENT_TYPE_0);
+		test_content_protection_on_output(output, COMMIT_LEGACY,
+						  content_type);
 	}
 
-	igt_subtest("atomic") {
+	igt_dynamic_f("atomic-%s", output->name) {
 		igt_require(data.display.is_atomic);
 		data.cp_tests = 0;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
 	}
 
-	igt_subtest("atomic-dpms") {
+	igt_dynamic_f("atomic-dpms-%s", output->name) {
 		igt_require(data.display.is_atomic);
 		data.cp_tests = CP_DPMS;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
 	}
 
-	igt_subtest("LIC") {
+	igt_dynamic_f("LIC-%s", output->name) {
 		igt_require(data.display.is_atomic);
 		data.cp_tests = CP_LIC;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
-	}
-
-	igt_subtest("type1") {
-		igt_require(data.display.is_atomic);
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
-	}
-
-	igt_subtest("mei_interface") {
-		igt_require(data.display.is_atomic);
-		data.cp_tests = CP_MEI_RELOAD;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
 	}
 
-	igt_subtest("content_type_change") {
-		igt_require(data.display.is_atomic);
-		data.cp_tests = CP_TYPE_CHANGE;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
-	}
-
-	igt_subtest("uevent") {
+	igt_dynamic_f("uevent-%s", output->name) {
 		igt_require(data.display.is_atomic);
 		data.cp_tests = CP_UEVENT;
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
 	}
 
 	/*
@@ -713,7 +683,7 @@ igt_main
 	 *  either of these options, we test SRM writing from userspace and
 	 *  validation of the same at kernel. Something is better than nothing.
 	 */
-	igt_subtest("srm") {
+	igt_dynamic_f("srm-%s", output->name) {
 		bool ret;
 
 		igt_require(data.display.is_atomic);
@@ -721,7 +691,123 @@ igt_main
 		ret = write_srm_as_fw((const __u8 *)facsimile_srm,
 				      sizeof(facsimile_srm));
 		igt_assert_f(ret, "SRM update failed");
-		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
+	}
+
+	/*
+	 * The tests mei_interface and content_type_change are meant only
+	 * for HDCP2.2 protocol, hence ignore for HDCP1.4.
+	 */
+	if (content_type != HDCP_CONTENT_TYPE_1)
+		return;
+
+	igt_dynamic_f("mei_interface-%s", output->name) {
+		igt_require(data.display.is_atomic);
+		data.cp_tests = CP_MEI_RELOAD;
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
+	}
+
+	igt_dynamic_f("content_type_change-%s", output->name) {
+		igt_require(data.display.is_atomic);
+		data.cp_tests = CP_TYPE_CHANGE;
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
+	}
+}
+
+static int request_hdcp_ver(igt_output_t *output, int hdcp_ver)
+{
+	char wrbuf[32] = {'0'};
+	char rdbuf[32] = {'0'};
+	char filename[128] = {'0'};
+	char *read_ver_str;
+	int fd, ret;
+	unsigned int wr_ver, rd_ver;
+
+	fd = igt_debugfs_dir(data.drm_fd);
+
+	if (fd < 0) {
+		igt_info("Failed to open debugfs dir ret = %d\n", errno);
+		return errno;
+	}
+	wr_ver = hdcp_ver;
+	snprintf(wrbuf, sizeof(wrbuf), "%d", wr_ver);
+	strcpy(filename, output->name);
+	strcat(filename, "/i915_hdcp_version_request");
+	ret = igt_sysfs_write(fd, filename, wrbuf, 1);
+	if (ret <= 0) {
+		igt_info("Failed to write into debugfs ret = %d\n", ret);
+		return ret;
+	}
+
+	close(fd);
+
+	fd = igt_debugfs_connector_dir(data.drm_fd, output->name, O_RDONLY);
+	if (fd < 0) {
+		igt_info("Failed to open debugfs for read ret = %d", errno);
+		return errno;
+	}
+
+	debugfs_read(fd, "i915_hdcp_version_request", rdbuf);
+	igt_debug("%s\n", rdbuf);
+
+	close(fd);
+
+	read_ver_str = strstr(rdbuf, "HDCP_VER_FLAGS: ");
+	if (!read_ver_str)
+		return -1;
+
+	igt_debug("HDCP ver = %s\n", read_ver_str + strlen("HDCP_VER_FLAGS: "));
+
+	rd_ver = atoi(read_ver_str + strlen("HDCP_VER_FLAGS: "));
+	if (rd_ver != wr_ver)
+		return -1;
+
+	return 0;
+}
+
+igt_main
+{
+	int i;
+	struct cp_protocol {
+		const char *name;
+		int content_type;
+		int version;
+	} hdcp_protocol[] = {
+		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0, HDCP_14},
+		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1, HDCP_22} };
+
+	igt_fixture {
+		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+		igt_display_require(&data.display, data.drm_fd);
+	}
+
+	for (i = 0; i < ARRAY_SIZE(hdcp_protocol); i++) {
+		igt_subtest_with_dynamic_f("%s", hdcp_protocol[i].name) {
+			igt_output_t *output;
+			int content_type = hdcp_protocol[i].content_type;
+
+			for_each_connected_output(&data.display, output) {
+				int ret;
+
+				if (!is_valid_output(output, content_type))
+					continue;
+				ret = request_hdcp_ver(output,
+						       hdcp_protocol[i].version);
+				if (ret) {
+					igt_info("Cannot set the required version for %s\n",
+						 output->name);
+					continue;
+				}
+				test_content_protection_dynamic(output,
+								content_type);
+
+				/* TODO: Revert to older HDCP ver that was set, previously */
+			}
+		}
 	}
 
 	igt_fixture {
-- 
2.17.1

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

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

* [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test
  2020-06-01  8:39 [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements Ankit Nautiyal
  2020-06-01  8:39 ` [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
@ 2020-06-01  8:40 ` Ankit Nautiyal
  2020-06-01 10:46   ` Ramalingam C
  2020-06-01  9:16 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_content_protection: Enhancements (rev2) Patchwork
  2020-06-01 11:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  3 siblings, 1 reply; 8+ messages in thread
From: Ankit Nautiyal @ 2020-06-01  8:40 UTC (permalink / raw)
  To: igt-dev; +Cc: jani.nikula, petri.latvala, martin.peres

This is to check the case with missing SRM, which should be treated as
device with no revoked keys.

Kernel patch fixing such a bug :
https://patchwork.freedesktop.org/patch/361346/?series=75939&rev=2

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 tests/kms_content_protection.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index a6a64a28..832c9077 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -75,6 +75,8 @@ __u8 facsimile_srm[] = {
 	0x83, 0xAA, 0xC2, 0x5B, 0x24, 0xB3, 0x36, 0x84, 0x94, 0x75, 0x34, 0xDB,
 	0x10, 0x9E, 0x3B, 0x23, 0x13, 0xD8, 0x7A, 0xC2, 0x30, 0x79, 0x84};
 
+const char *srm_fw = "/lib/firmware/display_hdcp_srm.bin";
+
 static void flip_handler(int fd, unsigned int sequence, unsigned int tv_sec,
 			 unsigned int tv_usec, void *_data)
 {
@@ -438,8 +440,7 @@ static bool write_srm_as_fw(const __u8 *srm, int len)
 {
 	int fd, ret, total = 0;
 
-	fd = open("/lib/firmware/display_hdcp_srm.bin",
-		  O_WRONLY | O_CREAT, S_IRWXU);
+	fd = open(srm_fw, O_WRONLY | O_CREAT, S_IRWXU);
 	do {
 		ret = write(fd, srm + total, len - total);
 		if (ret < 0)
@@ -783,6 +784,11 @@ igt_main
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
 		igt_display_require(&data.display, data.drm_fd);
+
+		/* Remove pre-existing srm table */
+		if (access(srm_fw, F_OK) == 0)
+			igt_assert_f(!remove(srm_fw),
+				     "Failed to delete previous srm table\n");
 	}
 
 	for (i = 0; i < ARRAY_SIZE(hdcp_protocol); i++) {
-- 
2.17.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_content_protection: Enhancements (rev2)
  2020-06-01  8:39 [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements Ankit Nautiyal
  2020-06-01  8:39 ` [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
  2020-06-01  8:40 ` [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test Ankit Nautiyal
@ 2020-06-01  9:16 ` Patchwork
  2020-06-01 11:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2020-06-01  9:16 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Enhancements (rev2)
URL   : https://patchwork.freedesktop.org/series/77694/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8560 -> IGTPW_4629
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/index.html

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

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

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
    - {fi-tgl-u}:         [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/fi-tgl-u/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/fi-tgl-u/igt@kms_pipe_crc_basic@hang-read-crc-pipe-a.html

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



Participating hosts (50 -> 44)
------------------------------

  Additional (1): fi-ehl-1 
  Missing    (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-byt-clapper fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5687 -> IGTPW_4629

  CI-20190529: 20190529
  CI_DRM_8560: 02fe287fdb4a3d6bceb1bb61b3c8538b4b941b3c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4629: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/index.html
  IGT_5687: 668a5be752186b6e08f361bac34da37309d08393 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@kms_content_protection@hdcp-1_4
+igt@kms_content_protection@hdcp-2_2
-igt@kms_content_protection@atomic
-igt@kms_content_protection@atomic-dpms
-igt@kms_content_protection@content_type_change
-igt@kms_content_protection@legacy
-igt@kms_content_protection@lic
-igt@kms_content_protection@mei_interface
-igt@kms_content_protection@srm
-igt@kms_content_protection@type1
-igt@kms_content_protection@uevent

== Logs ==

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

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

* Re: [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-06-01  8:39 ` [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
@ 2020-06-01 10:41   ` Ramalingam C
  2020-06-08  8:37     ` Nautiyal, Ankit K
  0 siblings, 1 reply; 8+ messages in thread
From: Ramalingam C @ 2020-06-01 10:41 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev, jani.nikula, petri.latvala, martin.peres

On 2020-06-01 at 14:09:59 +0530, Ankit Nautiyal wrote:
> Currently, the test kms_content_protection does not distinguish
> between HDCP1.4 and HDCP2.2 tests. Since the driver by default
> always chooses HDCP2.2 protocol if the panel supports HDCP1.4 &
> HDCP2.2, HDCP1.4 does not get tested.
> 
> This patch makes two versions of the existing subtests for testing
> HDCP1.4 and HDCP2.2. For making sure that the required HDCP version
> is chosen by the kernel, the test utilizes the debugfs
> 'i915_hdcp_version_request' for each HDCP supporting connector.
> The desired HDCP version is written via the debugfs and is considered
> by the kernel, if the platform and the panel support that
> HDCP version.
> 
> This patch also makes the existing subtests as dynamic sub-subtests
> based on all outputs supporting the protocol under test.
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  tests/kms_content_protection.c | 230 ++++++++++++++++++++++-----------
>  1 file changed, 158 insertions(+), 72 deletions(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 3b9cedcb..a6a64a28 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -59,6 +59,9 @@ struct data {
>  #define HDCP_CONTENT_TYPE_0				0
>  #define HDCP_CONTENT_TYPE_1				1
>  
> +#define HDCP_14						1
> +#define HDCP_22						2
> +
>  #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)
> @@ -593,44 +596,6 @@ static bool sink_hdcp2_capable(igt_output_t *output)
>  	return strstr(buf, "HDCP2.2");
>  }
>  
> -static void
> -test_content_protection(enum igt_commit_style s, int content_type)
> -{
> -	igt_display_t *display = &data.display;
> -	igt_output_t *output;
> -	int valid_tests = 0;
> -
> -	if (data.cp_tests & CP_MEI_RELOAD)
> -		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;
> -
> -		if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] &&
> -		    content_type)
> -			continue;
> -
> -		igt_info("CP Test execution on %s\n", output->name);
> -
> -		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, content_type);
> -		valid_tests++;
> -	}
> -
> -	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
> -}
> -
>  static void test_content_protection_cleanup(void)
>  {
>  	igt_display_t *display = &data.display;
> @@ -651,58 +616,63 @@ static void test_content_protection_cleanup(void)
>  	}
>  }
>  
> -igt_main
> -{
> -	igt_fixture {
> -		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +static bool
> +is_valid_output(igt_output_t *output, int content_type) {
> +	if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
> +		return false;
>  
> -		igt_display_require(&data.display, data.drm_fd);
> +	if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] && content_type)
> +		return false;
> +
> +	if (content_type && !sink_hdcp2_capable(output)) {
> +		igt_info("\tSkip %s (Sink has no HDCP2.2 support)\n",
> +			 output->name);
> +		return false;
> +
> +	} else if (!sink_hdcp_capable(output)) {
> +		igt_info("\tSkip %s (Sink has no HDCP support)\n",
> +			 output->name);
> +		return false;
>  	}
> +	return true;
> +}
> +
> +static void
> +test_content_protection_dynamic(igt_output_t *output, int content_type)
> +{
>  
> -	igt_subtest("legacy") {
> +	igt_dynamic_f("legacy-%s", output->name) {
>  		data.cp_tests = 0;
> -		test_content_protection(COMMIT_LEGACY, HDCP_CONTENT_TYPE_0);
> +		test_content_protection_on_output(output, COMMIT_LEGACY,
> +						  content_type);
>  	}
>  
> -	igt_subtest("atomic") {
> +	igt_dynamic_f("atomic-%s", output->name) {
>  		igt_require(data.display.is_atomic);
>  		data.cp_tests = 0;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	igt_subtest("atomic-dpms") {
> +	igt_dynamic_f("atomic-dpms-%s", output->name) {
>  		igt_require(data.display.is_atomic);
>  		data.cp_tests = CP_DPMS;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	igt_subtest("LIC") {
> +	igt_dynamic_f("LIC-%s", output->name) {
>  		igt_require(data.display.is_atomic);
>  		data.cp_tests = CP_LIC;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
> -	}
> -
> -	igt_subtest("type1") {
> -		igt_require(data.display.is_atomic);
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
> -	}
> -
> -	igt_subtest("mei_interface") {
> -		igt_require(data.display.is_atomic);
> -		data.cp_tests = CP_MEI_RELOAD;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	igt_subtest("content_type_change") {
> -		igt_require(data.display.is_atomic);
> -		data.cp_tests = CP_TYPE_CHANGE;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
> -	}
> -
> -	igt_subtest("uevent") {
> +	igt_dynamic_f("uevent-%s", output->name) {
>  		igt_require(data.display.is_atomic);
>  		data.cp_tests = CP_UEVENT;
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
>  	/*
> @@ -713,7 +683,7 @@ igt_main
>  	 *  either of these options, we test SRM writing from userspace and
>  	 *  validation of the same at kernel. Something is better than nothing.
>  	 */
> -	igt_subtest("srm") {
> +	igt_dynamic_f("srm-%s", output->name) {
>  		bool ret;
>  
>  		igt_require(data.display.is_atomic);
> @@ -721,7 +691,123 @@ igt_main
>  		ret = write_srm_as_fw((const __u8 *)facsimile_srm,
>  				      sizeof(facsimile_srm));
>  		igt_assert_f(ret, "SRM update failed");
> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
> +	}
> +
> +	/*
> +	 * The tests mei_interface and content_type_change are meant only
> +	 * for HDCP2.2 protocol, hence ignore for HDCP1.4.
> +	 */
> +	if (content_type != HDCP_CONTENT_TYPE_1)
> +		return;
Hope this will be sufficient for not to create the dynamic subtest as
hdcp1.4 + mei_interface....
> +
> +	igt_dynamic_f("mei_interface-%s", output->name) {
> +		igt_require(data.display.is_atomic);
> +		data.cp_tests = CP_MEI_RELOAD;
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
> +	}
> +
> +	igt_dynamic_f("content_type_change-%s", output->name) {
> +		igt_require(data.display.is_atomic);
> +		data.cp_tests = CP_TYPE_CHANGE;
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
> +	}
> +}
> +
> +static int request_hdcp_ver(igt_output_t *output, int hdcp_ver)
> +{
> +	char wrbuf[32] = {'0'};
> +	char rdbuf[32] = {'0'};
> +	char filename[128] = {'0'};
> +	char *read_ver_str;
> +	int fd, ret;
> +	unsigned int wr_ver, rd_ver;
> +
> +	fd = igt_debugfs_dir(data.drm_fd);
> +
> +	if (fd < 0) {
> +		igt_info("Failed to open debugfs dir ret = %d\n", errno);
> +		return errno;
> +	}
> +	wr_ver = hdcp_ver;
wr_ver is redundant. We can use the hdcp_ver itself.
> +	snprintf(wrbuf, sizeof(wrbuf), "%d", wr_ver);
> +	strcpy(filename, output->name);
> +	strcat(filename, "/i915_hdcp_version_request");
> +	ret = igt_sysfs_write(fd, filename, wrbuf, 1);
> +	if (ret <= 0) {
> +		igt_info("Failed to write into debugfs ret = %d\n", ret);
> +		return ret;
> +	}
> +
> +	close(fd);
Can't we do the write and read on same fd? why do we clsoe and reopen?
> +
> +	fd = igt_debugfs_connector_dir(data.drm_fd, output->name, O_RDONLY);
> +	if (fd < 0) {
> +		igt_info("Failed to open debugfs for read ret = %d", errno);
> +		return errno;
> +	}
> +
> +	debugfs_read(fd, "i915_hdcp_version_request", rdbuf);
> +	igt_debug("%s\n", rdbuf);
> +
> +	close(fd);
> +
> +	read_ver_str = strstr(rdbuf, "HDCP_VER_FLAGS: ");
> +	if (!read_ver_str)
> +		return -1;
> +
> +	igt_debug("HDCP ver = %s\n", read_ver_str + strlen("HDCP_VER_FLAGS: "));
> +
> +	rd_ver = atoi(read_ver_str + strlen("HDCP_VER_FLAGS: "));
> +	if (rd_ver != wr_ver)
can use the hdcp_ver itself.

Approach looks good to me..

-Ram
> +		return -1;
> +
> +	return 0;
> +}
> +
> +igt_main
> +{
> +	int i;
> +	struct cp_protocol {
> +		const char *name;
> +		int content_type;
> +		int version;
> +	} hdcp_protocol[] = {
> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0, HDCP_14},
> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1, HDCP_22} };
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.drm_fd);
> +	}
> +
> +	for (i = 0; i < ARRAY_SIZE(hdcp_protocol); i++) {
> +		igt_subtest_with_dynamic_f("%s", hdcp_protocol[i].name) {
> +			igt_output_t *output;
> +			int content_type = hdcp_protocol[i].content_type;
> +
> +			for_each_connected_output(&data.display, output) {
> +				int ret;
> +
> +				if (!is_valid_output(output, content_type))
> +					continue;
> +				ret = request_hdcp_ver(output,
> +						       hdcp_protocol[i].version);
> +				if (ret) {
> +					igt_info("Cannot set the required version for %s\n",
> +						 output->name);
> +					continue;
> +				}
> +				test_content_protection_dynamic(output,
> +								content_type);
> +
> +				/* TODO: Revert to older HDCP ver that was set, previously */
> +			}
> +		}
>  	}
>  
>  	igt_fixture {
> -- 
> 2.17.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test
  2020-06-01  8:40 ` [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test Ankit Nautiyal
@ 2020-06-01 10:46   ` Ramalingam C
  0 siblings, 0 replies; 8+ messages in thread
From: Ramalingam C @ 2020-06-01 10:46 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev, jani.nikula, petri.latvala, martin.peres

On 2020-06-01 at 14:10:00 +0530, Ankit Nautiyal wrote:
> This is to check the case with missing SRM, which should be treated as
> device with no revoked keys.
> 
> Kernel patch fixing such a bug :
> https://patchwork.freedesktop.org/patch/361346/?series=75939&rev=2
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  tests/kms_content_protection.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index a6a64a28..832c9077 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -75,6 +75,8 @@ __u8 facsimile_srm[] = {
>  	0x83, 0xAA, 0xC2, 0x5B, 0x24, 0xB3, 0x36, 0x84, 0x94, 0x75, 0x34, 0xDB,
>  	0x10, 0x9E, 0x3B, 0x23, 0x13, 0xD8, 0x7A, 0xC2, 0x30, 0x79, 0x84};
>  
> +const char *srm_fw = "/lib/firmware/display_hdcp_srm.bin";
> +
>  static void flip_handler(int fd, unsigned int sequence, unsigned int tv_sec,
>  			 unsigned int tv_usec, void *_data)
>  {
> @@ -438,8 +440,7 @@ static bool write_srm_as_fw(const __u8 *srm, int len)
>  {
>  	int fd, ret, total = 0;
>  
> -	fd = open("/lib/firmware/display_hdcp_srm.bin",
> -		  O_WRONLY | O_CREAT, S_IRWXU);
> +	fd = open(srm_fw, O_WRONLY | O_CREAT, S_IRWXU);
>  	do {
>  		ret = write(fd, srm + total, len - total);
>  		if (ret < 0)
> @@ -783,6 +784,11 @@ igt_main
>  		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>  
>  		igt_display_require(&data.display, data.drm_fd);
> +
> +		/* Remove pre-existing srm table */
> +		if (access(srm_fw, F_OK) == 0)
> +			igt_assert_f(!remove(srm_fw),
> +				     "Failed to delete previous srm table\n");
Looks good to me.

Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
>  	}
>  
>  	for (i = 0; i < ARRAY_SIZE(hdcp_protocol); i++) {
> -- 
> 2.17.1
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_content_protection: Enhancements (rev2)
  2020-06-01  8:39 [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements Ankit Nautiyal
                   ` (2 preceding siblings ...)
  2020-06-01  9:16 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_content_protection: Enhancements (rev2) Patchwork
@ 2020-06-01 11:33 ` Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2020-06-01 11:33 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Enhancements (rev2)
URL   : https://patchwork.freedesktop.org/series/77694/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8560_full -> IGTPW_4629_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4629_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4629_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://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_content_protection@hdcp-1_4} (NEW):
    - shard-tglb:         NOTRUN -> [SKIP][1] +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-tglb8/igt@kms_content_protection@hdcp-1_4.html

  * {igt@kms_content_protection@hdcp-2_2} (NEW):
    - shard-iclb:         NOTRUN -> [SKIP][2] +1 similar issue
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb2/igt@kms_content_protection@hdcp-2_2.html

  * igt@runner@aborted:
    - shard-tglb:         NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-tglb8/igt@runner@aborted.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8560_full and IGTPW_4629_full:

### New IGT tests (2) ###

  * igt@kms_content_protection@hdcp-1_4:
    - Statuses : 7 skip(s)
    - Exec time: [0.0, 0.01] s

  * igt@kms_content_protection@hdcp-2_2:
    - Statuses : 7 skip(s)
    - Exec time: [0.0, 0.01] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_engines@libapi:
    - shard-glk:          [PASS][4] -> [TIMEOUT][5] ([i915#1958]) +1 similar issue
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk9/igt@gem_ctx_engines@libapi.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk7/igt@gem_ctx_engines@libapi.html

  * igt@gem_ctx_persistence@engines-hostile@rcs0:
    - shard-iclb:         [PASS][6] -> [FAIL][7] ([i915#1622])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb2/igt@gem_ctx_persistence@engines-hostile@rcs0.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb4/igt@gem_ctx_persistence@engines-hostile@rcs0.html
    - shard-tglb:         [PASS][8] -> [FAIL][9] ([i915#1622])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-tglb3/igt@gem_ctx_persistence@engines-hostile@rcs0.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-tglb7/igt@gem_ctx_persistence@engines-hostile@rcs0.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-kbl:          [PASS][10] -> [DMESG-WARN][11] ([i915#1436] / [i915#716])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl7/igt@gen9_exec_parse@allowed-all.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl1/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - shard-tglb:         [PASS][12] -> [INCOMPLETE][13] ([i915#1602] / [i915#456])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-tglb8/igt@i915_pm_backlight@fade_with_suspend.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-tglb8/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_suspend@fence-restore-untiled:
    - shard-kbl:          [PASS][14] -> [DMESG-WARN][15] ([i915#180] / [i915#93] / [i915#95])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl1/igt@i915_suspend@fence-restore-untiled.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl7/igt@i915_suspend@fence-restore-untiled.html

  * igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque:
    - shard-apl:          [PASS][16] -> [FAIL][17] ([i915#54])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl8/igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl8/igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque.html
    - shard-kbl:          [PASS][18] -> [FAIL][19] ([i915#54])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl4/igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-alpha-opaque.html

  * igt@kms_cursor_edge_walk@pipe-a-256x256-top-edge:
    - shard-kbl:          [PASS][20] -> [FAIL][21] ([i915#70] / [i915#93] / [i915#95]) +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl3/igt@kms_cursor_edge_walk@pipe-a-256x256-top-edge.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl6/igt@kms_cursor_edge_walk@pipe-a-256x256-top-edge.html

  * igt@kms_cursor_legacy@2x-cursor-vs-flip-legacy:
    - shard-hsw:          [PASS][22] -> [INCOMPLETE][23] ([i915#1926] / [i915#61])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-hsw2/igt@kms_cursor_legacy@2x-cursor-vs-flip-legacy.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-hsw7/igt@kms_cursor_legacy@2x-cursor-vs-flip-legacy.html

  * igt@kms_cursor_legacy@all-pipes-torture-bo:
    - shard-hsw:          [PASS][24] -> [DMESG-WARN][25] ([i915#128])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-hsw1/igt@kms_cursor_legacy@all-pipes-torture-bo.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-hsw2/igt@kms_cursor_legacy@all-pipes-torture-bo.html

  * igt@kms_draw_crc@draw-method-xrgb8888-mmap-wc-untiled:
    - shard-kbl:          [PASS][26] -> [FAIL][27] ([fdo#108145] / [i915#177] / [i915#52] / [i915#54] / [i915#93] / [i915#95])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl4/igt@kms_draw_crc@draw-method-xrgb8888-mmap-wc-untiled.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl4/igt@kms_draw_crc@draw-method-xrgb8888-mmap-wc-untiled.html
    - shard-apl:          [PASS][28] -> [FAIL][29] ([fdo#108145] / [i915#52] / [i915#54] / [i915#95])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl2/igt@kms_draw_crc@draw-method-xrgb8888-mmap-wc-untiled.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl7/igt@kms_draw_crc@draw-method-xrgb8888-mmap-wc-untiled.html

  * igt@kms_panel_fitting@atomic-fastset:
    - shard-iclb:         [PASS][30] -> [FAIL][31] ([i915#83])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb6/igt@kms_panel_fitting@atomic-fastset.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb8/igt@kms_panel_fitting@atomic-fastset.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-apl:          [PASS][32] -> [DMESG-WARN][33] ([i915#180])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl6/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
    - shard-kbl:          [PASS][34] -> [DMESG-WARN][35] ([i915#180]) +2 similar issues
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl2/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl4/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes.html

  * igt@kms_psr@no_drrs:
    - shard-iclb:         [PASS][36] -> [FAIL][37] ([i915#173])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb8/igt@kms_psr@no_drrs.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb1/igt@kms_psr@no_drrs.html

  
#### Possible fixes ####

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-onscreen:
    - shard-kbl:          [FAIL][38] ([i915#54] / [i915#93] / [i915#95]) -> [PASS][39] +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl3/igt@kms_cursor_crc@pipe-a-cursor-64x64-onscreen.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-64x64-onscreen.html

  * igt@kms_cursor_crc@pipe-a-cursor-64x64-sliding:
    - shard-apl:          [FAIL][40] ([i915#54]) -> [PASS][41] +1 similar issue
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl8/igt@kms_cursor_crc@pipe-a-cursor-64x64-sliding.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl4/igt@kms_cursor_crc@pipe-a-cursor-64x64-sliding.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][42] ([i915#180]) -> [PASS][43] +2 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl6/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-b-cursor-128x42-offscreen:
    - shard-glk:          [INCOMPLETE][44] ([i915#58] / [k.org#198133]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk2/igt@kms_cursor_crc@pipe-b-cursor-128x42-offscreen.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk5/igt@kms_cursor_crc@pipe-b-cursor-128x42-offscreen.html

  * igt@kms_cursor_crc@pipe-b-cursor-64x21-offscreen:
    - shard-glk:          [TIMEOUT][46] ([i915#1958]) -> [PASS][47] +1 similar issue
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk2/igt@kms_cursor_crc@pipe-b-cursor-64x21-offscreen.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk4/igt@kms_cursor_crc@pipe-b-cursor-64x21-offscreen.html

  * igt@kms_cursor_crc@pipe-c-cursor-256x85-sliding:
    - shard-kbl:          [FAIL][48] ([i915#54]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl7/igt@kms_cursor_crc@pipe-c-cursor-256x85-sliding.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-256x85-sliding.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [FAIL][50] ([i915#72]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk9/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk1/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_cursor_legacy@cursora-vs-flipb-toggle:
    - shard-glk:          [DMESG-FAIL][52] ([i915#1925] / [i915#1926]) -> [PASS][53]
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk8/igt@kms_cursor_legacy@cursora-vs-flipb-toggle.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk9/igt@kms_cursor_legacy@cursora-vs-flipb-toggle.html

  * igt@kms_fbcon_fbt@fbc:
    - shard-kbl:          [FAIL][54] ([i915#64]) -> [PASS][55]
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl3/igt@kms_fbcon_fbt@fbc.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl6/igt@kms_fbcon_fbt@fbc.html
    - shard-apl:          [FAIL][56] ([i915#1525]) -> [PASS][57]
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl1/igt@kms_fbcon_fbt@fbc.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl6/igt@kms_fbcon_fbt@fbc.html

  * {igt@kms_flip@flip-vs-suspend-interruptible@c-dp1}:
    - shard-apl:          [DMESG-WARN][58] ([i915#180]) -> [PASS][59] +5 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl1/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html

  * {igt@kms_prime@basic-crc@second-to-first}:
    - shard-apl:          [FAIL][60] ([i915#1031] / [i915#95]) -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl1/igt@kms_prime@basic-crc@second-to-first.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl2/igt@kms_prime@basic-crc@second-to-first.html
    - shard-kbl:          [FAIL][62] ([i915#1031] / [i915#93] / [i915#95]) -> [PASS][63]
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl3/igt@kms_prime@basic-crc@second-to-first.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl4/igt@kms_prime@basic-crc@second-to-first.html

  * igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
    - shard-kbl:          [INCOMPLETE][64] ([i915#155]) -> [PASS][65]
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-kbl3/igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-kbl3/igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend.html

  * {igt@perf@polling-parameterized}:
    - shard-iclb:         [FAIL][66] ([i915#1542]) -> [PASS][67]
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb6/igt@perf@polling-parameterized.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb3/igt@perf@polling-parameterized.html

  
#### Warnings ####

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][68] ([i915#1515]) -> [FAIL][69] ([i915#1515])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb4/igt@i915_pm_rc6_residency@rc6-idle.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb4/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
    - shard-apl:          [FAIL][70] ([fdo#108145] / [i915#265] / [i915#95]) -> [FAIL][71] ([fdo#108145] / [i915#265]) +1 similar issue
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-apl8/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-apl6/igt@kms_plane_alpha_blend@pipe-a-alpha-basic.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [SKIP][72] ([fdo#109642] / [fdo#111068]) -> [FAIL][73] ([i915#608])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-iclb4/igt@kms_psr2_su@page_flip.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-iclb2/igt@kms_psr2_su@page_flip.html

  * igt@kms_vrr@flip-basic:
    - shard-glk:          [SKIP][74] ([fdo#109271]) -> [TIMEOUT][75] ([i915#1958]) +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8560/shard-glk7/igt@kms_vrr@flip-basic.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/shard-glk7/igt@kms_vrr@flip-basic.html

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

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1031]: https://gitlab.freedesktop.org/drm/intel/issues/1031
  [i915#128]: https://gitlab.freedesktop.org/drm/intel/issues/128
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1515]: https://gitlab.freedesktop.org/drm/intel/issues/1515
  [i915#1525]: https://gitlab.freedesktop.org/drm/intel/issues/1525
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
  [i915#1602]: https://gitlab.freedesktop.org/drm/intel/issues/1602
  [i915#1622]: https://gitlab.freedesktop.org/drm/intel/issues/1622
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#173]: https://gitlab.freedesktop.org/drm/intel/issues/173
  [i915#177]: https://gitlab.freedesktop.org/drm/intel/issues/177
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1925]: https://gitlab.freedesktop.org/drm/intel/issues/1925
  [i915#1926]: https://gitlab.freedesktop.org/drm/intel/issues/1926
  [i915#1930]: https://gitlab.freedesktop.org/drm/intel/issues/1930
  [i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
  [i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
  [i915#608]: https://gitlab.freedesktop.org/drm/intel/issues/608
  [i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
  [i915#64]: https://gitlab.freedesktop.org/drm/intel/issues/64
  [i915#70]: https://gitlab.freedesktop.org/drm/intel/issues/70
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#83]: https://gitlab.freedesktop.org/drm/intel/issues/83
  [i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (11 -> 8)
------------------------------

  Missing    (3): pig-skl-6260u pig-glk-j5005 pig-icl-1065g7 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5687 -> IGTPW_4629
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8560: 02fe287fdb4a3d6bceb1bb61b3c8538b4b941b3c @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4629: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4629/index.html
  IGT_5687: 668a5be752186b6e08f361bac34da37309d08393 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

* Re: [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-06-01 10:41   ` Ramalingam C
@ 2020-06-08  8:37     ` Nautiyal, Ankit K
  0 siblings, 0 replies; 8+ messages in thread
From: Nautiyal, Ankit K @ 2020-06-08  8:37 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev, jani.nikula, petri.latvala, martin.peres

Hi Ram,

Thanks for the review comments and suggestions.

I agree to the suggested changes and will be sending version-2, with 
these addressed.

Please find the responses inline.


On 6/1/2020 4:11 PM, Ramalingam C wrote:
> On 2020-06-01 at 14:09:59 +0530, Ankit Nautiyal wrote:
>> Currently, the test kms_content_protection does not distinguish
>> between HDCP1.4 and HDCP2.2 tests. Since the driver by default
>> always chooses HDCP2.2 protocol if the panel supports HDCP1.4 &
>> HDCP2.2, HDCP1.4 does not get tested.
>>
>> This patch makes two versions of the existing subtests for testing
>> HDCP1.4 and HDCP2.2. For making sure that the required HDCP version
>> is chosen by the kernel, the test utilizes the debugfs
>> 'i915_hdcp_version_request' for each HDCP supporting connector.
>> The desired HDCP version is written via the debugfs and is considered
>> by the kernel, if the platform and the panel support that
>> HDCP version.
>>
>> This patch also makes the existing subtests as dynamic sub-subtests
>> based on all outputs supporting the protocol under test.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   tests/kms_content_protection.c | 230 ++++++++++++++++++++++-----------
>>   1 file changed, 158 insertions(+), 72 deletions(-)
>>
>> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
>> index 3b9cedcb..a6a64a28 100644
>> --- a/tests/kms_content_protection.c
>> +++ b/tests/kms_content_protection.c
>> @@ -59,6 +59,9 @@ struct data {
>>   #define HDCP_CONTENT_TYPE_0				0
>>   #define HDCP_CONTENT_TYPE_1				1
>>   
>> +#define HDCP_14						1
>> +#define HDCP_22						2
>> +
>>   #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)
>> @@ -593,44 +596,6 @@ static bool sink_hdcp2_capable(igt_output_t *output)
>>   	return strstr(buf, "HDCP2.2");
>>   }
>>   
>> -static void
>> -test_content_protection(enum igt_commit_style s, int content_type)
>> -{
>> -	igt_display_t *display = &data.display;
>> -	igt_output_t *output;
>> -	int valid_tests = 0;
>> -
>> -	if (data.cp_tests & CP_MEI_RELOAD)
>> -		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;
>> -
>> -		if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] &&
>> -		    content_type)
>> -			continue;
>> -
>> -		igt_info("CP Test execution on %s\n", output->name);
>> -
>> -		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, content_type);
>> -		valid_tests++;
>> -	}
>> -
>> -	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
>> -}
>> -
>>   static void test_content_protection_cleanup(void)
>>   {
>>   	igt_display_t *display = &data.display;
>> @@ -651,58 +616,63 @@ static void test_content_protection_cleanup(void)
>>   	}
>>   }
>>   
>> -igt_main
>> -{
>> -	igt_fixture {
>> -		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>> +static bool
>> +is_valid_output(igt_output_t *output, int content_type) {
>> +	if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
>> +		return false;
>>   
>> -		igt_display_require(&data.display, data.drm_fd);
>> +	if (!output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE] && content_type)
>> +		return false;
>> +
>> +	if (content_type && !sink_hdcp2_capable(output)) {
>> +		igt_info("\tSkip %s (Sink has no HDCP2.2 support)\n",
>> +			 output->name);
>> +		return false;
>> +
>> +	} else if (!sink_hdcp_capable(output)) {
>> +		igt_info("\tSkip %s (Sink has no HDCP support)\n",
>> +			 output->name);
>> +		return false;
>>   	}
>> +	return true;
>> +}
>> +
>> +static void
>> +test_content_protection_dynamic(igt_output_t *output, int content_type)
>> +{
>>   
>> -	igt_subtest("legacy") {
>> +	igt_dynamic_f("legacy-%s", output->name) {
>>   		data.cp_tests = 0;
>> -		test_content_protection(COMMIT_LEGACY, HDCP_CONTENT_TYPE_0);
>> +		test_content_protection_on_output(output, COMMIT_LEGACY,
>> +						  content_type);
>>   	}
>>   
>> -	igt_subtest("atomic") {
>> +	igt_dynamic_f("atomic-%s", output->name) {
>>   		igt_require(data.display.is_atomic);
>>   		data.cp_tests = 0;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	igt_subtest("atomic-dpms") {
>> +	igt_dynamic_f("atomic-dpms-%s", output->name) {
>>   		igt_require(data.display.is_atomic);
>>   		data.cp_tests = CP_DPMS;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	igt_subtest("LIC") {
>> +	igt_dynamic_f("LIC-%s", output->name) {
>>   		igt_require(data.display.is_atomic);
>>   		data.cp_tests = CP_LIC;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
>> -	}
>> -
>> -	igt_subtest("type1") {
>> -		igt_require(data.display.is_atomic);
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
>> -	}
>> -
>> -	igt_subtest("mei_interface") {
>> -		igt_require(data.display.is_atomic);
>> -		data.cp_tests = CP_MEI_RELOAD;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	igt_subtest("content_type_change") {
>> -		igt_require(data.display.is_atomic);
>> -		data.cp_tests = CP_TYPE_CHANGE;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_1);
>> -	}
>> -
>> -	igt_subtest("uevent") {
>> +	igt_dynamic_f("uevent-%s", output->name) {
>>   		igt_require(data.display.is_atomic);
>>   		data.cp_tests = CP_UEVENT;
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>>   	/*
>> @@ -713,7 +683,7 @@ igt_main
>>   	 *  either of these options, we test SRM writing from userspace and
>>   	 *  validation of the same at kernel. Something is better than nothing.
>>   	 */
>> -	igt_subtest("srm") {
>> +	igt_dynamic_f("srm-%s", output->name) {
>>   		bool ret;
>>   
>>   		igt_require(data.display.is_atomic);
>> @@ -721,7 +691,123 @@ igt_main
>>   		ret = write_srm_as_fw((const __u8 *)facsimile_srm,
>>   				      sizeof(facsimile_srm));
>>   		igt_assert_f(ret, "SRM update failed");
>> -		test_content_protection(COMMIT_ATOMIC, HDCP_CONTENT_TYPE_0);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>> +	}
>> +
>> +	/*
>> +	 * The tests mei_interface and content_type_change are meant only
>> +	 * for HDCP2.2 protocol, hence ignore for HDCP1.4.
>> +	 */
>> +	if (content_type != HDCP_CONTENT_TYPE_1)
>> +		return;
> Hope this will be sufficient for not to create the dynamic subtest as
> hdcp1.4 + mei_interface....

Yes, with this we see, the test is not enumerated for mei_interface and 
'content_type_change'


>> +
>> +	igt_dynamic_f("mei_interface-%s", output->name) {
>> +		igt_require(data.display.is_atomic);
>> +		data.cp_tests = CP_MEI_RELOAD;
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>> +	}
>> +
>> +	igt_dynamic_f("content_type_change-%s", output->name) {
>> +		igt_require(data.display.is_atomic);
>> +		data.cp_tests = CP_TYPE_CHANGE;
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>> +	}
>> +}
>> +
>> +static int request_hdcp_ver(igt_output_t *output, int hdcp_ver)
>> +{
>> +	char wrbuf[32] = {'0'};
>> +	char rdbuf[32] = {'0'};
>> +	char filename[128] = {'0'};
>> +	char *read_ver_str;
>> +	int fd, ret;
>> +	unsigned int wr_ver, rd_ver;
>> +
>> +	fd = igt_debugfs_dir(data.drm_fd);
>> +
>> +	if (fd < 0) {
>> +		igt_info("Failed to open debugfs dir ret = %d\n", errno);
>> +		return errno;
>> +	}
>> +	wr_ver = hdcp_ver;
> wr_ver is redundant. We can use the hdcp_ver itself.

Agreed.

>> +	snprintf(wrbuf, sizeof(wrbuf), "%d", wr_ver);
>> +	strcpy(filename, output->name);
>> +	strcat(filename, "/i915_hdcp_version_request");
>> +	ret = igt_sysfs_write(fd, filename, wrbuf, 1);
>> +	if (ret <= 0) {
>> +		igt_info("Failed to write into debugfs ret = %d\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	close(fd);
> Can't we do the write and read on same fd? why do we clsoe and reopen?

You are right, thanks for pointing this out. Will be fixing in next version.

>> +
>> +	fd = igt_debugfs_connector_dir(data.drm_fd, output->name, O_RDONLY);
>> +	if (fd < 0) {
>> +		igt_info("Failed to open debugfs for read ret = %d", errno);
>> +		return errno;
>> +	}
>> +
>> +	debugfs_read(fd, "i915_hdcp_version_request", rdbuf);
>> +	igt_debug("%s\n", rdbuf);
>> +
>> +	close(fd);
>> +
>> +	read_ver_str = strstr(rdbuf, "HDCP_VER_FLAGS: ");
>> +	if (!read_ver_str)
>> +		return -1;
>> +
>> +	igt_debug("HDCP ver = %s\n", read_ver_str + strlen("HDCP_VER_FLAGS: "));
>> +
>> +	rd_ver = atoi(read_ver_str + strlen("HDCP_VER_FLAGS: "));
>> +	if (rd_ver != wr_ver)
> can use the hdcp_ver itself.

Agreed.

Also, I have realized, reading from debugfs after write is unnecessary, 
so I will be

first reading the debugfs for the version, and return if its already 
set, as what is required.

Otherwise simply write the requested hdcp version and check if write was 
successful.


Regards,
Ankit

> Approach looks good to me..
>
> -Ram
>> +		return -1;
>> +
>> +	return 0;
>> +}
>> +
>> +igt_main
>> +{
>> +	int i;
>> +	struct cp_protocol {
>> +		const char *name;
>> +		int content_type;
>> +		int version;
>> +	} hdcp_protocol[] = {
>> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0, HDCP_14},
>> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1, HDCP_22} };
>> +
>> +	igt_fixture {
>> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>> +
>> +		igt_display_require(&data.display, data.drm_fd);
>> +	}
>> +
>> +	for (i = 0; i < ARRAY_SIZE(hdcp_protocol); i++) {
>> +		igt_subtest_with_dynamic_f("%s", hdcp_protocol[i].name) {
>> +			igt_output_t *output;
>> +			int content_type = hdcp_protocol[i].content_type;
>> +
>> +			for_each_connected_output(&data.display, output) {
>> +				int ret;
>> +
>> +				if (!is_valid_output(output, content_type))
>> +					continue;
>> +				ret = request_hdcp_ver(output,
>> +						       hdcp_protocol[i].version);
>> +				if (ret) {
>> +					igt_info("Cannot set the required version for %s\n",
>> +						 output->name);
>> +					continue;
>> +				}
>> +				test_content_protection_dynamic(output,
>> +								content_type);
>> +
>> +				/* TODO: Revert to older HDCP ver that was set, previously */
>> +			}
>> +		}
>>   	}
>>   
>>   	igt_fixture {
>> -- 
>> 2.17.1
>>

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

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

end of thread, other threads:[~2020-06-08  8:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01  8:39 [igt-dev] [RFC i-g-t 0/2] tests/kms_content_protection: Enhancements Ankit Nautiyal
2020-06-01  8:39 ` [igt-dev] [RFC i-g-t 1/2] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
2020-06-01 10:41   ` Ramalingam C
2020-06-08  8:37     ` Nautiyal, Ankit K
2020-06-01  8:40 ` [igt-dev] [RFC i-g-t 2/2] tests/kms_content_protection: Remove pre-existing SRM table before the test Ankit Nautiyal
2020-06-01 10:46   ` Ramalingam C
2020-06-01  9:16 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_content_protection: Enhancements (rev2) Patchwork
2020-06-01 11:33 ` [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.