aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Kandpal <suraj.kandpal@intel.com>2025-02-06 12:02:53 +0530
committerSuraj Kandpal <suraj.kandpal@intel.com>2025-02-06 22:14:43 +0530
commita5efc8dcfe710fd63a0557d3512e8ff753c2e283 (patch)
tree04536624741afd8c72f182a14538256e0c8de6d0
parentdrm/i915/backlight: Setup nits based luminance via VESA (diff)
downloadlinux-a5efc8dcfe710fd63a0557d3512e8ff753c2e283.tar.gz
linux-a5efc8dcfe710fd63a0557d3512e8ff753c2e283.zip
drm/i915/backlight: Enable nits based luminance
Enable nits based luminance by writing the PANEL_LUMINANCE_CONTROL bit and set the correct register to change brightness. Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Tested-by: Ben Kao <ben.kao@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250206063253.2827017-9-suraj.kandpal@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c15
1 files changed, 15 insertions, 0 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 301a4dfdfbe5..f53c8355d5be 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -527,6 +527,18 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct intel_panel *panel = &connector->panel;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
+ int ret;
+
+ if (panel->backlight.edp.vesa.luminance_control_support) {
+ ret = drm_dp_dpcd_writeb(&intel_dp->aux, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
+ DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE);
+
+ if (ret == 1)
+ return;
+
+ if (!intel_dp_aux_vesa_set_luminance(connector, level))
+ return;
+ }
if (!panel->backlight.edp.vesa.info.aux_enable) {
u32 pwm_level;
@@ -550,6 +562,9 @@ static void intel_dp_aux_vesa_disable_backlight(const struct drm_connector_state
struct intel_panel *panel = &connector->panel;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
+ if (panel->backlight.edp.vesa.luminance_control_support)
+ return;
+
drm_edp_backlight_disable(&intel_dp->aux, &panel->backlight.edp.vesa.info);
if (!panel->backlight.edp.vesa.info.aux_enable)