Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Suraj Kandpal and committed by
Uma Shankar
84ceb140 b0944c98

+25
+25
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
··· 374 374 return aux ? "DPCD" : "PWM"; 375 375 } 376 376 377 + static void 378 + intel_dp_aux_write_panel_luminance_override(struct intel_connector *connector) 379 + { 380 + struct drm_i915_private *i915 = to_i915(connector->base.dev); 381 + struct intel_panel *panel = &connector->panel; 382 + struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); 383 + int ret; 384 + u8 buf[4] = {}; 385 + 386 + buf[0] = panel->backlight.min & 0xFF; 387 + buf[1] = (panel->backlight.min & 0xFF00) >> 8; 388 + buf[2] = panel->backlight.max & 0xFF; 389 + buf[3] = (panel->backlight.max & 0xFF00) >> 8; 390 + 391 + ret = drm_dp_dpcd_write(&intel_dp->aux, 392 + INTEL_EDP_HDR_PANEL_LUMINANCE_OVERRIDE, 393 + buf, sizeof(buf)); 394 + if (ret < 0) 395 + drm_dbg_kms(&i915->drm, 396 + "Panel Luminance DPCD reg write failed, err:-%d\n", 397 + ret); 398 + } 399 + 377 400 static int 378 401 intel_dp_aux_hdr_setup_backlight(struct intel_connector *connector, enum pipe pipe) 379 402 { ··· 427 404 panel->backlight.max = 512; 428 405 panel->backlight.min = 0; 429 406 } 407 + 408 + intel_dp_aux_write_panel_luminance_override(connector); 430 409 431 410 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Using AUX HDR interface for backlight control (range %d..%d)\n", 432 411 connector->base.base.id, connector->base.name,