Skip to contentSkip to conversation

kms_content_protection: modularizing the CP test steps

PATCH In review Ramalingam C 3 participants 10 messages Feb 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 kms_content_protection: modularizing the CP test steps

Modularizing the CP test steps for the convenience of reusing it for other subtests.

---
 tests/kms_content_protection.c | 99 +++++++++++++++++++++++++-----------------
 1 file changed, 60 insertions(+), 39 deletions(-)
tests/kms_content_protection.c +60 -39
index 50ae82862949..f6b441d891e5 100644
@@ -33,6 +33,7 @@ IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
 struct data {
 	int drm_fd;
 	igt_display_t display;
+	struct igt_fb red, green;
 } data;
 
 
@@ -116,16 +117,12 @@ commit_display_and_wait_for_flip(enum igt_commit_style s)
 	}
 }
 
-static void
-test_cp_enable_disable(const enum pipe pipe, igt_output_t *output,
-		       enum igt_commit_style s)
+static void modeset_with_fb(const enum pipe pipe, igt_output_t *output,
+			    enum igt_commit_style s)
 {
 	igt_display_t *display = &data.display;
 	drmModeModeInfo mode;
 	igt_plane_t *primary;
-	struct igt_fb red, green;
-	bool ret;
-	int retry = 3;
 
 	igt_assert(kmstest_get_connector_default_mode(
 			display->drm_fd, output->config.connector, &mode));
@@ -135,58 +132,75 @@ test_cp_enable_disable(const enum pipe pipe, igt_output_t *output,
 
 	igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
 			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
-			    1.f, 0.f, 0.f, &red);
+			    1.f, 0.f, 0.f, &data.red);
 	igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
 			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
-			    0.f, 1.f, 0.f, &green);
+			    0.f, 1.f, 0.f, &data.green);
 
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_display_commit2(display, s);
-
-	igt_plane_set_fb(primary, &red);
+	igt_plane_set_fb(primary, &data.red);
 
 	/* Wait for Flip completion before starting the HDCP authentication */
 	commit_display_and_wait_for_flip(s);
+}
 
-	do {
-		igt_output_set_prop_value(output,
-					  IGT_CONNECTOR_CONTENT_PROTECTION, 0);
-		igt_display_commit2(display, s);
+static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	bool ret;
+
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
-		/* Wait for HDCP to be disabled for fresh start. */
-		ret = wait_for_prop_value(output, 0, 1000);
-		igt_assert_f(ret, "Content Protection not cleared\n");
+	igt_output_set_prop_value(output,
+				  IGT_CONNECTOR_CONTENT_PROTECTION, 1);
+	igt_display_commit2(display, s);
 
-		igt_output_set_prop_value(output,
-					  IGT_CONNECTOR_CONTENT_PROTECTION, 1);
+	/* Wait for 18000mSec (3 authentication * 6Sec) */
+	ret = wait_for_prop_value(output, 2, 18000);
+	if (ret) {
+		igt_plane_set_fb(primary, &data.green);
 		igt_display_commit2(display, s);
+	}
 
-		/* Wait for 18000mSec (3 authentication * 6Sec) */
-		ret = wait_for_prop_value(output, 2, 18000);
-		if (ret) {
-			igt_plane_set_fb(primary, &green);
-			igt_display_commit2(display, s);
-		}
+	return ret;
+}
 
-		if (!ret && --retry)
-			igt_debug("Retry (%d/2) ...\n", 3 - retry);
-	} while (retry && !ret);
+static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	bool ret;
+
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
 	/*
 	 * Even on HDCP enable failed scenario, IGT should exit leaving the
 	 * "content protection" at "UNDESIRED".
 	 */
 	igt_output_set_prop_value(output, IGT_CONNECTOR_CONTENT_PROTECTION, 0);
-	igt_plane_set_fb(primary, &red);
+	igt_plane_set_fb(primary, &data.red);
 	igt_display_commit2(display, s);
 
-	igt_assert_f(ret, "Content Protection not enabled\n");
-
 	/* Wait for HDCP to be disabled, before crtc off */
