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

Jouni Högander jouni.hogander at intel.com
Tue Apr 12 06:51:02 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 f69e185b58c1..e342519b28be 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -280,8 +280,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, "Failed to calculate backlight range\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