RE: [PATCH i-g-t v2] tests/kms_content_protection: Get hdcp capable outputs before modeset

Kandpal, Suraj
2026-03-16T04:26:51Z

> Subject: [PATCH i-g-t v2] tests/kms_content_protection: Get hdcp capable
> outputs before modeset

* HDCP
Acronyms always capitalized.

>
> Filter out the hdcp capable outputs from the connected outputs before doing a

* HDCP
> modeset_with_fb. This will make the test to execute on HDCP supported

* just modeset is enough.
> panels and avoid commit failures and invalid skips on HDCP supported panels.

Also mention why we end up having invalid skips.
Something like
" Connector needs a valid CRTC connected to it, for us to be able to read its debugfs
Consistently. To avoid modeset before we check every connectors HDCP capability,
We collect HDCP capable outputs separately which need to be tested"

With that fixed,
LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

>
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
> ---
> tests/kms_content_protection.c | 40 ++++++++++++++++++++++++++--------
> 1 file changed, 31 insertions(+), 9 deletions(-)
>
> diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
> index f35c9fa73..96a62bfc5 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -707,32 +707,54 @@ static bool
> is_output_hdcp_test_exempt(igt_output_t *output)
> return igt_is_panel_blocked(sink_name, hdcp_blocklist,
> ARRAY_SIZE(hdcp_blocklist)); }
>
> +static int get_hdcp_outputs(igt_display_t *display, int content_type,
> + igt_output_t **hdcp_outputs)
> +{
> + igt_output_t *output;
> + int count = 0;
> +
> + for_each_connected_output(display, output) {
> + if (is_output_hdcp_test_exempt(output)) {
> + igt_info("Skipping HDCP test on %s, as the panel is
> blocklisted\n",
> + output->name);
> + continue;
> + }
> +
> + if (!output_hdcp_capable(output, content_type))
> + continue;
> +
> + hdcp_outputs[count++] = output;
> + }
> +
> + return count;
> +}
> +
> static void
> test_content_protection(enum igt_commit_style commit_style, int
> content_type) {
> igt_display_t *display = &data.display;
> igt_output_t *output;
> + igt_output_t *hdcp_outputs[10];
> igt_crtc_t *crtc;
> + int hdcp_panel_count;
> + int i;
>
> if (data.cp_tests & CP_MEI_RELOAD)
> igt_require_f(igt_kmod_is_loaded("mei_hdcp"),
> "mei_hdcp module is not loaded\n");
>
> + hdcp_panel_count = get_hdcp_outputs(display, content_type,
> hdcp_outputs);
> + igt_skip_on_f(hdcp_panel_count == 0, "No connected output with
> HDCP
> +support found\n");
> +
> if (data.cp_tests & CP_UEVENT) {
> data.uevent_monitor = igt_watch_uevents();
> igt_flush_uevents(data.uevent_monitor);
> }
>
> - for_each_connected_output(display, output) {
> - for_each_crtc(display, crtc) {
> - if (!output_hdcp_capable(output, content_type))
> - continue;
> - if (is_output_hdcp_test_exempt(output)) {
> - igt_info("Skipping HDCP test on %s, as the
> panel is blocklisted\n",
> - output->name);
> - continue;
> - }
> + for (i = 0; i < hdcp_panel_count; i++) {
> + output = hdcp_outputs[i];
>
> + for_each_crtc(display, crtc) {
> igt_display_reset(display);
> igt_output_set_crtc(output,
> crtc);
> --
> 2.34.1