[PATCH 04/13] drm/dp: Move from u16 to u32 for max in drm_edp_backlight_info

Murthy, Arun R arun.r.murthy at intel.com
Thu Jun 19 05:21:20 UTC 2025


> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal at intel.com>
> Sent: Monday, April 14, 2025 9:46 AM
> To: nouveau at lists.freedesktop.org; dri-devel at lists.freedesktop.org; intel-
> xe at lists.freedesktop.org; intel-gfx at lists.freedesktop.org
> Cc: Nautiyal, Ankit K <ankit.k.nautiyal at intel.com>; Murthy, Arun R
> <arun.r.murthy at intel.com>; Kandpal, Suraj <suraj.kandpal at intel.com>
> Subject: [PATCH 04/13] drm/dp: Move from u16 to u32 for max in
> drm_edp_backlight_info
> 
> Use u32 instead of u16 for max variable in drm_edp_backlight_info since it can
> now hold max luminance range value which is u32.
> We will set this max with max_luminance value when luminance_set is true.
> 
> Signed-off-by: Suraj Kandpal <suraj.kandpal at intel.com>
> ---
>  drivers/gpu/drm/display/drm_dp_helper.c | 10 +++++++---
>  include/drm/display/drm_dp_helper.h     |  2 +-
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c
> b/drivers/gpu/drm/display/drm_dp_helper.c
> index 3b309ac5190b..1322bdfb6c8b 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -4270,9 +4270,13 @@ drm_edp_backlight_init(struct drm_dp_aux *aux,
> struct drm_edp_backlight_info *bl
>  		return -EINVAL;
>  	}
> 
> -	ret = drm_edp_backlight_probe_max(aux, bl, driver_pwm_freq_hz,
> edp_dpcd);
> -	if (ret < 0)
> -		return ret;
> +	if (bl->luminance_set) {
> +		bl->max = lr->max_luminance;
This change may not be required as in 3rd patch the max luminance will directly be copied to the backlight_info.

Other than this change patch looks good.
Thanks and Regards,
Arun R Murthy
--------------------
> +	} else {
> +		ret = drm_edp_backlight_probe_max(aux, bl,
> driver_pwm_freq_hz, edp_dpcd);
> +		if (ret < 0)
> +			return ret;
> +	}
> 
>  	ret = drm_edp_backlight_probe_state(aux, bl, current_mode);
>  	if (ret < 0)
> diff --git a/include/drm/display/drm_dp_helper.h
> b/include/drm/display/drm_dp_helper.h
> index 6f53921f5dce..39d644495f3e 100644
> --- a/include/drm/display/drm_dp_helper.h
> +++ b/include/drm/display/drm_dp_helper.h
> @@ -839,7 +839,7 @@ drm_dp_has_quirk(const struct drm_dp_desc *desc,
> enum drm_dp_quirk quirk)  struct drm_edp_backlight_info {
>  	u8 pwmgen_bit_count;
>  	u8 pwm_freq_pre_divider;
> -	u16 max;
> +	u32 max;
> 
>  	bool lsb_reg_used : 1;
>  	bool aux_enable : 1;
> --
> 2.34.1



More information about the Nouveau mailing list