-	wait_for_prop_value(output, 0, 1000);
+	ret = wait_for_prop_value(output, 0, 1000);
+	igt_assert_f(ret, "Content Protection not cleared\n");
+}
+
+static void test_cp_enable_with_retry(igt_output_t *output,
+				      enum igt_commit_style s, int retry)
+{
+	bool ret;
 
-	igt_plane_set_fb(primary, NULL);
-	igt_output_set_pipe(output, PIPE_NONE);
+	do {
+		test_cp_disable(output, s);
+		ret = test_cp_enable(output, s);
+
+		if (!ret && --retry)
+			igt_debug("Retry (%d/2) ...\n", 3 - retry);
+	} while (retry && !ret);
+	igt_assert_f(ret, "Content Protection not enabled\n");
 }
 
 static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
@@ -200,11 +214,12 @@ static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
 	return true;
 }
 
-static void
-test_content_protection_on_output(igt_output_t *output,
-				  enum igt_commit_style s)
+
+static void test_content_protection_on_output(igt_output_t *output,
+					      enum igt_commit_style s)
 {
 	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
 	enum pipe pipe;
 
 	for_each_pipe(display, pipe) {
@@ -220,7 +235,14 @@ test_content_protection_on_output(igt_output_t *output,
 		if (!igt_pipe_is_free(display, pipe))
 			continue;
 
-		test_cp_enable_disable(pipe, output, s);
+		modeset_with_fb(pipe, output, s);
+		test_cp_enable_with_retry(output, s, 3);
+		test_cp_disable(output, s);
+
+		primary = igt_output_get_plane_type(output,
+						    DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 
 		/*
 		 * Testing a output with a pipe is enough for HDCP
@@ -229,7 +251,6 @@ test_content_protection_on_output(igt_output_t *output,
 		 */
 		break;
 	}
-
 }
 
 static void __debugfs_read(int fd, const char *param, char *buf, int len)
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 2/3 kms_content_protection: Test CP along with modeset

As we have two different patch for commitng the HDCP request
1. DDI_enable (during the modeset)
2. update_pipe (during fastset execution)

Currently our kms_content_protection covers only fastset path. So this test adds the coverage for the HDCP during the modeset by performing DPMS off-on and check for HDCP status.

But with respect to HDCP we allow few retries from userspace before reporting the failure. So only first attempt at kernel will be on modeset path, next retries will become fastset commiting of HDCP.

---
 tests/kms_content_protection.c | 79 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
tests/kms_content_protection.c +79 -0
index f6b441d891e5..895e9e8d8b11 100644
@@ -306,6 +306,80 @@ test_content_protection(enum igt_commit_style s)
 	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
 }
 
+static void test_cp_dpms_on_output(igt_output_t *output,
+				   enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	enum pipe pipe;
+	bool ret;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		/*
+		 * If previous subtest of connector failed, pipe
+		 * attached to that connector is not released.
+		 * Because of that we have to choose the non
+		 * attached pipe for this subtest.
+		 */
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		modeset_with_fb(pipe, output, s);
+		test_cp_enable_with_retry(output, s, 3);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 0);
+		igt_display_commit2(display, s);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 1);
+		igt_display_commit2(display, s);
+
+		ret = wait_for_prop_value(output, 2, 18000);
+		if (!ret)
+			test_cp_enable_with_retry(output, s, 2);
+
+		test_cp_disable(output, s);
+
+		primary = igt_output_get_plane_type(output,
+						    DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
+
+		/*
+		 * Testing a output with a pipe is enough for HDCP
+		 * testing. No ROI in testing the connector with other
+		 * pipes. So Break the loop on pipe.
+		 */
+		break;
+	}
+}
+
+static void test_cp_dpms(enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	for_each_connected_output(display, output) {
+		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+			continue;
+
+		igt_info("CP Test execution on %s\n", output->name);
+		if (!sink_hdcp_capable(output)) {
+			igt_info("\tSkip %s (Sink has no HDCP support)\n",
+				 output->name);
+			continue;
+		}
+
+		test_cp_dpms_on_output(output, s);
+		valid_tests++;
+	}
+
+	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
+}
+
 igt_main
 {
 	igt_fixture {
@@ -324,6 +398,11 @@ igt_main
 		test_content_protection(COMMIT_ATOMIC);
 	}
 
+	igt_subtest("atomic-dpms") {
+		igt_require(data.display.is_atomic);
+		test_cp_dpms(COMMIT_ATOMIC);
+	}
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

Re: [igt-dev] [PATCH i-g-t 2/3] kms_content_protection: Test CP along with modeset

Quoted 103 lines · Ramalingam C

As we have two different patch for commitng the HDCP request
1. DDI_enable (during the modeset)
2. update_pipe (during fastset execution)

Currently our kms_content_protection covers only fastset path. So this test adds the coverage for the HDCP during the modeset by performing DPMS off-on and check for HDCP status.

But with respect to HDCP we allow few retries from userspace before reporting the failure. So only first attempt at kernel will be on modeset path, next retries will become fastset commiting of HDCP.

---
 tests/kms_content_protection.c | 79 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
tests/kms_content_protection.c +74 -0
index f6b441d891e5..895e9e8d8b11 100644
@@ -306,6 +306,80 @@ test_content_protection(enum igt_commit_style s)
 	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
 }
 
+static void test_cp_dpms_on_output(igt_output_t *output,
+				   enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	enum pipe pipe;
+	bool ret;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		/*
+		 * If previous subtest of connector failed, pipe
+		 * attached to that connector is not released.
+		 * Because of that we have to choose the non
+		 * attached pipe for this subtest.
+		 */
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		modeset_with_fb(pipe, output, s);
+		test_cp_enable_with_retry(output, s, 3);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 0);
+		igt_display_commit2(display, s);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 1);
+		igt_display_commit2(display, s);
+
+		ret = wait_for_prop_value(output, 2, 18000);
+		if (!ret)
+			test_cp_enable_with_retry(output, s, 2);
+
+		test_cp_disable(output, s);
+
+		primary = igt_output_get_plane_type(output,
+						    DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
+
+		/*
+		 * Testing a output with a pipe is enough for HDCP
+		 * testing. No ROI in testing the connector with other
+		 * pipes. So Break the loop on pipe.
+		 */
+		break;
+	}
+}
+
+static void test_cp_dpms(enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	for_each_connected_output(display, output) {
+		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+			continue;
+
+		igt_info("CP Test execution on %s\n", output->name);
+		if (!sink_hdcp_capable(output)) {
+			igt_info("\tSkip %s (Sink has no HDCP support)\n",
+				 output->name);
+			continue;
+		}
+
+		test_cp_dpms_on_output(output, s);
+		valid_tests++;
+	}
+
+	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
+}
+
 igt_main
 {
 	igt_fixture {

tests/kms_content_protection.c igt_main · line 403

Quoted 6 lines
tests/kms_content_protection.c +3 -0
@@ -324,6 +398,11 @@ igt_main
 		test_content_protection(COMMIT_ATOMIC);
 	}
 
+	igt_subtest("atomic-dpms") {
+		igt_require(data.display.is_atomic);
+		test_cp_dpms(COMMIT_ATOMIC);

Hm instead of duplicating a bunch of things I'd add a new flag paramater to test_content_protection (0 for all existing tests), so that we can reuse the code with the same flow, and only do the dpms when a TEST_DPMS flag is set.
-Daniel

Quoted 8 lines
tests/kms_content_protection.c +2 -0
+	}
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

Re: [igt-dev] [PATCH i-g-t 2/3] kms_content_protection: Test CP along with modeset

Quoted 107 lines · Daniel Vetter
Quoted 106 lines · Ramalingam C

As we have two different patch for commitng the HDCP request
1. DDI_enable (during the modeset)
2. update_pipe (during fastset execution)

Currently our kms_content_protection covers only fastset path. So this test adds the coverage for the HDCP during the modeset by performing DPMS off-on and check for HDCP status.

But with respect to HDCP we allow few retries from userspace before reporting the failure. So only first attempt at kernel will be on modeset path, next retries will become fastset commiting of HDCP.

---
  tests/kms_content_protection.c | 79 ++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 79 insertions(+)
tests/kms_content_protection.c +74 -0
index f6b441d891e5..895e9e8d8b11 100644
@@ -306,6 +306,80 @@ test_content_protection(enum igt_commit_style s)
  	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
  }
 
+static void test_cp_dpms_on_output(igt_output_t *output,
+				   enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	enum pipe pipe;
+	bool ret;
+
+	for_each_pipe(display, pipe) {
+		if (!igt_pipe_connector_valid(pipe, output))
+			continue;
+
+		/*
+		 * If previous subtest of connector failed, pipe
+		 * attached to that connector is not released.
+		 * Because of that we have to choose the non
+		 * attached pipe for this subtest.
+		 */
+		if (!igt_pipe_is_free(display, pipe))
+			continue;
+
+		modeset_with_fb(pipe, output, s);
+		test_cp_enable_with_retry(output, s, 3);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 0);
+		igt_display_commit2(display, s);
+
+		igt_pipe_set_prop_value(display, pipe, IGT_CRTC_ACTIVE, 1);
+		igt_display_commit2(display, s);
+
+		ret = wait_for_prop_value(output, 2, 18000);
+		if (!ret)
+			test_cp_enable_with_retry(output, s, 2);
+
+		test_cp_disable(output, s);
+
+		primary = igt_output_get_plane_type(output,
+						    DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
+
+		/*
+		 * Testing a output with a pipe is enough for HDCP
+		 * testing. No ROI in testing the connector with other
+		 * pipes. So Break the loop on pipe.
+		 */
+		break;
+	}
+}
+
+static void test_cp_dpms(enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	for_each_connected_output(display, output) {
+		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
+			continue;
+
+		igt_info("CP Test execution on %s\n", output->name);
+		if (!sink_hdcp_capable(output)) {
+			igt_info("\tSkip %s (Sink has no HDCP support)\n",
+				 output->name);
+			continue;
+		}
+
+		test_cp_dpms_on_output(output, s);
+		valid_tests++;
+	}
+
+	igt_require_f(valid_tests, "No connector found with HDCP capability\n");
+}
+
  igt_main
  {
  	igt_fixture {
@@ -324,6 +398,11 @@ igt_main
  		test_content_protection(COMMIT_ATOMIC);
  	}
 
Quoted 7 lines

tests/kms_content_protection.c igt_main · line 403

Quoted 3 lines
tests/kms_content_protection.c +3 -0
+	igt_subtest("atomic-dpms") {
+		igt_require(data.display.is_atomic);
+		test_cp_dpms(COMMIT_ATOMIC);

Hm instead of duplicating a bunch of things I'd add a new flag paramater to test_content_protection (0 for all existing tests), so that we can reuse the code with the same flow, and only do the dpms when a TEST_DPMS flag is set.

Ok. sounds good idea. I will do that.

-Ram

Quoted 10 lines

-Daniel

Quoted 8 lines
tests/kms_content_protection.c +2 -0
+	}
+
  	igt_fixture
  		igt_display_fini(&data.display);
  }
Signature · 1 line
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

PATCH 3/3 kms_content_protection: Confirm that LIC is passed

In reply to Ramalingam C

Once the HDCP is enabled, kernel will run the link integrity check(LIC) atleast once in 2Secs based on the HDCP versions.

So to confirm the link integrity check is passed, we oberve that HDCP state remains ENABLED for next 4Secs.

---
 tests/kms_content_protection.c | 9 +++++++++
 1 file changed, 9 insertions(+)
tests/kms_content_protection.c +9 -0
index 895e9e8d8b11..7a6450539f5d 100644
@@ -214,6 +214,14 @@ static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
 	return true;
 }
 
