Skip to content

Commit 08e81e2

Browse files
committed
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@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
1 parent 81fd014 commit 08e81e2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4277,9 +4277,13 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
42774277
return -EINVAL;
42784278
}
42794279

4280-
ret = drm_edp_backlight_probe_max(aux, bl, driver_pwm_freq_hz, edp_dpcd);
4281-
if (ret < 0)
4282-
return ret;
4280+
if (bl->luminance_set) {
4281+
bl->max = max_luminance;
4282+
} else {
4283+
ret = drm_edp_backlight_probe_max(aux, bl, driver_pwm_freq_hz, edp_dpcd);
4284+
if (ret < 0)
4285+
return ret;
4286+
}
42834287

42844288
ret = drm_edp_backlight_probe_state(aux, bl, current_mode);
42854289
if (ret < 0)

include/drm/display/drm_dp_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ drm_dp_has_quirk(const struct drm_dp_desc *desc, enum drm_dp_quirk quirk)
844844
struct drm_edp_backlight_info {
845845
u8 pwmgen_bit_count;
846846
u8 pwm_freq_pre_divider;
847-
u16 max;
847+
u32 max;
848848

849849
bool lsb_reg_used : 1;
850850
bool aux_enable : 1;

0 commit comments

Comments
 (0)