Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dp: Extend HDR mode to HLG
@ 2026-11-17 10:48 Vidya Srinivas
  2026-11-17 11:07 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vidya Srinivas @ 2026-11-17 10:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: intel-xe, uma.shankar, Vidya Srinivas

intel_dp_in_hdr_mode() only recognizes the SMPTE ST 2084 (PQ) EOTF.
Extend it to treat BT.2100 HLG as HDR.

The eDP HDR backlight interface in intel_dp_aux_backlight.c
uses the same check, and its TCON can only decode ST 2084
set INTEL_EDP_HDR_TCON_2084_DECODE_ENABLE only for a PQ
output and clear it otherwise, so that the panel doesn't decode HLG
signal as PQ.

Suggested-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c               |  5 ++++-
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 +++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ef164a797618..adaa8fb25732 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3388,17 +3388,20 @@ static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
 	}
 }
 
+/* True for both HDR transfer functions, SMPTE ST 2084 (PQ) and BT.2100 HLG. */
 bool
 intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state)
 {
 	struct hdr_output_metadata *hdr_metadata;
+	u8 eotf;
 
 	if (!conn_state->hdr_output_metadata)
 		return false;
 
 	hdr_metadata = conn_state->hdr_output_metadata->data;
+	eotf = hdr_metadata->hdmi_metadata_type1.eotf;
 
-	return hdr_metadata->hdmi_metadata_type1.eotf == HDMI_EOTF_SMPTE_ST2084;
+	return eotf == HDMI_EOTF_SMPTE_ST2084 || eotf == HDMI_EOTF_BT_2100_HLG;
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index dc2f0f3088a9..fa68cc6803a6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -284,8 +284,16 @@ intel_dp_aux_fill_hdr_tcon_params(const struct drm_connector_state *conn_state,
 	 * HDR mode.
 	 */
 	if (intel_dp_in_hdr_mode(conn_state)) {
+		const struct hdr_output_metadata *hdr_metadata =
+			conn_state->hdr_output_metadata->data;
+
 		*ctrl |= INTEL_EDP_HDR_TCON_SEGMENTED_BACKLIGHT_ENABLE;
-		*ctrl |= INTEL_EDP_HDR_TCON_2084_DECODE_ENABLE;
+
+		/* The TCON can only decode SMPTE ST 2084 (PQ), not HLG. */
+		if (hdr_metadata->hdmi_metadata_type1.eotf == HDMI_EOTF_SMPTE_ST2084)
+			*ctrl |= INTEL_EDP_HDR_TCON_2084_DECODE_ENABLE;
+		else
+			*ctrl &= ~INTEL_EDP_HDR_TCON_2084_DECODE_ENABLE;
 	}
 
 	if (DISPLAY_VER(display) < 11)
-- 
2.45.2


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

end of thread, other threads:[~2026-11-17 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 10:48 [PATCH] drm/i915/dp: Extend HDR mode to HLG Vidya Srinivas
2026-11-17 11:07 ` ✓ CI.KUnit: success for " Patchwork
2026-11-17 11:29 ` [PATCH] " sashiko-bot
2026-11-17 11:39 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-11-17 12:56 ` [PATCH] " Ville Syrjälä

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