All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
@ 2020-03-20  9:03 Ankit Nautiyal
  2020-03-20  9:58 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Ankit Nautiyal @ 2020-03-20  9:03 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

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 forcing the driver to use HDCP1.4, the
kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
completed, the module is re-loaded.

This patch also makes the existing subtests as dynamic sub-subtests
based on all outputs supporting the protocol under test.
This helps in running together all HDCP1.4 tests for all outputs
that support HDCP1.4, avoiding the need of loading and unloading
of 'mei_hdcp' module for each test.

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

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 3b9cedcb..1472e987 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						0
+#define HDCP_22						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)
@@ -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;
+}
 
-	igt_subtest("legacy") {
+static void
+test_content_protection_dynamic(igt_output_t *output, int content_type)
+{
+
+	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);
+		test_content_protection_on_output(output, COMMIT_ATOMIC,
+						  content_type);
 	}
 
-	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);
-	}
-
-	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,78 @@ 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);
+	}
+}
+
+igt_main
+{
+	int i;
+	struct cp_protocol {
+		const char *name;
+		int content_type;
+	} protocol[] = {
+		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
+		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
+
+	igt_fixture {
+		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+		igt_display_require(&data.display, data.drm_fd);
+	}
+
+	for (i = 0; i < 2; i++) {
+		bool force_mei_hdcp_off = false;
+
+		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
+		 * HDCP2.2 is always chosen as default by the driver, even for
+		 * the TYPE 0 content.
+		 *
+		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
+		 * unloaded. This takes away the HDCP2.2 support from the
+		 * platform, and HDCP1.4 can be tested. After the test the
+		 * module is loaded again and HDCP2.2 support gets re-enabled.
+		 */
+		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
+			igt_kmod_unload("mei_hdcp", 0);
+			force_mei_hdcp_off = true;
+		}
+
+		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
+			igt_output_t *output;
+			int content_type = protocol[i].content_type;
+
+			for_each_connected_output(&data.display, output) {
+				if (!is_valid_output(output, content_type))
+					continue;
+				test_content_protection_dynamic(output,
+								content_type);
+			}
+		}
+		if (force_mei_hdcp_off)
+			igt_kmod_load("mei_hdcp", NULL);
 	}
 
 	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] 15+ messages in thread

* [igt-dev] ✗ GitLab.Pipeline: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
@ 2020-03-20  9:58 ` Patchwork
  2020-03-20 10:15 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2020-03-20  9:58 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
URL   : https://patchwork.freedesktop.org/series/74911/
State : failure

== Summary ==

ERROR! This series introduces new undocumented tests:

kms_content_protection@hdcp-1_4
kms_content_protection@hdcp-2_2

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/122151 for the overview.

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/122151
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
  2020-03-20  9:58 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
@ 2020-03-20 10:15 ` Patchwork
  2020-03-20 11:05   ` Petri Latvala
  2020-03-20 10:28 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Patchwork @ 2020-03-20 10:15 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
URL   : https://patchwork.freedesktop.org/series/74911/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8163 -> IGTPW_4334
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4334 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4334, 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_4334/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live@gtt:
    - fi-kbl-soraka:      [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-kbl-soraka/igt@i915_selftest@live@gtt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-kbl-soraka/igt@i915_selftest@live@gtt.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@execlists:
    - fi-glk-dsi:         [PASS][3] -> [INCOMPLETE][4] ([i915#58] / [i915#656] / [k.org#198133])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-glk-dsi/igt@i915_selftest@live@execlists.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-glk-dsi/igt@i915_selftest@live@execlists.html
    - fi-cml-u2:          [PASS][5] -> [INCOMPLETE][6] ([i915#1430] / [i915#283] / [i915#656])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-u2/igt@i915_selftest@live@execlists.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-u2/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gem_contexts:
    - fi-cml-s:           [PASS][7] -> [DMESG-FAIL][8] ([i915#877])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-s/igt@i915_selftest@live@gem_contexts.html

  * igt@i915_selftest@live@hangcheck:
    - fi-icl-y:           [PASS][9] -> [INCOMPLETE][10] ([fdo#108569])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-icl-y/igt@i915_selftest@live@hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-icl-y/igt@i915_selftest@live@hangcheck.html

  
#### Possible fixes ####

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-cfl-8109u:       [FAIL][11] ([fdo#103375]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-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).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#283]: https://gitlab.freedesktop.org/drm/intel/issues/283
  [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
  [i915#647]: https://gitlab.freedesktop.org/drm/intel/issues/647
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
  [i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  Additional (3): fi-skl-6770hq fi-skl-6600u fi-elk-e7500 
  Missing    (3): fi-byt-squawks fi-bsw-cyan fi-cfl-guc 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5523 -> IGTPW_4334

  CI-20190529: 20190529
  CI_DRM_8163: 710b3af22d17146897a55f01868d8e2d867895d3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4334: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/index.html
  IGT_5523: cf6d524007ac51a7d5a48503ea3dd5f01fd4ebab @ 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_4334/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
  2020-03-20  9:58 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
  2020-03-20 10:15 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
@ 2020-03-20 10:28 ` Petri Latvala
  2020-03-23  3:59   ` Nautiyal, Ankit K
  2020-03-20 12:46 ` Ramalingam C
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Petri Latvala @ 2020-03-20 10:28 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

On Fri, Mar 20, 2020 at 02:33:40PM +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 forcing the driver to use HDCP1.4, the
> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
> completed, the module is re-loaded.
> 
> This patch also makes the existing subtests as dynamic sub-subtests
> based on all outputs supporting the protocol under test.
> This helps in running together all HDCP1.4 tests for all outputs
> that support HDCP1.4, avoiding the need of loading and unloading
> of 'mei_hdcp' module for each test.
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>  1 file changed, 113 insertions(+), 72 deletions(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 3b9cedcb..1472e987 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						0
> +#define HDCP_22						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)
> @@ -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;
> +}
>  
> -	igt_subtest("legacy") {
> +static void
> +test_content_protection_dynamic(igt_output_t *output, int content_type)
> +{
> +
> +	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);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	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);
> -	}
> -
> -	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,78 @@ 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);
> +	}
> +}
> +
> +igt_main
> +{
> +	int i;
> +	struct cp_protocol {
> +		const char *name;
> +		int content_type;
> +	} protocol[] = {
> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.drm_fd);
> +	}
> +
> +	for (i = 0; i < 2; i++) {
> +		bool force_mei_hdcp_off = false;
> +
> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
> +		 * HDCP2.2 is always chosen as default by the driver, even for
> +		 * the TYPE 0 content.
> +		 *
> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
> +		 * unloaded. This takes away the HDCP2.2 support from the
> +		 * platform, and HDCP1.4 can be tested. After the test the
> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
> +		 */
> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
> +			igt_kmod_unload("mei_hdcp", 0);
> +			force_mei_hdcp_off = true;
> +		}

Move this and the kmod_load block that is below into the
subtest. Doing igt_kmod_{,un}load() outside of a fixture/subtest is
invalid.

Like this:

igt_subtest_with_dynamic_f(...) {
  if (...) {
    kmod_unload();
    force = true;
  }

  for_each_connected_output(...) {
     ...
  }

  if (force)
     kmod_load();
}

Do we want to assert that unload succeeded? And only load mei_hdcp
back if it _was_ loaded?

-- 
Petri Latvala



> +
> +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
> +			igt_output_t *output;
> +			int content_type = protocol[i].content_type;
> +
> +			for_each_connected_output(&data.display, output) {
> +				if (!is_valid_output(output, content_type))
> +					continue;
> +				test_content_protection_dynamic(output,
> +								content_type);
> +			}
> +		}
> +		if (force_mei_hdcp_off)
> +			igt_kmod_load("mei_hdcp", NULL);
>  	}
>  
>  	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] 15+ messages in thread

* Re: [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 10:15 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
@ 2020-03-20 11:05   ` Petri Latvala
  2020-03-20 13:51     ` Vudum, Lakshminarayana
  0 siblings, 1 reply; 15+ messages in thread
From: Petri Latvala @ 2020-03-20 11:05 UTC (permalink / raw)
  To: igt-dev, Lakshminarayana Vudum

On Fri, Mar 20, 2020 at 10:15:22AM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
> URL   : https://patchwork.freedesktop.org/series/74911/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_8163 -> IGTPW_4334
> ====================================================
> 
> Summary
> -------
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with IGTPW_4334 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in IGTPW_4334, 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_4334/index.html
> 
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in IGTPW_4334:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@i915_selftest@live@gtt:
>     - fi-kbl-soraka:      [PASS][1] -> [INCOMPLETE][2]
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-kbl-soraka/igt@i915_selftest@live@gtt.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-kbl-soraka/igt@i915_selftest@live@gtt.html


Lakshmi, false positive.


-- 
Petri Latvala



> 
>   
> Known issues
> ------------
> 
>   Here are the changes found in IGTPW_4334 that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@i915_selftest@live@execlists:
>     - fi-glk-dsi:         [PASS][3] -> [INCOMPLETE][4] ([i915#58] / [i915#656] / [k.org#198133])
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-glk-dsi/igt@i915_selftest@live@execlists.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-glk-dsi/igt@i915_selftest@live@execlists.html
>     - fi-cml-u2:          [PASS][5] -> [INCOMPLETE][6] ([i915#1430] / [i915#283] / [i915#656])
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-u2/igt@i915_selftest@live@execlists.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-u2/igt@i915_selftest@live@execlists.html
> 
>   * igt@i915_selftest@live@gem_contexts:
>     - fi-cml-s:           [PASS][7] -> [DMESG-FAIL][8] ([i915#877])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
> 
>   * igt@i915_selftest@live@hangcheck:
>     - fi-icl-y:           [PASS][9] -> [INCOMPLETE][10] ([fdo#108569])
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-icl-y/igt@i915_selftest@live@hangcheck.html
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-icl-y/igt@i915_selftest@live@hangcheck.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
>     - fi-cfl-8109u:       [FAIL][11] ([fdo#103375]) -> [PASS][12]
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-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).
> 
>   [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
>   [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
>   [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
>   [i915#283]: https://gitlab.freedesktop.org/drm/intel/issues/283
>   [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
>   [i915#647]: https://gitlab.freedesktop.org/drm/intel/issues/647
>   [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
>   [i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877
>   [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
> 
> 
> Participating hosts (41 -> 41)
> ------------------------------
> 
>   Additional (3): fi-skl-6770hq fi-skl-6600u fi-elk-e7500 
>   Missing    (3): fi-byt-squawks fi-bsw-cyan fi-cfl-guc 
> 
> 
> Build changes
> -------------
> 
>   * CI: CI-20190529 -> None
>   * IGT: IGT_5523 -> IGTPW_4334
> 
>   CI-20190529: 20190529
>   CI_DRM_8163: 710b3af22d17146897a55f01868d8e2d867895d3 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGTPW_4334: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/index.html
>   IGT_5523: cf6d524007ac51a7d5a48503ea3dd5f01fd4ebab @ 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_4334/index.html
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
                   ` (2 preceding siblings ...)
  2020-03-20 10:28 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
@ 2020-03-20 12:46 ` Ramalingam C
  2020-03-23  4:01   ` Nautiyal, Ankit K
  2020-03-20 13:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Ramalingam C @ 2020-03-20 12:46 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev, petri.latvala

On 2020-03-20 at 14:33:40 +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 forcing the driver to use HDCP1.4, the
> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
> completed, the module is re-loaded.
> 
> This patch also makes the existing subtests as dynamic sub-subtests
> based on all outputs supporting the protocol under test.
> This helps in running together all HDCP1.4 tests for all outputs
> that support HDCP1.4, avoiding the need of loading and unloading
> of 'mei_hdcp' module for each test.

Thanks for taking this up. Long pending item in to-do list.

> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>  1 file changed, 113 insertions(+), 72 deletions(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 3b9cedcb..1472e987 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						0
#define HDCP14 HDCP_CONTENT_TYPE_0 ?
> +#define HDCP_22						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)
> @@ -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;
> +}
>  
> -	igt_subtest("legacy") {
> +static void
> +test_content_protection_dynamic(igt_output_t *output, int content_type)
> +{
> +
> +	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);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	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);
> -	}
> -
> -	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,78 @@ 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)
We can move this as igt_require into the subtests of mei and type
change.
> +		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);
> +	}
> +}
> +
> +igt_main
> +{
> +	int i;
> +	struct cp_protocol {
> +		const char *name;
> +		int content_type;
> +	} protocol[] = {
Could we name it as hdcp_version ? Will be easily giving the purpose...
> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.drm_fd);
> +	}
> +
> +	for (i = 0; i < 2; i++) {
Could we use the array_size of protocol/hdcp_spec_ver
> +		bool force_mei_hdcp_off = false;
> +
> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
> +		 * HDCP2.2 is always chosen as default by the driver, even for
> +		 * the TYPE 0 content.
> +		 *
> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
> +		 * unloaded. This takes away the HDCP2.2 support from the
> +		 * platform, and HDCP1.4 can be tested. After the test the
> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
> +		 */
> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
> +			igt_kmod_unload("mei_hdcp", 0);
As petri mentioned, we need to assert on unload and load also.
With that this might need to be moved into subtest. Not sure whether
this can be kept out of output loop. Please check.

-Ram
> +			force_mei_hdcp_off = true;
> +		}
> +
> +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
> +			igt_output_t *output;
> +			int content_type = protocol[i].content_type;
> +
> +			for_each_connected_output(&data.display, output) {
> +				if (!is_valid_output(output, content_type))
> +					continue;
> +				test_content_protection_dynamic(output,
> +								content_type);
> +			}
> +		}
> +		if (force_mei_hdcp_off)
> +			igt_kmod_load("mei_hdcp", NULL);
>  	}
>  
>  	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] 15+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
                   ` (3 preceding siblings ...)
  2020-03-20 12:46 ` Ramalingam C
@ 2020-03-20 13:43 ` Patchwork
  2020-03-20 16:03 ` [igt-dev] [PATCH i-g-t] " Peres, Martin
  2020-03-20 17:07 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
  6 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2020-03-20 13:43 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
URL   : https://patchwork.freedesktop.org/series/74911/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8163 -> IGTPW_4334
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@execlists:
    - fi-glk-dsi:         [PASS][1] -> [INCOMPLETE][2] ([i915#58] / [i915#656] / [k.org#198133])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-glk-dsi/igt@i915_selftest@live@execlists.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-glk-dsi/igt@i915_selftest@live@execlists.html
    - fi-cml-u2:          [PASS][3] -> [INCOMPLETE][4] ([i915#1430] / [i915#283] / [i915#656])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-u2/igt@i915_selftest@live@execlists.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-u2/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gem_contexts:
    - fi-cml-s:           [PASS][5] -> [DMESG-FAIL][6] ([i915#877])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-s/igt@i915_selftest@live@gem_contexts.html

  * igt@i915_selftest@live@gtt:
    - fi-kbl-soraka:      [PASS][7] -> [INCOMPLETE][8] ([i915#1493])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-kbl-soraka/igt@i915_selftest@live@gtt.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-kbl-soraka/igt@i915_selftest@live@gtt.html

  * igt@i915_selftest@live@hangcheck:
    - fi-icl-y:           [PASS][9] -> [INCOMPLETE][10] ([fdo#108569])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-icl-y/igt@i915_selftest@live@hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-icl-y/igt@i915_selftest@live@hangcheck.html

  
#### Possible fixes ####

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - fi-cfl-8109u:       [FAIL][11] ([fdo#103375]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-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).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#1493]: https://gitlab.freedesktop.org/drm/intel/issues/1493
  [i915#283]: https://gitlab.freedesktop.org/drm/intel/issues/283
  [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
  [i915#647]: https://gitlab.freedesktop.org/drm/intel/issues/647
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
  [i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


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

  Additional (3): fi-skl-6770hq fi-skl-6600u fi-elk-e7500 
  Missing    (3): fi-byt-squawks fi-bsw-cyan fi-cfl-guc 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5523 -> IGTPW_4334

  CI-20190529: 20190529
  CI_DRM_8163: 710b3af22d17146897a55f01868d8e2d867895d3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4334: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/index.html
  IGT_5523: cf6d524007ac51a7d5a48503ea3dd5f01fd4ebab @ 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_4334/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 11:05   ` Petri Latvala
@ 2020-03-20 13:51     ` Vudum, Lakshminarayana
  0 siblings, 0 replies; 15+ messages in thread
From: Vudum, Lakshminarayana @ 2020-03-20 13:51 UTC (permalink / raw)
  To: Latvala, Petri, igt-dev

Addressed and re-reported.


-----Original Message-----
From: Latvala, Petri <petri.latvala@intel.com> 
Sent: Friday, March 20, 2020 1:06 PM
To: igt-dev@lists.freedesktop.org; Vudum, Lakshminarayana <lakshminarayana.vudum@intel.com>
Cc: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
Subject: Re: [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2

On Fri, Mar 20, 2020 at 10:15:22AM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
> URL   : https://patchwork.freedesktop.org/series/74911/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_8163 -> IGTPW_4334 
> ====================================================
> 
> Summary
> -------
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with IGTPW_4334 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in IGTPW_4334, 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_4334/index.html
> 
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in IGTPW_4334:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@i915_selftest@live@gtt:
>     - fi-kbl-soraka:      [PASS][1] -> [INCOMPLETE][2]
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-kbl-soraka/igt@i915_selftest@live@gtt.html
>    [2]: 
> https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-kbl-soraka/igt@
> i915_selftest@live@gtt.html


Lakshmi, false positive.


--
Petri Latvala



> 
>   
> Known issues
> ------------
> 
>   Here are the changes found in IGTPW_4334 that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@i915_selftest@live@execlists:
>     - fi-glk-dsi:         [PASS][3] -> [INCOMPLETE][4] ([i915#58] / [i915#656] / [k.org#198133])
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-glk-dsi/igt@i915_selftest@live@execlists.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-glk-dsi/igt@i915_selftest@live@execlists.html
>     - fi-cml-u2:          [PASS][5] -> [INCOMPLETE][6] ([i915#1430] / [i915#283] / [i915#656])
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-u2/igt@i915_selftest@live@execlists.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-u2/igt@i915_selftest@live@execlists.html
> 
>   * igt@i915_selftest@live@gem_contexts:
>     - fi-cml-s:           [PASS][7] -> [DMESG-FAIL][8] ([i915#877])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
> 
>   * igt@i915_selftest@live@hangcheck:
>     - fi-icl-y:           [PASS][9] -> [INCOMPLETE][10] ([fdo#108569])
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-icl-y/igt@i915_selftest@live@hangcheck.html
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-icl-y/igt@i915_selftest@live@hangcheck.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
>     - fi-cfl-8109u:       [FAIL][11] ([fdo#103375]) -> [PASS][12]
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/fi-cfl-8109u/igt@kms_pipe_crc_basic@suspend-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).
> 
>   [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
>   [fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
>   [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
>   [i915#283]: https://gitlab.freedesktop.org/drm/intel/issues/283
>   [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
>   [i915#647]: https://gitlab.freedesktop.org/drm/intel/issues/647
>   [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
>   [i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877
>   [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
> 
> 
> Participating hosts (41 -> 41)
> ------------------------------
> 
>   Additional (3): fi-skl-6770hq fi-skl-6600u fi-elk-e7500 
>   Missing    (3): fi-byt-squawks fi-bsw-cyan fi-cfl-guc 
> 
> 
> Build changes
> -------------
> 
>   * CI: CI-20190529 -> None
>   * IGT: IGT_5523 -> IGTPW_4334
> 
>   CI-20190529: 20190529
>   CI_DRM_8163: 710b3af22d17146897a55f01868d8e2d867895d3 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGTPW_4334: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/index.html
>   IGT_5523: cf6d524007ac51a7d5a48503ea3dd5f01fd4ebab @ 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_4334/index.html
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
                   ` (4 preceding siblings ...)
  2020-03-20 13:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2020-03-20 16:03 ` Peres, Martin
  2020-03-23  5:04   ` Nautiyal, Ankit K
  2020-03-23  6:33   ` Ramalingam C
  2020-03-20 17:07 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
  6 siblings, 2 replies; 15+ messages in thread
From: Peres, Martin @ 2020-03-20 16:03 UTC (permalink / raw)
  To: Nautiyal, Ankit K, igt-dev; +Cc: Latvala, Petri

[-- Attachment #1: Type: text/plain, Size: 9366 bytes --]

On 2020-03-20 11:03, 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.

Thanks for working on it!

> 
> This patch makes two versions of the existing subtests for testing
> HDCP1.4 and HDCP2.2. For forcing the driver to use HDCP1.4, the
> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
> completed, the module is re-loaded.
> 
> This patch also makes the existing subtests as dynamic sub-subtests
> based on all outputs supporting the protocol under test.
> This helps in running together all HDCP1.4 tests for all outputs
> that support HDCP1.4, avoiding the need of loading and unloading
> of 'mei_hdcp' module for each test.

That sounds like a complicated process which won't scale to future
versions of HDCP (no reason to assume they will stop pumping them out).

How about adding a debugfs file that lists the supported hdcp versions
for every connector, says which one is being used right now, and
force-disable one or many so as to be able to validate all the cases?

Martin
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>  1 file changed, 113 insertions(+), 72 deletions(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 3b9cedcb..1472e987 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						0
> +#define HDCP_22						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)
> @@ -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;
> +}
>  
> -	igt_subtest("legacy") {
> +static void
> +test_content_protection_dynamic(igt_output_t *output, int content_type)
> +{
> +
> +	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);
> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> +						  content_type);
>  	}
>  
> -	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);
> -	}
> -
> -	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,78 @@ 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);
> +	}
> +}
> +
> +igt_main
> +{
> +	int i;
> +	struct cp_protocol {
> +		const char *name;
> +		int content_type;
> +	} protocol[] = {
> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
> +
> +	igt_fixture {
> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +
> +		igt_display_require(&data.display, data.drm_fd);
> +	}
> +
> +	for (i = 0; i < 2; i++) {
> +		bool force_mei_hdcp_off = false;
> +
> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
> +		 * HDCP2.2 is always chosen as default by the driver, even for
> +		 * the TYPE 0 content.
> +		 *
> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
> +		 * unloaded. This takes away the HDCP2.2 support from the
> +		 * platform, and HDCP1.4 can be tested. After the test the
> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
> +		 */
> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
> +			igt_kmod_unload("mei_hdcp", 0);
> +			force_mei_hdcp_off = true;
> +		}
> +
> +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
> +			igt_output_t *output;
> +			int content_type = protocol[i].content_type;
> +
> +			for_each_connected_output(&data.display, output) {
> +				if (!is_valid_output(output, content_type))
> +					continue;
> +				test_content_protection_dynamic(output,
> +								content_type);
> +			}
> +		}
> +		if (force_mei_hdcp_off)
> +			igt_kmod_load("mei_hdcp", NULL);
>  	}
>  
>  	igt_fixture {
> 


[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1774 bytes --]

[-- Attachment #3: Type: text/plain, Size: 154 bytes --]

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

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

* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
                   ` (5 preceding siblings ...)
  2020-03-20 16:03 ` [igt-dev] [PATCH i-g-t] " Peres, Martin
@ 2020-03-20 17:07 ` Patchwork
  6 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2020-03-20 17:07 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
URL   : https://patchwork.freedesktop.org/series/74911/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8163_full -> IGTPW_4334_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_4334_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_4334_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_4334/index.html

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@gem_ctx_isolation@rcs0-s3:
    - shard-kbl:          [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@gem_ctx_isolation@rcs0-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl3/igt@gem_ctx_isolation@rcs0-s3.html

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

  * {igt@kms_content_protection@hdcp-1_4@legacy-dp-1} (NEW):
    - shard-kbl:          NOTRUN -> [INCOMPLETE][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl3/igt@kms_content_protection@hdcp-1_4@legacy-dp-1.html

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

  
New tests
---------

  New tests have been introduced between CI_DRM_8163_full and IGTPW_4334_full:

### New IGT tests (3) ###

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

  * igt@kms_content_protection@hdcp-1_4@legacy-dp-1:
    - Statuses : 2 incomplete(s)
    - Exec time: [0.0] 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_4334_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_busy@busy-vcs1:
    - shard-iclb:         [PASS][6] -> [SKIP][7] ([fdo#112080]) +7 similar issues
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@gem_busy@busy-vcs1.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb7/igt@gem_busy@busy-vcs1.html

  * igt@gem_ctx_persistence@close-replace-race:
    - shard-iclb:         [PASS][8] -> [INCOMPLETE][9] ([i915#1402])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb4/igt@gem_ctx_persistence@close-replace-race.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb8/igt@gem_ctx_persistence@close-replace-race.html

  * igt@gem_exec_schedule@implicit-read-write-bsd2:
    - shard-iclb:         [PASS][10] -> [SKIP][11] ([fdo#109276] / [i915#677])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb1/igt@gem_exec_schedule@implicit-read-write-bsd2.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb3/igt@gem_exec_schedule@implicit-read-write-bsd2.html

  * igt@gem_exec_schedule@independent-bsd2:
    - shard-iclb:         [PASS][12] -> [SKIP][13] ([fdo#109276]) +15 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@gem_exec_schedule@independent-bsd2.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb5/igt@gem_exec_schedule@independent-bsd2.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
    - shard-iclb:         [PASS][14] -> [SKIP][15] ([i915#677]) +2 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb6/igt@gem_exec_schedule@pi-distinct-iova-bsd.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb4/igt@gem_exec_schedule@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preempt-queue-bsd:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([fdo#112146]) +2 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb3/igt@gem_exec_schedule@preempt-queue-bsd.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb4/igt@gem_exec_schedule@preempt-queue-bsd.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-apl:          [PASS][18] -> [FAIL][19] ([i915#644])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-apl8/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-apl6/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@gem_workarounds@suspend-resume-fd:
    - shard-kbl:          [PASS][20] -> [DMESG-WARN][21] ([i915#180]) +6 similar issues
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@gem_workarounds@suspend-resume-fd.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl7/igt@gem_workarounds@suspend-resume-fd.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-kbl:          [PASS][22] -> [DMESG-WARN][23] ([i915#716])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl6/igt@gen9_exec_parse@allowed-all.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl2/igt@gen9_exec_parse@allowed-all.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
    - shard-glk:          [PASS][24] -> [FAIL][25] ([i915#79])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-glk1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-glk2/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-apl:          [PASS][26] -> [DMESG-WARN][27] ([i915#180])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-apl3/igt@kms_flip@flip-vs-suspend-interruptible.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-apl1/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][28] -> [SKIP][29] ([fdo#109441]) +3 similar issues
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_setmode@basic:
    - shard-kbl:          [PASS][30] -> [FAIL][31] ([i915#31])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl2/igt@kms_setmode@basic.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl4/igt@kms_setmode@basic.html

  * igt@perf@short-reads:
    - shard-apl:          [PASS][32] -> [FAIL][33] ([i915#51])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-apl1/igt@perf@short-reads.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-apl1/igt@perf@short-reads.html

  
#### Possible fixes ####

  * igt@gem_ctx_persistence@close-replace-race:
    - shard-kbl:          [INCOMPLETE][34] ([i915#1402]) -> [PASS][35]
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@gem_ctx_persistence@close-replace-race.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl4/igt@gem_ctx_persistence@close-replace-race.html

  * igt@gem_exec_schedule@implicit-both-bsd:
    - shard-iclb:         [SKIP][36] ([i915#677]) -> [PASS][37]
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@gem_exec_schedule@implicit-both-bsd.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb7/igt@gem_exec_schedule@implicit-both-bsd.html

  * igt@gem_exec_schedule@implicit-both-bsd1:
    - shard-iclb:         [SKIP][38] ([fdo#109276] / [i915#677]) -> [PASS][39] +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb5/igt@gem_exec_schedule@implicit-both-bsd1.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb4/igt@gem_exec_schedule@implicit-both-bsd1.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [SKIP][40] ([fdo#112146]) -> [PASS][41] +6 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb6/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_exec_schedule@preempt-queue-bsd1:
    - shard-iclb:         [SKIP][42] ([fdo#109276]) -> [PASS][43] +16 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb6/igt@gem_exec_schedule@preempt-queue-bsd1.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb1/igt@gem_exec_schedule@preempt-queue-bsd1.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-tglb:         [INCOMPLETE][44] ([i915#1318] / [i915#1401]) -> [PASS][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-tglb8/igt@gem_exec_whisper@basic-fds-forked.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-tglb5/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-kbl:          [FAIL][46] ([i915#644]) -> [PASS][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl6/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@i915_module_load@reload-with-fault-injection:
    - shard-kbl:          [INCOMPLETE][48] ([i915#879]) -> [PASS][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@i915_module_load@reload-with-fault-injection.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl3/igt@i915_module_load@reload-with-fault-injection.html

  * igt@i915_pm_dc@dc5-dpms:
    - shard-iclb:         [FAIL][50] ([i915#447]) -> [PASS][51]
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb3/igt@i915_pm_dc@dc5-dpms.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb7/igt@i915_pm_dc@dc5-dpms.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [FAIL][52] ([i915#454]) -> [PASS][53]
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb4/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_rpm@gem-execbuf:
    - shard-iclb:         [SKIP][54] ([i915#1316]) -> [PASS][55]
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb1/igt@i915_pm_rpm@gem-execbuf.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb8/igt@i915_pm_rpm@gem-execbuf.html
    - shard-glk:          [SKIP][56] ([fdo#109271]) -> [PASS][57]
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-glk2/igt@i915_pm_rpm@gem-execbuf.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-glk3/igt@i915_pm_rpm@gem-execbuf.html
    - shard-tglb:         [SKIP][58] ([i915#1316]) -> [PASS][59]
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-tglb8/igt@i915_pm_rpm@gem-execbuf.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-tglb5/igt@i915_pm_rpm@gem-execbuf.html

  * igt@i915_pm_rps@reset:
    - shard-iclb:         [FAIL][60] ([i915#413]) -> [PASS][61]
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb2/igt@i915_pm_rps@reset.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb7/igt@i915_pm_rps@reset.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][62] ([i915#180]) -> [PASS][63] +5 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
    - shard-apl:          [DMESG-WARN][64] ([i915#180]) -> [PASS][65] +3 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-apl8/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-apl3/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [FAIL][66] ([i915#72]) -> [PASS][67]
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-glk3/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-glk6/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_frontbuffer_tracking@fbc-2p-indfb-fliptrack:
    - shard-glk:          [FAIL][68] ([i915#49]) -> [PASS][69]
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-glk1/igt@kms_frontbuffer_tracking@fbc-2p-indfb-fliptrack.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-glk4/igt@kms_frontbuffer_tracking@fbc-2p-indfb-fliptrack.html

  * igt@kms_plane@plane-panning-bottom-right-pipe-c-planes:
    - shard-glk:          [INCOMPLETE][70] ([i915#58] / [k.org#198133]) -> [PASS][71]
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-glk4/igt@kms_plane@plane-panning-bottom-right-pipe-c-planes.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-glk5/igt@kms_plane@plane-panning-bottom-right-pipe-c-planes.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [SKIP][72] ([fdo#109441]) -> [PASS][73] +2 similar issues
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb7/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@perf_pmu@busy-vcs1:
    - shard-iclb:         [SKIP][74] ([fdo#112080]) -> [PASS][75] +17 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-iclb6/igt@perf_pmu@busy-vcs1.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-iclb4/igt@perf_pmu@busy-vcs1.html

  
#### Warnings ####

  * igt@gem_ctx_persistence@close-replace-race:
    - shard-tglb:         [INCOMPLETE][76] ([i915#1492]) -> [INCOMPLETE][77] ([i915#1402])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-tglb3/igt@gem_ctx_persistence@close-replace-race.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-tglb5/igt@gem_ctx_persistence@close-replace-race.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-tglb:         [FAIL][78] ([i915#454]) -> [SKIP][79] ([i915#468])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-tglb3/igt@i915_pm_dc@dc6-psr.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-tglb2/igt@i915_pm_dc@dc6-psr.html

  * igt@perf_pmu@busy-accuracy-2-vecs0:
    - shard-snb:          [INCOMPLETE][80] ([i915#82]) -> [SKIP][81] ([fdo#109271])
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-snb6/igt@perf_pmu@busy-accuracy-2-vecs0.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-snb6/igt@perf_pmu@busy-accuracy-2-vecs0.html

  * igt@runner@aborted:
    - shard-kbl:          ([FAIL][82], [FAIL][83]) ([i915#1389] / [i915#1402] / [i915#92]) -> [FAIL][84] ([i915#716])
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@runner@aborted.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-kbl4/igt@runner@aborted.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-kbl2/igt@runner@aborted.html
    - shard-tglb:         [FAIL][85] ([i915#1389] / [i915#1485]) -> [FAIL][86] ([i915#1389])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8163/shard-tglb3/igt@runner@aborted.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/shard-tglb5/igt@runner@aborted.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#1316]: https://gitlab.freedesktop.org/drm/intel/issues/1316
  [i915#1318]: https://gitlab.freedesktop.org/drm/intel/issues/1318
  [i915#1389]: https://gitlab.freedesktop.org/drm/intel/issues/1389
  [i915#1401]: https://gitlab.freedesktop.org/drm/intel/issues/1401
  [i915#1402]: https://gitlab.freedesktop.org/drm/intel/issues/1402
  [i915#1485]: https://gitlab.freedesktop.org/drm/intel/issues/1485
  [i915#1492]: https://gitlab.freedesktop.org/drm/intel/issues/1492
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#447]: https://gitlab.freedesktop.org/drm/intel/issues/447
  [i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
  [i915#468]: https://gitlab.freedesktop.org/drm/intel/issues/468
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#51]: https://gitlab.freedesktop.org/drm/intel/issues/51
  [i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [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#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#879]: https://gitlab.freedesktop.org/drm/intel/issues/879
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133


Participating hosts (10 -> 8)
------------------------------

  Missing    (2): pig-skl-6260u pig-glk-j5005 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_5523 -> IGTPW_4334
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_8163: 710b3af22d17146897a55f01868d8e2d867895d3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_4334: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4334/index.html
  IGT_5523: cf6d524007ac51a7d5a48503ea3dd5f01fd4ebab @ 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_4334/index.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 10:28 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
@ 2020-03-23  3:59   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 15+ messages in thread
From: Nautiyal, Ankit K @ 2020-03-23  3:59 UTC (permalink / raw)
  To: Latvala, Petri; +Cc: igt-dev



On 3/20/2020 3:58 PM, Latvala, Petri wrote:
> On Fri, Mar 20, 2020 at 02:33:40PM +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 forcing the driver to use HDCP1.4, the
>> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
>> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
>> completed, the module is re-loaded.
>>
>> This patch also makes the existing subtests as dynamic sub-subtests
>> based on all outputs supporting the protocol under test.
>> This helps in running together all HDCP1.4 tests for all outputs
>> that support HDCP1.4, avoiding the need of loading and unloading
>> of 'mei_hdcp' module for each test.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>>   1 file changed, 113 insertions(+), 72 deletions(-)
>>
>> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
>> index 3b9cedcb..1472e987 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						0
>> +#define HDCP_22						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)
>> @@ -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;
>> +}
>>   
>> -	igt_subtest("legacy") {
>> +static void
>> +test_content_protection_dynamic(igt_output_t *output, int content_type)
>> +{
>> +
>> +	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);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	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);
>> -	}
>> -
>> -	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,78 @@ 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);
>> +	}
>> +}
>> +
>> +igt_main
>> +{
>> +	int i;
>> +	struct cp_protocol {
>> +		const char *name;
>> +		int content_type;
>> +	} protocol[] = {
>> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
>> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
>> +
>> +	igt_fixture {
>> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>> +
>> +		igt_display_require(&data.display, data.drm_fd);
>> +	}
>> +
>> +	for (i = 0; i < 2; i++) {
>> +		bool force_mei_hdcp_off = false;
>> +
>> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
>> +		 * HDCP2.2 is always chosen as default by the driver, even for
>> +		 * the TYPE 0 content.
>> +		 *
>> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
>> +		 * unloaded. This takes away the HDCP2.2 support from the
>> +		 * platform, and HDCP1.4 can be tested. After the test the
>> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
>> +		 */
>> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
>> +			igt_kmod_unload("mei_hdcp", 0);
>> +			force_mei_hdcp_off = true;
>> +		}
> Move this and the kmod_load block that is below into the
> subtest. Doing igt_kmod_{,un}load() outside of a fixture/subtest is
> invalid.
>
> Like this:
>
> igt_subtest_with_dynamic_f(...) {
>    if (...) {
>      kmod_unload();
>      force = true;
>    }
>
>    for_each_connected_output(...) {
>       ...
>    }
>
>    if (force)
>       kmod_load();
> }

Thanks for pointing this out. I will take care of this in next patch-set.

> Do we want to assert that unload succeeded? And only load mei_hdcp
> back if it _was_ loaded?
>

I think we can have assert, here.
If the module is there, we should be able to unload and load it.
Will change in next revision.

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

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 12:46 ` Ramalingam C
@ 2020-03-23  4:01   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 15+ messages in thread
From: Nautiyal, Ankit K @ 2020-03-23  4:01 UTC (permalink / raw)
  To: Ramalingam C; +Cc: igt-dev, petri.latvala



On 3/20/2020 6:16 PM, Ramalingam C wrote:
> On 2020-03-20 at 14:33:40 +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 forcing the driver to use HDCP1.4, the
>> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
>> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
>> completed, the module is re-loaded.
>>
>> This patch also makes the existing subtests as dynamic sub-subtests
>> based on all outputs supporting the protocol under test.
>> This helps in running together all HDCP1.4 tests for all outputs
>> that support HDCP1.4, avoiding the need of loading and unloading
>> of 'mei_hdcp' module for each test.
> Thanks for taking this up. Long pending item in to-do list.
>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>>   1 file changed, 113 insertions(+), 72 deletions(-)
>>
>> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
>> index 3b9cedcb..1472e987 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						0
> #define HDCP14 HDCP_CONTENT_TYPE_0 ?

We can use the content type macro, I was using the HDCP14, and HDCP22 as 
array index, than as related directly to content type.
So if new version HDCP23 comes, and still supports type-1, we still need 
HDCP23 as index '2'.
But my case is just hypothetical. We can do what is practical.

>> +#define HDCP_22						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)
>> @@ -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;
>> +}
>>   
>> -	igt_subtest("legacy") {
>> +static void
>> +test_content_protection_dynamic(igt_output_t *output, int content_type)
>> +{
>> +
>> +	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);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	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);
>> -	}
>> -
>> -	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,78 @@ 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)
> We can move this as igt_require into the subtests of mei and type
> change.

Alright, I will try that out.

>> +		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);
>> +	}
>> +}
>> +
>> +igt_main
>> +{
>> +	int i;
>> +	struct cp_protocol {
>> +		const char *name;
>> +		int content_type;
>> +	} protocol[] = {
> Could we name it as hdcp_version ? Will be easily giving the purpose...

Yes that makes more sense. Will change that in next patch.

>> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
>> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
>> +
>> +	igt_fixture {
>> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>> +
>> +		igt_display_require(&data.display, data.drm_fd);
>> +	}
>> +
>> +	for (i = 0; i < 2; i++) {
> Could we use the array_size of protocol/hdcp_spec_ver

Agreed.

>> +		bool force_mei_hdcp_off = false;
>> +
>> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
>> +		 * HDCP2.2 is always chosen as default by the driver, even for
>> +		 * the TYPE 0 content.
>> +		 *
>> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
>> +		 * unloaded. This takes away the HDCP2.2 support from the
>> +		 * platform, and HDCP1.4 can be tested. After the test the
>> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
>> +		 */
>> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
>> +			igt_kmod_unload("mei_hdcp", 0);
> As petri mentioned, we need to assert on unload and load also.
> With that this might need to be moved into subtest. Not sure whether
> this can be kept out of output loop. Please check.
>
> -Ram

Agreed to both. Will fix this in next version

Thanks,
Ankit
>> +			force_mei_hdcp_off = true;
>> +		}
>> +
>> +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
>> +			igt_output_t *output;
>> +			int content_type = protocol[i].content_type;
>> +
>> +			for_each_connected_output(&data.display, output) {
>> +				if (!is_valid_output(output, content_type))
>> +					continue;
>> +				test_content_protection_dynamic(output,
>> +								content_type);
>> +			}
>> +		}
>> +		if (force_mei_hdcp_off)
>> +			igt_kmod_load("mei_hdcp", NULL);
>>   	}
>>   
>>   	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] 15+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 16:03 ` [igt-dev] [PATCH i-g-t] " Peres, Martin
@ 2020-03-23  5:04   ` Nautiyal, Ankit K
  2020-03-23  5:22     ` Anshuman Gupta
  2020-03-23  6:33   ` Ramalingam C
  1 sibling, 1 reply; 15+ messages in thread
From: Nautiyal, Ankit K @ 2020-03-23  5:04 UTC (permalink / raw)
  To: Peres, Martin, igt-dev; +Cc: Latvala, Petri



On 3/20/2020 9:33 PM, Peres, Martin wrote:
> On 2020-03-20 11:03, 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.
> Thanks for working on it!
>
>> This patch makes two versions of the existing subtests for testing
>> HDCP1.4 and HDCP2.2. For forcing the driver to use HDCP1.4, the
>> kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
>> is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
>> completed, the module is re-loaded.
>>
>> This patch also makes the existing subtests as dynamic sub-subtests
>> based on all outputs supporting the protocol under test.
>> This helps in running together all HDCP1.4 tests for all outputs
>> that support HDCP1.4, avoiding the need of loading and unloading
>> of 'mei_hdcp' module for each test.
> That sounds like a complicated process which won't scale to future
> versions of HDCP (no reason to assume they will stop pumping them out).
>
> How about adding a debugfs file that lists the supported hdcp versions
> for every connector, says which one is being used right now, and
> force-disable one or many so as to be able to validate all the cases?
>
> Martin

If I understand correctly, the debugfs will tell two things:

i) The currently selected version for a platform say 'global_hdcp_version'.
The platform will always go with this version of HDCP. So by default it 
is HDCP2.2 for a platform (say KBL), but we can select to use HDCP1.4.

ii) The list of connectors supporting the selected platforms.
So if global_hdcp_version is set to be HDCP2.2, only connectors that 
support HDCP2.2 will be listed.

The test will then become simpler. Reading from the debugfs and start 
with lowest version going to highest supported.
1) Set the global_hdcp_version to hdcp_version[i]
2) Loop for each connector, listed for selected version.
3) set appropriate connector properties.
4) Validate.

The work of making sure, that selected version is chosen, will then lie 
with the driver.
So for KBL/ICL/TGL etc,  default is HDCP2.2, setting to HDCP1.4, it 
might need to unload mei_hdcp.
For next platforms and version, the work might be something different.

I hope I get it right to some extent :) Thanks for the comments.


Regards,
Ankit


>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
>>   1 file changed, 113 insertions(+), 72 deletions(-)
>>
>> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
>> index 3b9cedcb..1472e987 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						0
>> +#define HDCP_22						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)
>> @@ -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;
>> +}
>>   
>> -	igt_subtest("legacy") {
>> +static void
>> +test_content_protection_dynamic(igt_output_t *output, int content_type)
>> +{
>> +
>> +	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);
>> +		test_content_protection_on_output(output, COMMIT_ATOMIC,
>> +						  content_type);
>>   	}
>>   
>> -	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);
>> -	}
>> -
>> -	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,78 @@ 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);
>> +	}
>> +}
>> +
>> +igt_main
>> +{
>> +	int i;
>> +	struct cp_protocol {
>> +		const char *name;
>> +		int content_type;
>> +	} protocol[] = {
>> +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
>> +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
>> +
>> +	igt_fixture {
>> +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>> +
>> +		igt_display_require(&data.display, data.drm_fd);
>> +	}
>> +
>> +	for (i = 0; i < 2; i++) {
>> +		bool force_mei_hdcp_off = false;
>> +
>> +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
>> +		 * HDCP2.2 is always chosen as default by the driver, even for
>> +		 * the TYPE 0 content.
>> +		 *
>> +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
>> +		 * unloaded. This takes away the HDCP2.2 support from the
>> +		 * platform, and HDCP1.4 can be tested. After the test the
>> +		 * module is loaded again and HDCP2.2 support gets re-enabled.
>> +		 */
>> +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
>> +			igt_kmod_unload("mei_hdcp", 0);
>> +			force_mei_hdcp_off = true;
>> +		}
>> +
>> +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
>> +			igt_output_t *output;
>> +			int content_type = protocol[i].content_type;
>> +
>> +			for_each_connected_output(&data.display, output) {
>> +				if (!is_valid_output(output, content_type))
>> +					continue;
>> +				test_content_protection_dynamic(output,
>> +								content_type);
>> +			}
>> +		}
>> +		if (force_mei_hdcp_off)
>> +			igt_kmod_load("mei_hdcp", NULL);
>>   	}
>>   
>>   	igt_fixture {
>>

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

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-23  5:04   ` Nautiyal, Ankit K
@ 2020-03-23  5:22     ` Anshuman Gupta
  0 siblings, 0 replies; 15+ messages in thread
From: Anshuman Gupta @ 2020-03-23  5:22 UTC (permalink / raw)
  To: Nautiyal, Ankit K; +Cc: igt-dev, Peres, Martin, Latvala, Petri

On 2020-03-23 at 10:34:22 +0530, Nautiyal, Ankit K wrote:
> 
> 
> On 3/20/2020 9:33 PM, Peres, Martin wrote:
> >On 2020-03-20 11:03, 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.
> >Thanks for working on it!
> >
> >>This patch makes two versions of the existing subtests for testing
> >>HDCP1.4 and HDCP2.2. For forcing the driver to use HDCP1.4, the
> >>kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
> >>is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
> >>completed, the module is re-loaded.
> >>
> >>This patch also makes the existing subtests as dynamic sub-subtests
> >>based on all outputs supporting the protocol under test.
> >>This helps in running together all HDCP1.4 tests for all outputs
> >>that support HDCP1.4, avoiding the need of loading and unloading
> >>of 'mei_hdcp' module for each test.
> >That sounds like a complicated process which won't scale to future
> >versions of HDCP (no reason to assume they will stop pumping them out).
> >
> >How about adding a debugfs file that lists the supported hdcp versions
> >for every connector, says which one is being used right now, and
> >force-disable one or many so as to be able to validate all the cases?
> >
> >Martin
> 
> If I understand correctly, the debugfs will tell two things:
> 
> i) The currently selected version for a platform say 'global_hdcp_version'.
> The platform will always go with this version of HDCP. So by default it is
> HDCP2.2 for a platform (say KBL), but we can select to use HDCP1.4.
> 
> ii) The list of connectors supporting the selected platforms.
> So if global_hdcp_version is set to be HDCP2.2, only connectors that support
> HDCP2.2 will be listed.
> 
> The test will then become simpler. Reading from the debugfs and start with
> lowest version going to highest supported.
> 1) Set the global_hdcp_version to hdcp_version[i]
> 2) Loop for each connector, listed for selected version.
> 3) set appropriate connector properties.
> 4) Validate.
> 
> The work of making sure, that selected version is chosen, will then lie with
> the driver.
> So for KBL/ICL/TGL etc,  default is HDCP2.2, setting to HDCP1.4, it might
> need to unload mei_hdcp.
> For next platforms and version, the work might be something different.
> 
> I hope I get it right to some extent :) Thanks for the comments.
May be something similar to i915_edp_psr_debug() would be require here for each connector,
it should force HDCP 1.4 or HDCP 2.2 for igt test similar way it does for psr1 and psr2.
i915 support also require to support this.
Thanks,
Anshuman Gupta.
> 
> 
> Regards,
> Ankit
> 
> 
> >>Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> >>---
> >>  tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
> >>  1 file changed, 113 insertions(+), 72 deletions(-)
> >>
> >>diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> >>index 3b9cedcb..1472e987 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						0
> >>+#define HDCP_22						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)
> >>@@ -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;
> >>+}
> >>-	igt_subtest("legacy") {
> >>+static void
> >>+test_content_protection_dynamic(igt_output_t *output, int content_type)
> >>+{
> >>+
> >>+	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);
> >>+		test_content_protection_on_output(output, COMMIT_ATOMIC,
> >>+						  content_type);
> >>  	}
> >>-	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);
> >>-	}
> >>-
> >>-	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,78 @@ 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);
> >>+	}
> >>+}
> >>+
> >>+igt_main
> >>+{
> >>+	int i;
> >>+	struct cp_protocol {
> >>+		const char *name;
> >>+		int content_type;
> >>+	} protocol[] = {
> >>+		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
> >>+		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
> >>+
> >>+	igt_fixture {
> >>+		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> >>+
> >>+		igt_display_require(&data.display, data.drm_fd);
> >>+	}
> >>+
> >>+	for (i = 0; i < 2; i++) {
> >>+		bool force_mei_hdcp_off = false;
> >>+
> >>+		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
> >>+		 * HDCP2.2 is always chosen as default by the driver, even for
> >>+		 * the TYPE 0 content.
> >>+		 *
> >>+		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
> >>+		 * unloaded. This takes away the HDCP2.2 support from the
> >>+		 * platform, and HDCP1.4 can be tested. After the test the
> >>+		 * module is loaded again and HDCP2.2 support gets re-enabled.
> >>+		 */
> >>+		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
> >>+			igt_kmod_unload("mei_hdcp", 0);
> >>+			force_mei_hdcp_off = true;
> >>+		}
> >>+
> >>+		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
> >>+			igt_output_t *output;
> >>+			int content_type = protocol[i].content_type;
> >>+
> >>+			for_each_connected_output(&data.display, output) {
> >>+				if (!is_valid_output(output, content_type))
> >>+					continue;
> >>+				test_content_protection_dynamic(output,
> >>+								content_type);
> >>+			}
> >>+		}
> >>+		if (force_mei_hdcp_off)
> >>+			igt_kmod_load("mei_hdcp", NULL);
> >>  	}
> >>  	igt_fixture {
> >>
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2
  2020-03-20 16:03 ` [igt-dev] [PATCH i-g-t] " Peres, Martin
  2020-03-23  5:04   ` Nautiyal, Ankit K
@ 2020-03-23  6:33   ` Ramalingam C
  1 sibling, 0 replies; 15+ messages in thread
From: Ramalingam C @ 2020-03-23  6:33 UTC (permalink / raw)
  To: Peres, Martin, Jani Nikula, Daniel Vetter; +Cc: igt-dev, Latvala, Petri

On 2020-03-20 at 21:33:25 +0530, Peres, Martin wrote:
> On 2020-03-20 11:03, 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.
> 
> Thanks for working on it!
> 
> > 
> > This patch makes two versions of the existing subtests for testing
> > HDCP1.4 and HDCP2.2. For forcing the driver to use HDCP1.4, the
> > kernel module 'mei_hdcp' responsible for HDCP2.2 authentication,
> > is unloaded before HDCP1.4 tests. Once the HDCP1.4 tests are
> > completed, the module is re-loaded.
> > 
> > This patch also makes the existing subtests as dynamic sub-subtests
> > based on all outputs supporting the protocol under test.
> > This helps in running together all HDCP1.4 tests for all outputs
> > that support HDCP1.4, avoiding the need of loading and unloading
> > of 'mei_hdcp' module for each test.
> 
> That sounds like a complicated process which won't scale to future
> versions of HDCP (no reason to assume they will stop pumping them out).
> 
> How about adding a debugfs file that lists the supported hdcp versions
> for every connector, says which one is being used right now, and
> force-disable one or many so as to be able to validate all the cases?
I agree with Martin's suggestion.

mei_hdcp.ko will control hdcp2.2 untill the ME FW handles the hdcp2.2. And
we are aware that ME FW is not playing that roll in upcoming platforms.

So we need to device a generic solution applicable for all platforms to
choose the HDCP version that we want to test.

I propose lets add a debugfs called "i915_hdcp_ver_request" per connector
and which will set the bits of intel_hdcp->debugfs_ver_request representing
the HDCP versions.

IGT can check the i915_hdcp_sink_capability for the supported HDCP
versions of the setup and set the required HDCP version through "i915_hdcp_ver_request"

I915 will refer this debugfs_ver_request along with hdcpx_capability while
starting the HDCP authentication of that/any version.

Martin and JaniN,
Do we have any concern in this approach? This is just to choose the hdcp
version for testing purpose.

-Ram

> 
> Martin
> > 
> > Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > ---
> >  tests/kms_content_protection.c | 185 ++++++++++++++++++++-------------
> >  1 file changed, 113 insertions(+), 72 deletions(-)
> > 
> > diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> > index 3b9cedcb..1472e987 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						0
> > +#define HDCP_22						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)
> > @@ -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;
> > +}
> >  
> > -	igt_subtest("legacy") {
> > +static void
> > +test_content_protection_dynamic(igt_output_t *output, int content_type)
> > +{
> > +
> > +	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);
> > +		test_content_protection_on_output(output, COMMIT_ATOMIC,
> > +						  content_type);
> >  	}
> >  
> > -	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);
> > -	}
> > -
> > -	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,78 @@ 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);
> > +	}
> > +}
> > +
> > +igt_main
> > +{
> > +	int i;
> > +	struct cp_protocol {
> > +		const char *name;
> > +		int content_type;
> > +	} protocol[] = {
> > +		{ "hdcp-1_4", HDCP_CONTENT_TYPE_0 },
> > +		{ "hdcp-2_2", HDCP_CONTENT_TYPE_1 } };
> > +
> > +	igt_fixture {
> > +		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> > +
> > +		igt_display_require(&data.display, data.drm_fd);
> > +	}
> > +
> > +	for (i = 0; i < 2; i++) {
> > +		bool force_mei_hdcp_off = false;
> > +
> > +		/* In case a panel supports both HDCP2.2 and HDCP1.4 protocols,
> > +		 * HDCP2.2 is always chosen as default by the driver, even for
> > +		 * the TYPE 0 content.
> > +		 *
> > +		 * To forcefully test HDCP1.4, mei_hdcp module needs to be
> > +		 * unloaded. This takes away the HDCP2.2 support from the
> > +		 * platform, and HDCP1.4 can be tested. After the test the
> > +		 * module is loaded again and HDCP2.2 support gets re-enabled.
> > +		 */
> > +		if (i == HDCP_14 && igt_kmod_is_loaded("mei_hdcp")) {
> > +			igt_kmod_unload("mei_hdcp", 0);
> > +			force_mei_hdcp_off = true;
> > +		}
> > +
> > +		igt_subtest_with_dynamic_f("%s", protocol[i].name) {
> > +			igt_output_t *output;
> > +			int content_type = protocol[i].content_type;
> > +
> > +			for_each_connected_output(&data.display, output) {
> > +				if (!is_valid_output(output, content_type))
> > +					continue;
> > +				test_content_protection_dynamic(output,
> > +								content_type);
> > +			}
> > +		}
> > +		if (force_mei_hdcp_off)
> > +			igt_kmod_load("mei_hdcp", NULL);
> >  	}
> >  
> >  	igt_fixture {
> > 
> 

pub   RSA 2048/33A53379 2019-12-02 Martin Peres <martin.peres@linux.intel.com>
> sub   RSA 2048/C5E7DE5F 2019-12-02
> 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-03-23  6:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20  9:03 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Bifurcate tests into HDCP1.4 & 2.2 Ankit Nautiyal
2020-03-20  9:58 ` [igt-dev] ✗ GitLab.Pipeline: failure for " Patchwork
2020-03-20 10:15 ` [igt-dev] ✗ Fi.CI.BAT: " Patchwork
2020-03-20 11:05   ` Petri Latvala
2020-03-20 13:51     ` Vudum, Lakshminarayana
2020-03-20 10:28 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2020-03-23  3:59   ` Nautiyal, Ankit K
2020-03-20 12:46 ` Ramalingam C
2020-03-23  4:01   ` Nautiyal, Ankit K
2020-03-20 13:43 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-03-20 16:03 ` [igt-dev] [PATCH i-g-t] " Peres, Martin
2020-03-23  5:04   ` Nautiyal, Ankit K
2020-03-23  5:22     ` Anshuman Gupta
2020-03-23  6:33   ` Ramalingam C
2020-03-20 17:07 ` [igt-dev] ✗ Fi.CI.IGT: failure for " 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.