From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Swati Sharma <swati2.sharma@intel.com>,
Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Subject: [PATCH i-g-t,v2] tests/kms_hdr: add FP16 format coverage
Date: Wed, 15 Apr 2026 23:41:22 +0530 [thread overview]
Message-ID: <20260415181122.1044599-1-swati2.sharma@intel.com> (raw)
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.
v2: -rebase
-move pipe break outside format loop to test all formats
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
tests/kms_hdr.c | 154 ++++++++++++++++++++++++++----------------------
1 file changed, 84 insertions(+), 70 deletions(-)
diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index f30902b72..b215b0e6c 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,
@@ -233,6 +239,7 @@ static void prepare_test(data_t *data, igt_output_t *output, igt_crtc_t *crtc)
static void test_bpc_switch_on_output(data_t *data, igt_crtc_t *crtc,
igt_output_t *output,
+ uint32_t format,
uint32_t flags)
{
igt_display_t *display = &data->display;
@@ -242,7 +249,7 @@ static void test_bpc_switch_on_output(data_t *data, igt_crtc_t *crtc,
/* 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);
@@ -337,28 +344,31 @@ static void test_bpc_switch(data_t *data, uint32_t flags)
continue;
}
- prepare_test(data, output,
- crtc);
+ 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));
+ 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;
+ test_fini(data);
+ break;
+ }
+
+ 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]))
+ test_bpc_switch_on_output(data,
+ crtc,
+ output, hdr_test_formats[i], flags);
}
- data->mode = igt_output_get_mode(output);
- data->w = data->mode->hdisplay;
- data->h = data->mode->vdisplay;
-
- igt_dynamic_f("pipe-%s-%s",
- igt_crtc_name(crtc), output->name)
- test_bpc_switch_on_output(data,
- crtc,
- output, flags);
-
/* One pipe is enough */
break;
}
@@ -475,7 +485,7 @@ static void adjust_brightness(data_t *data, uint32_t flags)
static void test_static_toggle(data_t *data, igt_crtc_t *crtc,
igt_output_t *output,
- uint32_t flags)
+ uint32_t format, uint32_t flags)
{
igt_display_t *display = &data->display;
struct hdr_output_metadata hdr;
@@ -485,7 +495,7 @@ static void test_static_toggle(data_t *data, igt_crtc_t *crtc,
/* 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);
@@ -590,7 +600,8 @@ static void fill_hdr_output_metadata_sdr(struct hdr_output_metadata *meta)
}
static void test_static_swap(data_t *data, igt_crtc_t *crtc,
- igt_output_t *output, uint32_t flags)
+ igt_output_t *output,
+ uint32_t format, uint32_t flags)
{
igt_display_t *display = &data->display;
igt_crc_t ref_crc, new_crc;
@@ -600,7 +611,7 @@ static void test_static_swap(data_t *data, igt_crtc_t *crtc,
/* 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);
@@ -756,55 +767,58 @@ static void test_hdr(data_t *data, uint32_t flags)
continue;
}
- 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;
- }
+ for (int i = 0; i < ARRAY_SIZE(hdr_test_formats); i++) {
+ 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));
+ 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",
- igt_crtc_name(crtc), output->name) {
- if (flags & (TEST_NONE | TEST_DPMS | TEST_SUSPEND |
- TEST_INVALID_HDR | TEST_BRIGHTNESS))
- test_static_toggle(data,
- crtc,
- output, flags);
- if (flags & TEST_SWAP)
- test_static_swap(data,
- crtc,
- 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",
+ igt_crtc_name(crtc), 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,
+ crtc,
+ output, hdr_test_formats[i], flags);
+ if (flags & TEST_SWAP)
+ test_static_swap(data,
+ crtc,
+ output, hdr_test_formats[i], flags);
+ if (flags & TEST_INVALID_METADATA_SIZES)
+ test_invalid_metadata_sizes(data, output);
+ }
}
/* One pipe is enough */
--
2.25.1
next reply other threads:[~2026-04-15 18:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 18:11 Swati Sharma [this message]
2026-04-15 21:08 ` ✓ Xe.CI.BAT: success for tests/kms_hdr: add FP16 format coverage (rev2) Patchwork
2026-04-15 21:29 ` ✓ i915.CI.BAT: " Patchwork
2026-04-15 22:34 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-16 4:12 ` ✓ i915.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=20260415181122.1044599-1-swati2.sharma@intel.com \
--to=swati2.sharma@intel.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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