All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jeevan B <jeevan.b@intel.com>
Cc: igt-dev@lists.freedesktop.org, suraj.kandpal@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Add a test for HDCP-MST with suspend resume
Date: Fri, 28 Oct 2022 19:46:34 +0300	[thread overview]
Message-ID: <Y1wHaiFbSKC7wUMt@intel.com> (raw)
In-Reply-To: <20221028160739.13017-1-jeevan.b@intel.com>

On Fri, Oct 28, 2022 at 09:37:39PM +0530, Jeevan B wrote:
> adding new test to validate HDCP-MST with suspend resume
> test check for valid output which supports MST and HDCP
> then commits and check if the content protection is enabled
> before and after suspend-resume.

The MST HDCP code looks still totally broken [1]. Is someone actually going to
fix it some day?

[] https://lists.freedesktop.org/archives/intel-gfx/2021-October/279457.html

> 
> v2: Change type-0 to type-1, try to authenticate hdcp few more times
> as suggested. (Suraj)
> 
> Signed-off-by: Jeevan B <jeevan.b@intel.com>
> ---
>  tests/kms_content_protection.c | 94 +++++++++++++++++++++++++++++++++-
>  1 file changed, 93 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index aa28b7bf..53f50115 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -48,6 +48,7 @@ struct data {
>  #define CP_MEI_RELOAD				(1 << 2)
>  #define CP_TYPE_CHANGE				(1 << 3)
>  #define CP_UEVENT				(1 << 4)
> +#define SUSPEND_RESUME				(1 << 5)
>  
>  #define CP_UNDESIRED				0
>  #define CP_DESIRED				1
> @@ -686,6 +687,89 @@ test_content_protection_mst(int content_type)
>  		test_cp_lic_on_mst(hdcp_mst_output, valid_outputs, 1);
>  }
>  
> +static void
> +test_content_protection_mst_suspend_resume(int content_type)
> +{
> +	igt_display_t *display = &data.display;
> +	igt_output_t *output;
> +	int valid_outputs = 0, dp_mst_outputs = 0, ret, count, max_pipe = 0;
> +	enum pipe pipe;
> +	igt_output_t *mst_output[IGT_MAX_PIPES], *hdcp_mst_output[IGT_MAX_PIPES];
> +
> +	for_each_pipe(display, pipe)
> +		max_pipe++;
> +
> +	pipe = PIPE_A;
> +
> +	for_each_connected_output(display, output) {
> +		if (!output_is_dp_mst(output, dp_mst_outputs))
> +			continue;
> +
> +		igt_assert_f(igt_pipe_connector_valid(pipe, output), "Output-pipe combination invalid\n");
> +
> +		igt_output_set_pipe(output, pipe);
> +		prepare_modeset_on_mst_output(output);
> +		mst_output[dp_mst_outputs++] = output;
> +
> +		pipe++;
> +
> +		if (pipe >= max_pipe)
> +			break;
> +	}
> +
> +	igt_require_f(dp_mst_outputs > 1, "No DP MST set up with >= 2 outputs found in a single topology\n");
> +
> +	if (igt_display_try_commit_atomic(display,
> +				DRM_MODE_ATOMIC_TEST_ONLY |
> +				DRM_MODE_ATOMIC_ALLOW_MODESET,
> +				NULL) != 0) {
> +		bool found = igt_override_all_active_output_modes_to_fit_bw(display);
> +		igt_require_f(found, "No valid mode combo found for MST modeset\n");
> +
> +		for (count = 0; count < dp_mst_outputs; count++)
> +			prepare_modeset_on_mst_output(mst_output[count]);
> +	}
> +
> +	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
> +	igt_require_f(ret == 0, "Commit failure during MST modeset\n");
> +
> +	for (count = 0; count < dp_mst_outputs; count++) {
> +		if (!output_hdcp_capable(mst_output[count], content_type))
> +			continue;
> +
> +		hdcp_mst_output[valid_outputs++] = mst_output[count];
> +	}
> +
> +	igt_require_f(valid_outputs > 1, "DP MST outputs do not have the required HDCP support\n");
> +
> +	for (count = 0; count < valid_outputs; count++) {
> +		igt_output_set_prop_value(hdcp_mst_output[count], IGT_CONNECTOR_CONTENT_PROTECTION, CP_DESIRED);
> +
> +		if (output->props[IGT_CONNECTOR_HDCP_CONTENT_TYPE])
> +			igt_output_set_prop_value(hdcp_mst_output[count], IGT_CONNECTOR_HDCP_CONTENT_TYPE, content_type);
> +	}
> +
> +	igt_display_commit2(display, COMMIT_ATOMIC);
> +
> +	for (count = 0; count < valid_outputs; count++) {
> +		ret = igt_wait(wait_for_prop_value(hdcp_mst_output[count],
> +				CP_ENABLED, KERNEL_AUTH_TIME_ALLOWED_MSEC),
> +				1000, 100);
> +		igt_assert_f(ret, "Content Protection not enabled on %s\n", hdcp_mst_output[count]->name);
> +	}
> +
> +	igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
> +
> +	igt_display_commit2(display, COMMIT_ATOMIC);
> +
> +	for (count = 0; count < valid_outputs; count++) {
> +		ret = igt_wait(wait_for_prop_value(hdcp_mst_output[count],
> +				CP_ENABLED, KERNEL_AUTH_TIME_ALLOWED_MSEC),
> +				1000, 100);
> +		igt_assert_f(ret, "Content Protection not enabled on %s\n", hdcp_mst_output[count]->name);
> +	}
> +}
> +
>  static void test_content_protection_cleanup(void)
>  {
>  	igt_display_t *display = &data.display;
> @@ -817,6 +901,11 @@ static const struct {
>  	  .cp_tests = CP_LIC,
>  	  .content_type = HDCP_CONTENT_TYPE_1,
>  	},
> +	{ .desc = "Test Content protection(Type 1) over DP MST with suspend resume.",
> +	  .name = "dp-mst-suspend_resume",
> +	  .cp_tests = SUSPEND_RESUME,
> +	  .content_type = HDCP_CONTENT_TYPE_1,
> +	},
>  };
>  
>  igt_main
> @@ -866,7 +955,10 @@ igt_main
>  
>  			igt_subtest(mst_subtests[i].name) {
>  				data.cp_tests = mst_subtests[i].cp_tests;
> -				test_content_protection_mst(mst_subtests[i].content_type);
> +				if (data.cp_tests == SUSPEND_RESUME)
> +				       test_content_protection_mst_suspend_resume(mst_subtests[i].content_type);
> +				else
> +					test_content_protection_mst(mst_subtests[i].content_type);
>  			}
>  		}
>  	}
> -- 
> 2.36.0

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-10-28 16:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 16:07 [igt-dev] [PATCH i-g-t] tests/kms_content_protection: Add a test for HDCP-MST with suspend resume Jeevan B
2022-10-28 16:46 ` Ville Syrjälä [this message]
2022-10-28 17:26 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-10-29  9:40 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=Y1wHaiFbSKC7wUMt@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=suraj.kandpal@intel.com \
    /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 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.