[PATCH 2/2] drm/i915/display: accept a luminance range from any source

Cristian La Spina <[email protected]> Sun, 2 Aug 2026 19:06:47 +0200
Newsgroups org.freedesktop.lists.intel-gfx,org.freedesktop.lists.dri-devel,org.freedesktop.lists.intel-xe,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
intel_dp_aux_supports_hdr_backlight() refuses the Intel proprietary eDP
backlight interface unless the panel carries CTA HDR static metadata.
What the interface actually needs is the luminance range, and
intel_dp_aux_hdr_setup_backlight() already reads that from
display_info.luminance_range, which the DRM core now also fills in from
the DisplayID 2.0 Display Parameters block.

Accept a panel whose range came from there too. Panels carrying the CTA
metadata are unaffected, including those that provide the metadata block
without the optional luminance bytes and so still land on the hardcoded
512 nits fallback.

On the Lenovo Yoga 9 2-in-1 14IPH11 this replaces a backlight that does
not respond at all, because the PWM fallback drives nothing on an OLED
panel, with working brightness over the 4-500 nits range the panel
declares.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Cristian La Spina <[email protected]>
---
 .../drm/i915/display/intel_dp_aux_backlight.c   | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

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 7a6c07f6a..8ac47ed18 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -136,19 +136,18 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector)
 		return false;
 
 	/*
-	 * If we don't have HDR static metadata there is no way to
-	 * runtime detect used range for nits based control. For now
-	 * do not use Intel proprietary eDP backlight control if we
-	 * don't have this data in panel EDID. In case we find panel
-	 * which supports only nits based control, but doesn't provide
-	 * HDR static metadata we need to start maintaining table of
-	 * ranges for such panels.
+	 * Nits based control needs to know the panel's luminance range. The
+	 * DRM core fills it in from CTA HDR static metadata, or from the
+	 * DisplayID 2.0 Display Parameters block for the panels that publish
+	 * it only there. With neither there is no way to detect the range at
+	 * runtime, so do not use the Intel proprietary eDP backlight control.
 	 */
 	if (display->params.enable_dpcd_backlight != INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL &&
 	    !(connector->base.display_info.hdr_sink_metadata.hdmi_type1.metadata_type &
-	      BIT(HDMI_STATIC_METADATA_TYPE1))) {
+	      BIT(HDMI_STATIC_METADATA_TYPE1)) &&
+	    !connector->base.display_info.luminance_range.max_luminance) {
 		drm_info(display->drm,
-			 "[CONNECTOR:%d:%s] Panel is missing HDR static metadata. Possible support for Intel HDR backlight interface is not used. If your backlight controls don't work try booting with i915.enable_dpcd_backlight=%d.\n",
+			 "[CONNECTOR:%d:%s] Panel is missing its luminance range. Possible support for Intel HDR backlight interface is not used. If your backlight controls don't work try booting with i915.enable_dpcd_backlight=%d.\n",
 			 connector->base.base.id, connector->base.name,
 			 INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL);
 		return false;
-- 
2.52.0