+static void test_cp_lic(igt_output_t *output)
+{
+	bool ret;
+
+	/* Wait for 4Secs (min 2 cycles of Link Integrity Check) */
+	ret = wait_for_prop_value(output, 1, 4 * 1000);
+	igt_assert_f(!ret, "Content Protection LIC Failed\n");
+}
 
 static void test_content_protection_on_output(igt_output_t *output,
 					      enum igt_commit_style s)
@@ -237,6 +245,7 @@ static void test_content_protection_on_output(igt_output_t *output,
 
 		modeset_with_fb(pipe, output, s);
 		test_cp_enable_with_retry(output, s, 3);
+		test_cp_lic(output);
 		test_cp_disable(output, s);
 
 		primary = igt_output_get_plane_type(output,
Signature · 6 lines
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

Re: [igt-dev] [PATCH i-g-t 3/3] kms_content_protection: Confirm that LIC is passed

Quoted 16 lines · Ramalingam C

Once the HDCP is enabled, kernel will run the link integrity check(LIC) atleast once in 2Secs based on the HDCP versions.

So to confirm the link integrity check is passed, we oberve that HDCP state remains ENABLED for next 4Secs.

---
 tests/kms_content_protection.c | 9 +++++++++
 1 file changed, 9 insertions(+)
tests/kms_content_protection.c +0 -0
index 895e9e8d8b11..7a6450539f5d 100644

tests/kms_content_protection.c static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe) · line 222

Quoted 9 lines
tests/kms_content_protection.c +6 -0
@@ -214,6 +214,14 @@ static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
 	return true;
 }
 
+static void test_cp_lic(igt_output_t *output)
+{
+	bool ret;
+
+	/* Wait for 4Secs (min 2 cycles of Link Integrity Check) */
+	ret = wait_for_prop_value(output, 1, 4 * 1000);

Hm, shouldn't we do an unconditionaly sleep for 4s, and _then_ recheck that content protection is still on? Otherwise I think this will succeed immediately.

Also wondering whether we should make this a new subtest, using the flag idea I described for patch 2. There's ofc some overlap, but that's hard to avoid with black box testing like we do in igt.
-Daniel

Quoted 16 lines
tests/kms_content_protection.c +3 -0
+	igt_assert_f(!ret, "Content Protection LIC Failed\n");
+}
 
 static void test_content_protection_on_output(igt_output_t *output,
 					      enum igt_commit_style s)
@@ -237,6 +245,7 @@ static void test_content_protection_on_output(igt_output_t *output,
 
 		modeset_with_fb(pipe, output, s);
 		test_cp_enable_with_retry(output, s, 3);
+		test_cp_lic(output);
 		test_cp_disable(output, s);
 
 		primary = igt_output_get_plane_type(output,
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#6 lore raw

Re: [igt-dev] [PATCH i-g-t 3/3] kms_content_protection: Confirm that LIC is passed

Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Ramalingam C

Once the HDCP is enabled, kernel will run the link integrity check(LIC) atleast once in 2Secs based on the HDCP versions.

So to confirm the link integrity check is passed, we oberve that HDCP state remains ENABLED for next 4Secs.

---
  tests/kms_content_protection.c | 9 +++++++++
  1 file changed, 9 insertions(+)
tests/kms_content_protection.c +0 -0
index 895e9e8d8b11..7a6450539f5d 100644
@@ -214,6 +214,14 @@ static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
  	return true;
  }
 
Quoted 9 lines

tests/kms_content_protection.c static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe) · line 222

Quoted 6 lines
tests/kms_content_protection.c +6 -0
+static void test_cp_lic(igt_output_t *output)
+{
+	bool ret;
+
+	/* Wait for 4Secs (min 2 cycles of Link Integrity Check) */
+	ret = wait_for_prop_value(output, 1, 4 * 1000);

Hm, shouldn't we do an unconditionaly sleep for 4s, and _then_ recheck that content protection is still on? Otherwise I think this will succeed immediately.

This wont as we are monitoring for DESIRED state till 4Sec.
This will help us to quit as soon as link is broken instead of waiting for 4Sec completely.

Quoted 4 lines

Also wondering whether we should make this a new subtest, using the flag idea I described for patch 2. There's ofc some overlap, but that's hard to avoid with black box testing like we do in igt.

But LIC is part of HDCP enablement. Should be part of HDCP_enable than a separate subtest. I prefer not to make it as separate subtest.

--Ram

Quoted 14 lines

-Daniel

Quoted 12 lines
tests/kms_content_protection.c +3 -0
+	igt_assert_f(!ret, "Content Protection LIC Failed\n");
+}
 
  static void test_content_protection_on_output(igt_output_t *output,
  					      enum igt_commit_style s)
