public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "C, Ramalingam" <ramalingam.c@intel.com>
To: igt-dev@lists.freedesktop.org, daniel.vetter@ffwll.ch
Subject: Re: [igt-dev] [PATCH i-g-t 2/4] kms_content_protection: test teardown and rebuild of I915-mei I/F
Date: Wed, 27 Feb 2019 15:52:17 +0530	[thread overview]
Message-ID: <316d2e4b-0165-940c-f016-2f787c963a05@intel.com> (raw)
In-Reply-To: <1551165805-19130-3-git-send-email-ramalingam.c@intel.com>

danvet,

Are we meeting the expectation for the i915-mei interface testing...?

--Ram.

On 2/26/2019 12:53 PM, Ramalingam C wrote:
> To validate the teardown and rebuild of the interface between
> I915 and mei hdcp this subtest execute the below sequence:
> 	1. Test HDCP2.2 Type 1 (expected to pass)
> 	2. Unload the mei_hdcp
> 	3. Test HDCP2.2 Type 1 (expected to fail)
> 	2. Reload the mei_hdcp
> 	1. Test HDCP2.2 Type 1 (expected to pass)
>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> ---
>   tests/kms_content_protection.c | 67 +++++++++++++++++++++++++++++++++---------
>   1 file changed, 53 insertions(+), 14 deletions(-)
>
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 00784e2a5f01..4563a6067a32 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -27,6 +27,7 @@
>   #include "igt.h"
>   #include "igt_sysfs.h"
>   #include "igt_kms.h"
> +#include "igt_kmod.h"
>   
>   IGT_TEST_DESCRIPTION("Test content protection (HDCP)");
>   
> @@ -213,7 +214,7 @@ static void test_cp_disable(igt_output_t *output, enum igt_commit_style s)
>   
>   static void test_cp_enable_with_retry(igt_output_t *output,
>   				      enum igt_commit_style s, int retry,
> -				      int content_type)
> +				      int content_type, bool expect_failure)
>   {
>   	bool ret;
>   
> @@ -224,7 +225,12 @@ static void test_cp_enable_with_retry(igt_output_t *output,
>   		if (!ret && --retry)
>   			igt_debug("Retry (%d/2) ...\n", 3 - retry);
>   	} while (retry && !ret);
> -	igt_assert_f(ret, "Content Protection not enabled\n");
> +
> +	if (expect_failure)
> +		igt_assert_f(!ret,
> +			     "CP Enabled. Though it is expected to fail\n");
> +	else
> +		igt_assert_f(ret, "Content Protection not enabled\n");
>   }
>   
>   static bool igt_pipe_is_free(igt_display_t *display, enum pipe pipe)
> @@ -247,9 +253,10 @@ static void test_cp_lic(igt_output_t *output)
>   	igt_assert_f(!ret, "Content Protection LIC Failed\n");
>   }
>   
> -static void test_content_protection_on_output(igt_output_t *output,
> -					      enum igt_commit_style s,
> -					      bool dpms_test, int content_type)
> +static void
> +test_content_protection_on_output(igt_output_t *output, enum igt_commit_style s,
> +				  bool dpms_test, int content_type,
> +				  bool mei_reload_test)
>   {
>   	igt_display_t *display = &data.display;
>   	igt_plane_t *primary;
> @@ -270,7 +277,24 @@ static void test_content_protection_on_output(igt_output_t *output,
>   			continue;
>   
>   		modeset_with_fb(pipe, output, s);
> -		test_cp_enable_with_retry(output, s, 3, content_type);
> +		test_cp_enable_with_retry(output, s, 3, content_type, false);
> +
> +		if (mei_reload_test) {
> +			igt_assert_f(!igt_kmod_unload("mei_hdcp", 0),
> +				     "mei_hdcp unload failed");
> +
> +			/* Expected to fail */
> +			test_cp_enable_with_retry(output, s, 3,
> +						  content_type, false, true);
> +
> +			igt_assert_f(!igt_kmod_load("mei_hdcp", NULL),
> +				     "mei_hdcp load failed");
> +
> +			/* Expected to pass */
> +			test_cp_enable_with_retry(output, s, 3,
> +						  content_type, false, false);
> +		}
> +
>   		test_cp_lic(output);
>   
>   		if (dpms_test) {
> @@ -285,8 +309,8 @@ static void test_content_protection_on_output(igt_output_t *output,
>   			ret = wait_for_prop_value(output, CP_ENABLED,
>   						  KERNEL_AUTH_TIME_ALLOWED_MSEC);
>   			if (!ret)
> -				test_cp_enable_with_retry(output, s,
> -							  2, content_type);
> +				test_cp_enable_with_retry(output, s, 2,
> +							  content_type, false);
>   		}
>   
>   		test_cp_disable(output, s);
> @@ -351,12 +375,16 @@ static bool sink_hdcp2_capable(igt_output_t *output)
>   
>   static void
>   test_content_protection(enum igt_commit_style s, bool dpms_test,
> -			int content_type)
> +			int content_type, bool mei_reload_test)
>   {
>   	igt_display_t *display = &data.display;
>   	igt_output_t *output;
>   	int valid_tests = 0;
>   
> +	if (mei_reload_test)
> +		igt_require_f(igt_kmod_is_loaded("mei_hdcp"),
> +			      "mei_hdcp module is not loaded\n");
> +
>   	for_each_connected_output(display, output) {
>   		if (!output->props[IGT_CONNECTOR_CONTENT_PROTECTION])
>   			continue;
> @@ -378,7 +406,8 @@ test_content_protection(enum igt_commit_style s, bool dpms_test,
>   		}
>   
>   		test_content_protection_on_output(output, s, dpms_test,
> -						  content_type);
> +						  content_type,
> +						  mei_reload_test);
>   		valid_tests++;
>   	}
>   
> @@ -396,21 +425,31 @@ igt_main
>   	}
>   
>   	igt_subtest("legacy")
> -		test_content_protection(COMMIT_LEGACY, false, CP_TYPE_0);
> +		test_content_protection(COMMIT_LEGACY, false, CP_TYPE_0,
> +					false);
>   
>   	igt_subtest("atomic") {
>   		igt_require(data.display.is_atomic);
> -		test_content_protection(COMMIT_ATOMIC, false, CP_TYPE_0);
> +		test_content_protection(COMMIT_ATOMIC, false, CP_TYPE_0,
> +					false);
>   	}
>   
>   	igt_subtest("atomic-dpms") {
>   		igt_require(data.display.is_atomic);
> -		test_content_protection(COMMIT_ATOMIC, true, CP_TYPE_0);
> +		test_content_protection(COMMIT_ATOMIC, true, CP_TYPE_0,
> +					false);
>   	}
>   
>   	igt_subtest("Type1") {
>   		igt_require(data.display.is_atomic);
> -		test_content_protection(COMMIT_ATOMIC, false, CP_TYPE_1);
> +		test_content_protection(COMMIT_ATOMIC, false, CP_TYPE_1,
> +					false);
> +	}
> +
> +	igt_subtest("type1_mei_interface") {
> +		igt_require(data.display.is_atomic);
> +		test_content_protection(COMMIT_ATOMIC, false, CP_TYPE_1,
> +					true);
>   	}
>   
>   	igt_fixture

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

  reply	other threads:[~2019-02-27 10:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26  7:23 [igt-dev] [PATCH i-g-t 0/4] Coverage for HDCP2.2 Phase II Ramalingam C
2019-02-26  7:23 ` [igt-dev] [PATCH i-g-t 1/4] kms_content_protection: Content type support Ramalingam C
2019-02-26  7:23 ` [igt-dev] [PATCH i-g-t 2/4] kms_content_protection: test teardown and rebuild of I915-mei I/F Ramalingam C
2019-02-27 10:22   ` C, Ramalingam [this message]
2019-02-26  7:23 ` [igt-dev] [PATCH i-g-t 3/4] kms_content_protection: srm and downstream_info test Ramalingam C
2019-02-26  7:23 ` [igt-dev] [PATCH i-g-t 4/4] DO NOT MERGE: CP in fast feedback list Ramalingam C
2019-02-26  8:15 ` [igt-dev] ✓ Fi.CI.BAT: success for Coverage for HDCP2.2 Phase II Patchwork
2019-02-26  9:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=316d2e4b-0165-940c-f016-2f787c963a05@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox