@@ -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;
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@redhat.com> Cc: Mika Kahola <mika.kahola@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jouni Högander <jouni.hogander@intel.com> --- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)