@@ -237,6 +245,7 @@ static void test_content_protection_on_output(igt_output_t *output,
 
  		modeset_with_fb(pipe, output, s);
  		test_cp_enable_with_retry(output, s, 3);
+		test_cp_lic(output);
  		test_cp_disable(output, s);
 
Quoted 4 lines
Quoted 4 lines
tests/kms_content_protection.c +0 -0
  		primary = igt_output_get_plane_type(output,
Signature · 1 line
2.7.4

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw
In reply to Ramalingam C
Quoted 4 lines · Ramalingam C

Modularizing the CP test steps for the convenience of reusing it for other subtests.

lgtm, Reviewed-by: Daniel Vetter <[email protected]>

Quoted 182 lines
---
 tests/kms_content_protection.c | 99 +++++++++++++++++++++++++-----------------
 1 file changed, 60 insertions(+), 39 deletions(-)
tests/kms_content_protection.c +60 -39
index 50ae82862949..f6b441d891e5 100644
@@ -33,6 +33,7 @@ IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
 struct data {
 	int drm_fd;
 	igt_display_t display;
+	struct igt_fb red, green;
 } data;
 
 
@@ -116,16 +117,12 @@ commit_display_and_wait_for_flip(enum igt_commit_style s)
 	}
 }
 
-static void
-test_cp_enable_disable(const enum pipe pipe, igt_output_t *output,
-		       enum igt_commit_style s)
+static void modeset_with_fb(const enum pipe pipe, igt_output_t *output,
+			    enum igt_commit_style s)
 {
 	igt_display_t *display = &data.display;
 	drmModeModeInfo mode;
 	igt_plane_t *primary;
-	struct igt_fb red, green;
-	bool ret;
-	int retry = 3;
 
 	igt_assert(kmstest_get_connector_default_mode(
 			display->drm_fd, output->config.connector, &mode));
@@ -135,58 +132,75 @@ test_cp_enable_disable(const enum pipe pipe, igt_output_t *output,
 
 	igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
 			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
-			    1.f, 0.f, 0.f, &red);
+			    1.f, 0.f, 0.f, &data.red);
 	igt_create_color_fb(display->drm_fd, mode.hdisplay, mode.vdisplay,
 			    DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE,
-			    0.f, 1.f, 0.f, &green);
+			    0.f, 1.f, 0.f, &data.green);
 
 	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	igt_display_commit2(display, s);
-
-	igt_plane_set_fb(primary, &red);
+	igt_plane_set_fb(primary, &data.red);
 
 	/* Wait for Flip completion before starting the HDCP authentication */
 	commit_display_and_wait_for_flip(s);
+}
 
