Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Swati Sharma <swati2.sharma@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH i-g-t, v5 2/4] lib/igt_hdr: Add helpers to enable and disable HDR on an output
Date: Wed, 29 Apr 2026 23:22:03 +0530	[thread overview]
Message-ID: <20260429175205.2327206-3-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260429175205.2327206-1-swati2.sharma@intel.com>

Add convenience helpers to explicitly enable and disable HDR on an
output connector.

v2: -rebase

Co-developed-by: Claude Opus 4.6
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 lib/igt_hdr.c | 16 ++++++++++++++++
 lib/igt_hdr.h |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/lib/igt_hdr.c b/lib/igt_hdr.c
index 25658ab9e..c0ed9e843 100644
--- a/lib/igt_hdr.c
+++ b/lib/igt_hdr.c
@@ -222,3 +222,19 @@ bool igt_output_supports_hdr(igt_output_t *output)
 {
 	return igt_output_has_prop(output, IGT_CONNECTOR_HDR_OUTPUT_METADATA);
 }
+
+void igt_hdr_disable(igt_output_t *output)
+{
+	igt_hdr_set_metadata(output, NULL);
+	igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, 8);
+}
+
+void igt_hdr_enable(igt_output_t *output)
+{
+	struct hdr_output_metadata meta;
+
+	/* Fill HDR metadata and enable it on the output */
+	igt_hdr_fill_st2084(&meta);
+	igt_hdr_set_metadata(output, &meta);
+	igt_output_set_prop_value(output, IGT_CONNECTOR_MAX_BPC, 10);
+}
diff --git a/lib/igt_hdr.h b/lib/igt_hdr.h
index 09243f915..15ce5f117 100644
--- a/lib/igt_hdr.h
+++ b/lib/igt_hdr.h
@@ -25,4 +25,7 @@ void igt_hdr_set_metadata(igt_output_t *output,
 
 bool igt_output_supports_hdr(igt_output_t *output);
 
+void igt_hdr_disable(igt_output_t *output);
+void igt_hdr_enable(igt_output_t *output);
+
 #endif /* IGT_HDR_H */
-- 
2.25.1


  parent reply	other threads:[~2026-04-29 17:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 17:52 [PATCH i-g-t,v5 0/4] Enable HDR in IGT Frontbuffer Feature Tests Swati Sharma
2026-04-29 17:52 ` [PATCH i-g-t, v5 1/4] lib/igt_hdr: Move HDR helpers from kms_hdr into shared library Swati Sharma
2026-04-29 17:52 ` Swati Sharma [this message]
2026-04-29 17:52 ` [PATCH i-g-t, v5 3/4] tests/intel/kms_frontbuffer_tracking: Add HDR feature support Swati Sharma
2026-04-30  7:43   ` Jani Nikula
2026-04-30  8:37     ` Sharma, Swati2
2026-05-06 11:04     ` Kamil Konieczny
2026-04-29 17:52 ` [PATCH i-g-t, v5 4/4] tests/intel/kms_frontbuffer_tracking: Enable HDR in feature tests Swati Sharma
2026-04-29 18:50 ` ✓ Xe.CI.BAT: success for Enable HDR in IGT Frontbuffer Feature Tests (rev5) Patchwork
2026-04-29 19:50 ` ✓ i915.CI.BAT: " Patchwork
2026-04-30  4:24 ` ✗ i915.CI.Full: failure " Patchwork
2026-04-30  6:16 ` ✗ Xe.CI.FULL: " Patchwork
2026-04-30  8:19 ` ✓ i915.CI.Full: success " 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=20260429175205.2327206-3-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=suraj.kandpal@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