]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/dp: Move from u16 to u32 for max in drm_edp_backlight_info
authorSuraj Kandpal <suraj.kandpal@intel.com>
Fri, 20 Jun 2025 06:34:36 +0000 (12:04 +0530)
committerSuraj Kandpal <suraj.kandpal@intel.com>
Mon, 30 Jun 2025 15:11:41 +0000 (20:41 +0530)
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@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Link: https://lore.kernel.org/r/20250620063445.3603086-5-suraj.kandpal@intel.com
drivers/gpu/drm/display/drm_dp_helper.c
include/drm/display/drm_dp_helper.h

index 640bf2fe090823b00743150d8ab7f0795a462485..ecbef8a1bf8ed77c32b05fe3679cc7cad4793591 100644 (file)
@@ -4277,9 +4277,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 = max_luminance;
+       } 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)
index 0575418f0eb3a782c8643c1f2131470141eea6a9..cf0706762902ce2e52fb1c07043f9ae778d4f052 100644 (file)
@@ -844,7 +844,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;