-	do {
-		igt_output_set_prop_value(output,
-					  IGT_CONNECTOR_CONTENT_PROTECTION, 0);
-		igt_display_commit2(display, s);
+static bool test_cp_enable(igt_output_t *output, enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	bool ret;
+
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
-		/* Wait for HDCP to be disabled for fresh start. */
-		ret = wait_for_prop_value(output, 0, 1000);
-		igt_assert_f(ret, "Content Protection not cleared\n");
+	igt_output_set_prop_value(output,
+				  IGT_CONNECTOR_CONTENT_PROTECTION, 1);
+	igt_display_commit2(display, s);
 
-		igt_output_set_prop_value(output,
-					  IGT_CONNECTOR_CONTENT_PROTECTION, 1);
+	/* Wait for 18000mSec (3 authentication * 6Sec) */
+	ret = wait_for_prop_value(output, 2, 18000);
+	if (ret) {
+		igt_plane_set_fb(primary, &data.green);
 		igt_display_commit2(display, s);
+	}
 
-		/* Wait for 18000mSec (3 authentication * 6Sec) */
-		ret = wait_for_prop_value(output, 2, 18000);
-		if (ret) {
-			igt_plane_set_fb(primary, &green);
-			igt_display_commit2(display, s);
-		}
+	return ret;
+}
 
-		if (!ret && --retry)
-			igt_debug("Retry (%d/2) ...\n", 3 - retry);
-	} while (retry && !ret);
+static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
+{
+	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
+	bool ret;
+
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 
 	/*
 	 * Even on HDCP enable failed scenario, IGT should exit leaving the
 	 * "content protection" at "UNDESIRED".
 	 */
 	igt_output_set_prop_value(output, IGT_CONNECTOR_CONTENT_PROTECTION, 0);
-	igt_plane_set_fb(primary, &red);
+	igt_plane_set_fb(primary, &data.red);
 	igt_display_commit2(display, s);
 
-	igt_assert_f(ret, "Content Protection not enabled\n");
-
 	/* Wait for HDCP to be disabled, before crtc off */
-	wait_for_prop_value(output, 0, 1000);
+	ret = wait_for_prop_value(output, 0, 1000);
+	igt_assert_f(ret, "Content Protection not cleared\n");
+}
+
+static void test_cp_enable_with_retry(igt_output_t *output,
+				      enum igt_commit_style s, int retry)
+{
+	bool ret;
 
-	igt_plane_set_fb(primary, NULL);
-	igt_output_set_pipe(output, PIPE_NONE);
+	do {
+		test_cp_disable(output, s);
+		ret = test_cp_enable(output, s);
+
+		if (!ret && --retry)
+			igt_debug("Retry (%d/2) ...\n", 3 - retry);
+	} while (retry && !ret);
+	igt_assert_f(ret, "Content Protection not enabled\n");
 }
 
 static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
@@ -200,11 +214,12 @@ static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
 	return true;
 }
 
-static void
-test_content_protection_on_output(igt_output_t *output,
-				  enum igt_commit_style s)
+
+static void test_content_protection_on_output(igt_output_t *output,
+					      enum igt_commit_style s)
 {
 	igt_display_t *display = &data.display;
+	igt_plane_t *primary;
 	enum pipe pipe;
 
 	for_each_pipe(display, pipe) {
@@ -220,7 +235,14 @@ test_content_protection_on_output(igt_output_t *output,
 		if (!igt_pipe_is_free(display, pipe))
 			continue;
 
-		test_cp_enable_disable(pipe, output, s);
+		modeset_with_fb(pipe, output, s);
+		test_cp_enable_with_retry(output, s, 3);
+		test_cp_disable(output, s);
+
+		primary = igt_output_get_plane_type(output,
+						    DRM_PLANE_TYPE_PRIMARY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 
 		/*
 		 * Testing a output with a pipe is enough for HDCP
@@ -229,7 +251,6 @@ test_content_protection_on_output(igt_output_t *output,
 		 */
 		break;
 	}
-
 }
 
 static void __debugfs_read(int fd, const char *param, char *buf, int len)
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#8 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] kms_content_protection: modularizing the CP test steps

In reply to Ramalingam C
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] kms_content_protection: modularizing the CP test steps
URL : https://patchwork.freedesktop.org/series/56349/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5560 -> IGTPW_2354
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/56349/revisions/1/mbox/

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_execlists:
- fi-apl-guc: PASS -> INCOMPLETE [fdo#103927]

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7500u: NOTRUN -> DMESG-WARN [fdo#102505] / [fdo#103558] / [fdo#105079] / [fdo#105602]

* igt@prime_vgem@basic-fence-flip:
- fi-gdg-551: PASS -> FAIL [fdo#103182]

#### Possible fixes ####

* igt@i915_selftest@live_hangcheck:
- fi-skl-gvtdvm: INCOMPLETE [fdo#105600] / [fdo#108744] -> PASS

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7567u: WARN [fdo#109380] -> PASS

* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
- fi-kbl-7567u: {SKIP} [fdo#109271] -> PASS +33

* igt@pm_rpm@basic-pci-d3-state:
- fi-byt-j1900: {SKIP} [fdo#109271] -> PASS

* igt@pm_rpm@basic-rte:
- fi-byt-j1900: FAIL [fdo#108800] -> PASS

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

[fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105079]: https://bugs.freedesktop.org/show_bug.cgi?id=105079
[fdo#105600]: https://bugs.freedesktop.org/show_bug.cgi?id=105600
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
[fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109380]: https://bugs.freedesktop.org/show_bug.cgi?id=109380
[fdo#109527]: https://bugs.freedesktop.org/show_bug.cgi?id=109527

Participating hosts (48 -> 45)
------------------------------

Additional (1): fi-kbl-7500u
Missing (4): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-bdw-samus

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

* IGT: IGT_4813 -> IGTPW_2354

CI_DRM_5560: b3cc6ae9211bbf4e40195469147a884b74c0ec8e @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2354: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2354/
IGT_4813: 09f506726d0e115ee7f4a1604ae71adcf9f12690 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@kms_content_protection@atomic-dpms

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2354/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#9 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/3] kms_content_protection: modularizing the CP test steps

In reply to Ramalingam C
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/3] kms_content_protection: modularizing the CP test steps
URL : https://patchwork.freedesktop.org/series/56349/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5560_full -> IGTPW_2354_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/56349/revisions/1/mbox/

New tests
---------

New tests have been introduced between CI_DRM_5560_full and IGTPW_2354_full:
Known issues
------------

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

### IGT changes ###

#### Issues hit ####

* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-kbl: PASS -> FAIL [fdo#106641]

* igt@kms_cursor_crc@cursor-128x42-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232] +7
- shard-kbl: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-apl: PASS -> FAIL [fdo#103232] +1

* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#105363]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
- shard-kbl: PASS -> FAIL [fdo#103167] +1
- shard-apl: PASS -> FAIL [fdo#103167] +2

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: PASS -> FAIL [fdo#103167] +10

* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-glk: PASS -> FAIL [fdo#108948]

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-kbl: PASS -> FAIL [fdo#103166]

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
- shard-glk: NOTRUN -> FAIL [fdo#108145]

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

* igt@kms_plane_multiple@atomic-pipe-b-tiling-none:
- shard-glk: PASS -> FAIL [fdo#103166] +6

* igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
- shard-apl: PASS -> FAIL [fdo#103166] +6

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

* igt@kms_setmode@basic:
- shard-hsw: PASS -> FAIL [fdo#99912]
- shard-snb: NOTRUN -> FAIL [fdo#99912]

#### Possible fixes ####

* igt@gem_ctx_isolation@vcs0-s3:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS

* igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
- shard-apl: FAIL [fdo#106510] / [fdo#108145] -> PASS

* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-64x64-sliding:

    - shard-glk:          FAIL [fdo#103232] -> PASS +2
    - shard-apl:          FAIL [fdo#103232] -> PASS +1
    - shard-kbl:          FAIL [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-alpha-opaque:
- shard-apl: FAIL [fdo#109350] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
- shard-snb: {SKIP} [fdo#109271] -> PASS +1

* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: FAIL [fdo#103166] -> PASS
- shard-glk: FAIL [fdo#103166] -> PASS

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

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

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

[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#106510]: https://bugs.freedesktop.org/show_bug.cgi?id=106510
[fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

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

Missing (2): shard-skl shard-iclb

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

* IGT: IGT_4813 -> IGTPW_2354
* Piglit: piglit_4509 -> None

CI_DRM_5560: b3cc6ae9211bbf4e40195469147a884b74c0ec8e @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2354: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2354/
IGT_4813: 09f506726d0e115ee7f4a1604ae71adcf9f12690 @ 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_2354/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev