igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
To: Swati Sharma <swati2.sharma@intel.com>, <igt-dev@lists.freedesktop.org>
Cc: <uma.shankar@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms_hdr: add FP16 format coverage
Date: Sun, 30 Nov 2025 16:58:45 +0530	[thread overview]
Message-ID: <ab3b8dca-ee4d-43fc-ae8c-4489c61d1d1b@intel.com> (raw)
In-Reply-To: <20250911190030.356543-1-swati2.sharma@intel.com>



On 9/12/2025 12:30 AM, Swati Sharma wrote:
> Extend kms_hdr to exercise FP16 framebuffers in addition to
> 10bpc formats. All HDR metadata, toggle, swap and bpc-switch tests
> now run with both XRGB2101010 and XRGB16161616F. This ensures
> HDR handling paths are validated with half-float surfaces as
> well as packed 10bpc.
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   tests/kms_hdr.c | 143 ++++++++++++++++++++++++++----------------------
>   1 file changed, 79 insertions(+), 64 deletions(-)
> 
> diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
> index efa5964cf..37da709c1 100644
> --- a/tests/kms_hdr.c
> +++ b/tests/kms_hdr.c
> @@ -88,6 +88,12 @@ enum hdmi_eotf {
>   	HDMI_EOTF_SMPTE_ST2084,
>   };
>   
> +/* HDR test formats: 10bpc + FP16 */
> +static const uint32_t hdr_test_formats[] = {
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XRGB16161616F,
> +};
> +
>   /* Test flags. */
>   enum {
>   	TEST_NONE = 1 << 0,
> @@ -239,6 +245,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
>   
>   static void test_bpc_switch_on_output(data_t *data, enum pipe pipe,
>   				      igt_output_t *output,
> +				      uint32_t format,
>   				      uint32_t flags)
>   {
>   	igt_display_t *display = &data->display;
> @@ -248,7 +255,7 @@ static void test_bpc_switch_on_output(data_t *data, enum pipe pipe,
>   
>   	/* 10-bit formats are slow, so limit the size. */
>   	afb_id = igt_create_fb(data->fd, 512, 512,
> -			       DRM_FORMAT_XRGB2101010, DRM_FORMAT_MOD_LINEAR, &afb);
> +			       format, DRM_FORMAT_MOD_LINEAR, &afb);
>   	igt_assert(afb_id);
>   
>   	draw_hdr_pattern(&afb);
> @@ -335,24 +342,28 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
>   				continue;
>   			}
>   
> -			prepare_test(data, output, pipe);
> +			for (int i = 0; i < ARRAY_SIZE(hdr_test_formats); i++) {
> +				prepare_test(data, output, pipe);
>   
> -			if (is_intel_device(data->fd) &&
> -			    !igt_max_bpc_constraint(display, pipe, output, 10)) {
> -				igt_info("%s: No suitable mode found to use 10 bpc.\n",
> -					 igt_output_name(output));
> +				if (is_intel_device(data->fd) &&
> +				    !igt_max_bpc_constraint(display, pipe, output, 10)) {
> +					igt_info("%s: No suitable mode found to use 10 bpc.\n",
> +						  igt_output_name(output));
>   
> -				test_fini(data);
> -				break;
> -			}
> +					test_fini(data);
> +					break;
> +				}
>   
> -			data->mode = igt_output_get_mode(output);
> -			data->w = data->mode->hdisplay;
> -			data->h = data->mode->vdisplay;
> +				data->mode = igt_output_get_mode(output);
> +				data->w = data->mode->hdisplay;
> +				data->h = data->mode->vdisplay;
>   
> -			igt_dynamic_f("pipe-%s-%s",
> -				      kmstest_pipe_name(pipe), output->name)
> -				test_bpc_switch_on_output(data, pipe, output, flags);
> +				igt_dynamic_f("pipe-%s-%s-%s",
> +					      kmstest_pipe_name(pipe), output->name,
> +					      igt_format_str(hdr_test_formats[i]))
> +					      test_bpc_switch_on_output(data, pipe, output,
> +					      hdr_test_formats[i], flags);
> +			}
>   
>   			/* One pipe is enough */
>   			break;
> @@ -470,7 +481,7 @@ static void adjust_brightness(data_t *data, uint32_t flags)
>   
>   static void test_static_toggle(data_t *data, enum pipe pipe,
>   			       igt_output_t *output,
> -			       uint32_t flags)
> +			       uint32_t format, uint32_t flags)
>   {
>   	igt_display_t *display = &data->display;
>   	struct hdr_output_metadata hdr;
> @@ -480,7 +491,7 @@ static void test_static_toggle(data_t *data, enum pipe pipe,
>   
>   	/* 10-bit formats are slow, so limit the size. */
>   	afb_id = igt_create_fb(data->fd, 512, 512,
> -			       DRM_FORMAT_XRGB2101010, DRM_FORMAT_MOD_LINEAR, &afb);
> +			       format, DRM_FORMAT_MOD_LINEAR, &afb);
>   	igt_assert(afb_id);
>   
>   	draw_hdr_pattern(&afb);
> @@ -581,7 +592,8 @@ static void fill_hdr_output_metadata_sdr(struct hdr_output_metadata *meta)
>   	meta->hdmi_metadata_type1.max_cll = 0;
>   }
>   
> -static void test_static_swap(data_t *data, enum pipe pipe, igt_output_t *output, uint32_t flags)
> +static void test_static_swap(data_t *data, enum pipe pipe, igt_output_t *output,
> +			     uint32_t format, uint32_t flags)
>   {
>   	igt_display_t *display = &data->display;
>   	igt_crc_t ref_crc, new_crc;
> @@ -591,7 +603,7 @@ static void test_static_swap(data_t *data, enum pipe pipe, igt_output_t *output,
>   
>   	/* 10-bit formats are slow, so limit the size. */
>   	afb_id = igt_create_fb(data->fd, 512, 512,
> -			       DRM_FORMAT_XRGB2101010, DRM_FORMAT_MOD_LINEAR, &afb);
> +			       format, DRM_FORMAT_MOD_LINEAR, &afb);
>   	igt_assert(afb_id);
>   
>   	draw_hdr_pattern(&afb);
> @@ -743,54 +755,57 @@ static void test_hdr(data_t *data, uint32_t flags)
>   				continue;
>   			}
>   
> -			prepare_test(data, output, pipe);
> -
> -			/* Signal HDR requirement via metadata */
> -			fill_hdr_output_metadata_st2048(&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, pipe, output, 10)) {
> -				igt_info("%s: No suitable mode found to use 10 bpc.\n",
> -					 igt_output_name(output));
> +			for (int i = 0; i < ARRAY_SIZE(hdr_test_formats); i++) {
> +				prepare_test(data, output, pipe);
> +
> +				/* Signal HDR requirement via metadata */
> +				fill_hdr_output_metadata_st2048(&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;
> +				}
>   
> -				test_fini(data);
> -				break;
> -			}
> +				if (is_intel_device(data->fd) &&
> +				    !igt_max_bpc_constraint(display, pipe, output, 10)) {
> +					igt_info("%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);
> -
> -			data->mode = igt_output_get_mode(output);
> -			data->w = data->mode->hdisplay;
> -			data->h = data->mode->vdisplay;
> -
> -			igt_dynamic_f("pipe-%s-%s",
> -				      kmstest_pipe_name(pipe), output->name) {
> -				if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND |
> -					     TEST_INVALID_HDR | TEST_BRIGHTNESS))
> -					test_static_toggle(data, pipe, output, flags);
> -				if (flags & TEST_SWAP)
> -					test_static_swap(data, pipe, output, flags);
> -				if (flags & TEST_INVALID_METADATA_SIZES)
> -					test_invalid_metadata_sizes(data, 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",
> +					       kmstest_pipe_name(pipe), output->name,
> +					       igt_format_str(hdr_test_formats[i])) {
> +					if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND |
> +						     TEST_INVALID_HDR | TEST_BRIGHTNESS))
> +						test_static_toggle(data, pipe, output, hdr_test_formats[i], flags);
> +					if (flags & TEST_SWAP)
> +						test_static_swap(data, pipe, output, hdr_test_formats[i], flags);
> +					if (flags & TEST_INVALID_METADATA_SIZES)
> +						test_invalid_metadata_sizes(data, output);
> +				}
> +
> +				/* One pipe is enough */
> +					break;

This needs to move out from this code block otherwise we are effectively 
only running for i = 0.

With that fixed.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

>   			}
> -
> -			/* One pipe is enough */
> -			break;
>   		}
>   	}
>   }


      parent reply	other threads:[~2025-11-30 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 19:00 [PATCH i-g-t] tests/kms_hdr: add FP16 format coverage Swati Sharma
2025-09-11 23:55 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-09-12  0:09 ` ✓ i915.CI.BAT: " Patchwork
2025-09-12  6:23 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-12 23:48 ` ✓ i915.CI.Full: success " Patchwork
2025-11-30 11:28 ` Borah, Chaitanya Kumar [this message]

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=ab3b8dca-ee4d-43fc-ae8c-4489c61d1d1b@intel.com \
    --to=chaitanya.kumar.borah@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@intel.com \
    --cc=uma.shankar@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;
as well as URLs for NNTP newsgroup(s).