[PATCH 7/7] drm/i915/backlight: Enable nits based luminance
Murthy, Arun R
arun.r.murthy at intel.com
Thu Feb 6 05:28:11 UTC 2025
> 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 at intel.com>
> Tested-by: Ben Kao <ben.kao at intel.com>
> ---
Reviewed-by; Arun R Murthy <arun.r.murthy at intel.com>
Thanks and Regards,
Arun R Murthy
-------------------
> .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> 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 38e2b8cc591c..a090f1fca66e 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;
> + }
>
Below we are calling drm_edp_backlight_enable()
I think this entire functionality in this series is available in drm_dp_helper.c
Maybe adding an element "bool luminance_nits_control" in struct drm_edp_backlight_info should help in moving the entire functionality to drm core.
Thanks and Regards,
Arun R Murthy
--------------------
> 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)
> --
> 2.34.1
More information about the Intel-gfx
mailing list