[PATCH 3/3] drm/i915: Use luminance range from static hdr metadata

Jouni Högander jouni.hogander at intel.com
Mon Apr 25 06:28:30 UTC 2022


Instead of using fixed 0 - 512 range use
drm_luminance_range_from_static_hdr_metadata to obtain panel range. If
that fails fall back to static 0 - 512.

Cc: Lyude Paul <lyude at redhat.com>
Cc: Mika Kahola <mika.kahola at intel.com>
Cc: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 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 fb6cf30ee628..6673af455808 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -293,8 +293,13 @@ intel_dp_aux_hdr_setup_backlight(struct intel_connector *connector, enum pipe pi
 		}
 	}
 
-	panel->backlight.max = 512;
-	panel->backlight.min = 0;
+	if (!drm_luminance_range_from_static_hdr_metadata(&connector->base,
+							  &panel->backlight.min,
+							  &panel->backlight.max)) {
+		drm_err(&i915->drm, "No backlight range data in static hdr metadata, using fixed 0,512\n");
+		panel->backlight.max = 512;
+		panel->backlight.min = 0;
+	}
 	panel->backlight.level = intel_dp_aux_hdr_get_backlight(connector, pipe);
 	panel->backlight.enabled = panel->backlight.level != 0;
 
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list