[PATCH i-g-t 5/5] tests/kms_content_protection: Set screen red/green based on CP Status
B, Jeevan
jeevan.b at intel.com
Wed Aug 21 14:49:06 UTC 2024
> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal at intel.com>
> Sent: Tuesday, August 20, 2024 1:43 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Samala, Pranay <pranay.samala at intel.com>; Nautiyal, Ankit K
> <ankit.k.nautiyal at intel.com>; B, Jeevan <jeevan.b at intel.com>; Kandpal, Suraj
> <suraj.kandpal at intel.com>
> Subject: [PATCH i-g-t 5/5] tests/kms_content_protection: Set screen red/green
> based on CP Status
>
> Set fb as red when HDCP is disabled and green when HDCP is enabled rather
> than randomly setting the color. This helps to visually verify HDCP's enablement
> status rather than having to look at the logs.
>
> --v2
> -Add reason for this change in commit message [Jeevan]
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal at intel.com>
LGTM.
Reviewed-by: Jeevan B <jeevan.b at intel.com>
> ---
> tests/kms_content_protection.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index 87d7526ee..3d158fbd8 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -523,12 +523,11 @@ static bool sink_hdcp2_capable(igt_output_t
> *output)
> return strstr(buf, "HDCP2.2");
> }
>
> -static void prepare_modeset_on_mst_output(igt_output_t *output)
> +static void prepare_modeset_on_mst_output(igt_output_t *output, bool
> +is_enabled)
> {
> drmModeModeInfo *mode;
> igt_plane_t *primary;
> int width, height;
> - enum pipe pipe = output->pending_pipe;
>
> mode = igt_output_get_mode(output);
>
> @@ -537,8 +536,8 @@ static void
> prepare_modeset_on_mst_output(igt_output_t *output)
>
> primary = igt_output_get_plane_type(output,
> DRM_PLANE_TYPE_PRIMARY);
> igt_plane_set_fb(primary, NULL);
> - igt_plane_set_fb(primary, pipe % 2 ? &data.red : &data.green);
> - igt_fb_set_size(pipe % 2 ? &data.red : &data.green, primary, width,
> height);
> + igt_plane_set_fb(primary, is_enabled ? &data.green : &data.red);
> + igt_fb_set_size(is_enabled ? &data.green : &data.red, primary, width,
> +height);
> igt_plane_set_size(primary, width, height); }
>
> @@ -735,7 +734,7 @@ test_content_protection_mst(int content_type)
> igt_assert_f(pipe_found, "No valid pipe found for %s\n",
> output->name);
>
> igt_output_set_pipe(output, pipe);
> - prepare_modeset_on_mst_output(output);
> + prepare_modeset_on_mst_output(output, false);
> dp_mst_outputs++;
> if (output_hdcp_capable(output, content_type))
> hdcp_mst_output[valid_outputs++] = output; @@ -
> 752,7 +751,7 @@ test_content_protection_mst(int content_type)
> igt_require_f(found, "No valid mode combo found for MST
> modeset\n");
>
> for (count = 0; count < valid_outputs; count++)
> -
> prepare_modeset_on_mst_output(hdcp_mst_output[count]);
> +
> prepare_modeset_on_mst_output(hdcp_mst_output[count], false);
>
> ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
> igt_require_f(ret == 0, "Commit failure during MST modeset\n");
> @@ -762,6 +761,13 @@ test_content_protection_mst(int content_type)
>
> ret = test_mst_cp_enable_with_retry(hdcp_mst_output, valid_outputs,
> 2, content_type);
>
> + if (ret) {
> + for (i = 0; i < valid_outputs; i++)
> +
> prepare_modeset_on_mst_output(hdcp_mst_output[count], true);
> +
> + igt_display_commit2(display, COMMIT_ATOMIC);
> + }
> +
> if (data.cp_tests & CP_LIC)
> test_cp_lic_on_mst(hdcp_mst_output, valid_outputs, 0);
>
> --
> 2.43.2
More information about the igt-dev
mailing list