[PATCH v2 2/2] drm/dp: set pwm bit count when pwm hz is not set

Angelo Dureghello angelo at kernel-space.org
Fri Apr 12 19:49:01 UTC 2024


Set pwmgen_bit_count to have proper brightness inc/dec steps
even when driver_pwm_freq_hz (optional) is zero.

cat /sys/class/backlight/nv_backlight/max_brightness
255

Can now tune properly backlight from 0 to 255.

---
Changes for v2:
none

Signed-off-by: Angelo Dureghello <angelo at kernel-space.org>
---
 drivers/gpu/drm/display/drm_dp_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index f5d4be897866..30c4ed0f2ff1 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -3768,6 +3768,7 @@ drm_edp_backlight_probe_max(struct drm_dp_aux *aux, struct drm_edp_backlight_inf
 	}
 
 	pn &= DP_EDP_PWMGEN_BIT_COUNT_MASK;
+	bl->pwmgen_bit_count = pn;
 	bl->max = (1 << pn) - 1;
 	if (!driver_pwm_freq_hz)
 		return 0;
-- 
2.44.0



More information about the Nouveau mailing list