mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 19:26:01 -04:00
drm/i915/dp: Write panel override luminance values
Write panel override luminance values which helps the TCON decide if tone mapping needs to be enabled or not. Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240507040407.1056061-8-suraj.kandpal@intel.com
This commit is contained in:
committed by
Uma Shankar
parent
b0944c983d
commit
84ceb14076
@@ -374,6 +374,29 @@ static const char *dpcd_vs_pwm_str(bool aux)
|
||||
return aux ? "DPCD" : "PWM";
|
||||
}
|
||||
|
||||
static void
|
||||
intel_dp_aux_write_panel_luminance_override(struct intel_connector *connector)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
struct intel_panel *panel = &connector->panel;
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
|
||||
int ret;
|
||||
u8 buf[4] = {};
|
||||
|
||||
buf[0] = panel->backlight.min & 0xFF;
|
||||
buf[1] = (panel->backlight.min & 0xFF00) >> 8;
|
||||
buf[2] = panel->backlight.max & 0xFF;
|
||||
buf[3] = (panel->backlight.max & 0xFF00) >> 8;
|
||||
|
||||
ret = drm_dp_dpcd_write(&intel_dp->aux,
|
||||
INTEL_EDP_HDR_PANEL_LUMINANCE_OVERRIDE,
|
||||
buf, sizeof(buf));
|
||||
if (ret < 0)
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"Panel Luminance DPCD reg write failed, err:-%d\n",
|
||||
ret);
|
||||
}
|
||||
|
||||
static int
|
||||
intel_dp_aux_hdr_setup_backlight(struct intel_connector *connector, enum pipe pipe)
|
||||
{
|
||||
@@ -405,6 +428,8 @@ intel_dp_aux_hdr_setup_backlight(struct intel_connector *connector, enum pipe pi
|
||||
panel->backlight.min = 0;
|
||||
}
|
||||
|
||||
intel_dp_aux_write_panel_luminance_override(connector);
|
||||
|
||||
drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Using AUX HDR interface for backlight control (range %d..%d)\n",
|
||||
connector->base.base.id, connector->base.name,
|
||||
panel->backlight.min, panel->backlight.max);
|
||||
|
||||
Reference in New Issue
Block a user