Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Pranay Samala <pranay.samala@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <sameer.lattannavar@intel.com>
Subject: Re: [PATCH i-g-t 3/3] tests/kms_hdr: Move capability checks inside dynamic subtests
Date: Mon, 4 May 2026 15:10:35 +0530	[thread overview]
Message-ID: <68ab320e-dc0f-48be-bce3-7b58722b97e4@intel.com> (raw)
In-Reply-To: <20260429093955.3726263-4-pranay.samala@intel.com>

Hi Pranay,

On 4/29/2026 3:09 PM, Pranay Samala wrote:
> Earlier, output capability checks were done in the outer loops

Comments on earlier rev has not been addressed here. Please check.

With this updated,

Reviewed-by: Karthik B S <karthik.b.s@intel.com>

> using continue/break. This caused a problem where if an earlier
> output (e.g., eDP) passed but a later output (e.g., DP) failed
> a check (such as reading bpc), the entire subtest would be skipped,
> discarding the earlier valid result and reporting a false skip/failure.
>
> Fix this by moving all output capability checks inside dynamic
> block. Each pipe-output-format combination is now an independent
> dynamic subtest that passes or skips on its own merit, without
> affecting other combinations.
>
> v2:
> - Consider other pipe if pipe combo fails (Karthik)
> - Handle test_fini wherever required (Karthik)
>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4879
> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> ---
>   tests/kms_hdr.c | 166 +++++++++++++++++++++---------------------------
>   1 file changed, 72 insertions(+), 94 deletions(-)
>
> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
> index e880b280e..c9a0b1707 100644
> --- a/tests/kms_hdr.c
> +++ b/tests/kms_hdr.c
> @@ -323,17 +323,6 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
>   	for_each_connected_output(display, output) {
>   		igt_crtc_t *crtc;
>   
> -		if (!has_max_bpc(output)) {
> -			igt_info("%s: Doesn't support IGT_CONNECTOR_MAX_BPC.\n",
> -				 igt_output_name(output));
> -			continue;
> -		}
> -
> -		if (igt_get_output_max_bpc(output) < 10) {
> -			igt_info("%s: Doesn't support 10 bpc.\n", igt_output_name(output));
> -			continue;
> -		}
> -
>   		for_each_crtc(display, crtc) {
>   			igt_output_set_crtc(output,
>   					    crtc);
> @@ -343,17 +332,7 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
>   			}
>   
>   			for (int i = 0; i < ARRAY_SIZE(hdr_test_formats); i++) {
> -				prepare_test(data, output,
> -					     crtc);
> -
> -				if (is_intel_device(data->fd) &&
> -				    !igt_max_bpc_constraint(display, crtc, output, 10)) {
> -					igt_info("%s: No suitable mode found to use 10 bpc.\n",
> -						  igt_output_name(output));
> -
> -					test_fini(data);
> -					break;
> -				}
> +				prepare_test(data, output, crtc);
>   
>   				data->mode = igt_output_get_mode(output);
>   				data->w = data->mode->hdisplay;
> @@ -361,10 +340,23 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
>   
>   				igt_dynamic_f("pipe-%s-%s-%s",
>   					      igt_crtc_name(crtc), output->name,
> -					      igt_format_str(hdr_test_formats[i]))
> -					      test_bpc_switch_on_output(data,
> -								       crtc,
> -								       output, hdr_test_formats[i], flags);
> +					      igt_format_str(hdr_test_formats[i])) {
> +					igt_require_f(has_max_bpc(output),
> +						      "%s: Doesn't support IGT_CONNECTOR_MAX_BPC.\n",
> +						      igt_output_name(output));
> +
> +					igt_require_f(igt_get_output_max_bpc(output) >= 10,
> +						      "%s: Doesn't support 10 bpc.\n",
> +						      igt_output_name(output));
> +
> +					igt_require_f(!is_intel_device(data->fd) ||
> +						      igt_max_bpc_constraint(display, crtc, output, 10),
> +						      "%s: No suitable mode found to use 10 bpc.\n",
> +						      igt_output_name(output));
> +
> +					test_bpc_switch_on_output(data, crtc, output,
> +								  hdr_test_formats[i], flags);
> +				}
>   
>   				test_fini(data);
>   			}
> @@ -718,43 +710,8 @@ static void test_hdr(data_t *data, uint32_t flags)
>   	for_each_connected_output(display, output) {
>   		igt_crtc_t *crtc;
>   
> -		/* To test HDR, 10 bpc is required, so we need to
> -		 * set MAX_BPC property to 10bpc prior to setting
> -		 * HDR metadata property. Therefore, checking.
> -		 */
> -		if (!has_max_bpc(output) || !has_hdr(output)) {
> -			igt_info("%s: Doesn't support IGT_CONNECTOR_MAX_BPC or IGT_CONNECTOR_HDR_OUTPUT_METADATA.\n",
> -				 igt_output_name(output));
> -			continue;
> -		}
> -
> -		/* For negative test, panel should be non-hdr. */
> -		if ((flags & TEST_INVALID_HDR) && is_panel_hdr(data, output)) {
> -			igt_info("%s: Can't run negative test on HDR panel.\n",
> -				 igt_output_name(output));
> -			continue;
> -		}
> -
> -		if ((flags & ~TEST_INVALID_HDR) && !is_panel_hdr(data, output)) {
> -			igt_info("%s: Can't run HDR tests on non-HDR panel.\n",
> -				 igt_output_name(output));
> -			continue;
> -		}
> -
> -		if (igt_get_output_max_bpc(output) < 10) {
> -			igt_info("%s: Doesn't support 10 bpc.\n", igt_output_name(output));
> -			continue;
> -		}
> -
> -		if ((flags & TEST_BRIGHTNESS) && !output_is_internal_panel(output)) {
> -			igt_info("%s: Can't run brightness test on non-internal panel.\n",
> -				 igt_output_name(output));
> -			continue;
> -		}
> -
>   		for_each_crtc(display, crtc) {
> -			igt_output_set_crtc(output,
> -					    crtc);
> +			igt_output_set_crtc(output, crtc);
>   			if (!intel_pipe_output_combo_valid(display)) {
>   				igt_output_set_crtc(output, NULL);
>   				continue;
> @@ -764,42 +721,63 @@ static void test_hdr(data_t *data, uint32_t flags)
>   				prepare_test(data, output,
>   					     crtc);
>   
> -				/* Signal HDR requirement via metadata */
> -				fill_hdr_output_metadata_st2084(&hdr);
> -				set_hdr_output_metadata(data, &hdr);
> -				if (igt_display_try_commit2(display, display->is_atomic ?
> -							    COMMIT_ATOMIC : COMMIT_LEGACY)) {
> -					igt_info("%s: Couldn't set HDR metadata\n",
> -						  igt_output_name(output));
> -					test_fini(data);
> -					break;
> -				}
> -
> -				if (is_intel_device(data->fd) &&
> -				    !igt_max_bpc_constraint(display, crtc, output, 10)) {
> -					igt_info("%s: No suitable mode found to use 10 bpc.\n",
> -						  igt_output_name(output));
> -
> -					test_fini(data);
> -					break;
> -				}
> -
> -				if (igt_is_dsc_enabled(data->fd, output->name))
> -					flags |= TEST_NEEDS_DSC;
> -				else
> -					flags &= ~TEST_NEEDS_DSC;
> -
> -				set_hdr_output_metadata(data, NULL);
> -				igt_display_commit2(display, display->is_atomic ?
> -						    COMMIT_ATOMIC : COMMIT_LEGACY);
> -
>   				data->mode = igt_output_get_mode(output);
>   				data->w = data->mode->hdisplay;
>   				data->h = data->mode->vdisplay;
>   
> -				igt_dynamic_f("pipe-%s-%s-%s",
> -					       igt_crtc_name(crtc), output->name,
> -					       igt_format_str(hdr_test_formats[i])) {
> +				igt_dynamic_f("pipe-%s-%s-%s", igt_crtc_name(crtc), output->name,
> +					      igt_format_str(hdr_test_formats[i])) {
> +					igt_require_f(has_max_bpc(output) && has_hdr(output),
> +						      "%s: Doesn't support IGT_CONNECTOR_MAX_BPC "
> +						      "or IGT_CONNECTOR_HDR_OUTPUT_METADATA.\n",
> +						      igt_output_name(output));
> +
> +					if (flags & TEST_INVALID_HDR)
> +						igt_require_f(!is_panel_hdr(data, output),
> +							      "%s: Can't run negative test on "
> +							      "HDR panel.\n",
> +							      igt_output_name(output));
> +
> +					if (!(flags & TEST_INVALID_HDR))
> +						igt_require_f(is_panel_hdr(data, output),
> +							      "%s: Can't run HDR tests on "
> +							      "non-HDR panel.\n",
> +							      igt_output_name(output));
> +
> +					igt_require_f(igt_get_output_max_bpc(output) >= 10,
> +						      "%s: Doesn't support 10 bpc.\n",
> +						      igt_output_name(output));
> +
> +					if (flags & TEST_BRIGHTNESS)
> +						igt_require_f(output_is_internal_panel(output),
> +							      "%s: Can't run brightness test on "
> +							      "non-internal panel.\n",
> +							      igt_output_name(output));
> +
> +					/* Signal HDR requirement via metadata */
> +					fill_hdr_output_metadata_st2084(&hdr);
> +					set_hdr_output_metadata(data, &hdr);
> +					igt_require_f(!igt_display_try_commit2(display,
> +									       display->is_atomic ?
> +									       COMMIT_ATOMIC :
> +									       COMMIT_LEGACY),
> +						      "%s: Couldn't set HDR metadata\n",
> +						      igt_output_name(output));
> +
> +					igt_require_f(!is_intel_device(data->fd) ||
> +						      igt_max_bpc_constraint(display, crtc, output, 10),
> +						      "%s: No suitable mode found to use 10 bpc.\n",
> +						      igt_output_name(output));
> +
> +					if (igt_is_dsc_enabled(data->fd, output->name))
> +						flags |= TEST_NEEDS_DSC;
> +					else
> +						flags &= ~TEST_NEEDS_DSC;
> +
> +					set_hdr_output_metadata(data, NULL);
> +					igt_display_commit2(display, display->is_atomic ?
> +							    COMMIT_ATOMIC : COMMIT_LEGACY);
> +
>   					if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND |
>   						     TEST_INVALID_HDR | TEST_BRIGHTNESS))
>   						test_static_toggle(data,

  reply	other threads:[~2026-05-04  9:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  9:39 [PATCH i-g-t 0/3] Fix incorrect skips and improve cleanup Pranay Samala
2026-04-29  9:39 ` [PATCH i-g-t 1/3] tests/kms_hdr: Move framebuffer into data_t for centralized cleanup Pranay Samala
2026-05-04  9:37   ` Karthik B S
2026-04-29  9:39 ` [PATCH i-g-t 2/3] tests/kms_hdr: Move test_fini() for proper cleanup Pranay Samala
2026-05-04  9:39   ` Karthik B S
2026-04-29  9:39 ` [PATCH i-g-t 3/3] tests/kms_hdr: Move capability checks inside dynamic subtests Pranay Samala
2026-05-04  9:40   ` Karthik B S [this message]
2026-04-29 14:02 ` ✓ i915.CI.BAT: success for Fix incorrect skips and improve cleanup Patchwork
2026-04-29 14:06 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-29 23:31 ` ✗ i915.CI.Full: failure " Patchwork
2026-04-29 23:51 ` ✗ Xe.CI.FULL: " 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=68ab320e-dc0f-48be-bce3-7b58722b97e4@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=pranay.samala@intel.com \
    --cc=sameer.lattannavar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox