Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][V4] tests/kms_hdr: Add interactive HDR verification to static-swap
@ 2026-05-12 22:22 Alex Hung
  2026-05-13  0:44 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Alex Hung @ 2026-05-12 22:22 UTC (permalink / raw)
  To: igt-dev
  Cc: alex.hung, Mark.Broadworth, vitaly.prosyak, swati2.sharma,
	kamil.konieczny, jani.nikula, Wayne Lin

From: Wayne Lin <wayne.lin@amd.com>

Add smpte2084 and traditional-sdr with igt_debug_interactive_mode_check()
checks in test_static_swap(). These checks are CI-safe (no-op without
--interactive-debug) and provide a Y/n prompt when run interactively:

  kms_hdr --run-subtest static-swap --interactive-debug=smpte2084
  kms_hdr --run-subtest static-swap --interactive-debug=traditional-sdr

The HDR metadata probe in test_hdr() failed with EINVAL because it attempted
to commit metadata without a scanout buffer present. Fix the probe to create
a minimal framebuffer and use DRM_MODE_ATOMIC_TEST_ONLY to validate the
commit without modifying hardware state. The framebuffer is freed immediately
after and the display state is reset, so the actual subtest starts from the
same clean slate as before.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Assisted-by: Copilot:Claude-Sonnet-4.6
---
 tests/kms_hdr.c | 35 ++++++++++++++++++++++++++---------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index d50f87787..affd38887 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -454,6 +454,8 @@ static void test_static_swap(data_t *data, igt_crtc_t *crtc,
 	igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 	igt_assert_output_bpc_equal(crtc,
 				    data->output, 10);
+	igt_debug_interactive_mode_check("smpte2084",
+					 "HDR pattern displayed with SMPTE ST 2084 metadata");

 	igt_pipe_crc_collect_crc(data->pipe_crc, &ref_crc);

@@ -483,6 +485,8 @@ static void test_static_swap(data_t *data, igt_crtc_t *crtc,
 		igt_display_commit_atomic(display, 0, NULL);
 	else
 		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+	igt_debug_interactive_mode_check("traditional-sdr",
+					 "SDR pattern displayed with traditional SDR metadata");

 	igt_pipe_crc_collect_crc(data->pipe_crc, &new_crc);

@@ -571,16 +575,33 @@ static void test_hdr(data_t *data, uint32_t flags)
 							      "non-internal panel.\n",
 							      igt_output_name(output));

-					/* Signal HDR requirement via metadata */
+					/* Signal HDR requirement via metadata.
+					 * A framebuffer must be present for the driver to accept
+					 * a metadata commit. Use TEST_ONLY so hardware state is
+					 * unchanged.
+					 */
+					igt_create_fb(data->fd,
+						      data->w, data->h,
+						      hdr_test_formats[i],
+						      DRM_FORMAT_MOD_LINEAR,
+						      &data->afb);
+					igt_plane_set_fb(data->primary, &data->afb);
+					igt_plane_set_size(data->primary, data->w, data->h);
+					igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
 					igt_hdr_fill_st2084(&hdr);
 					igt_hdr_set_metadata(data->output, &hdr);
-					igt_require_f(!igt_display_try_commit2(display,
-									       display->is_atomic ?
-									       COMMIT_ATOMIC :
-									       COMMIT_LEGACY),
+					igt_require_f(!igt_display_try_commit_atomic(display,
+										     DRM_MODE_ATOMIC_TEST_ONLY |
+										     DRM_MODE_ATOMIC_ALLOW_MODESET,
+										     NULL),
 						      "%s: Couldn't set HDR metadata\n",
 						      igt_output_name(output));

+					/* Reset IGT display state; hardware was not changed. */
+					igt_hdr_set_metadata(data->output, NULL);
+					igt_plane_set_fb(data->primary, NULL);
+					igt_remove_fb(data->fd, &data->afb);
+
 					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",
@@ -591,10 +612,6 @@ static void test_hdr(data_t *data, uint32_t flags)
 					else
 						flags &= ~TEST_NEEDS_DSC;

-					igt_hdr_set_metadata(data->output, 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,
--
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-14  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 22:22 [PATCH][V4] tests/kms_hdr: Add interactive HDR verification to static-swap Alex Hung
2026-05-13  0:44 ` ✓ i915.CI.BAT: success for " Patchwork
2026-05-13  3:01 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-13 17:51 ` [PATCH][V4] " Sharma, Swati2
2026-05-13 21:28 ` ✗ Xe.CI.FULL: failure for " Patchwork
2026-05-14  1:36 ` ✗ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox