*/
pwm_apply_args(panel->backlight.pwm);
- panel->backlight.min = 0; /* 0% */
panel->backlight.max = 100; /* 100% */
+ panel->backlight.min = get_backlight_min_vbt(connector);
level = intel_panel_compute_brightness(connector, 100);
ns = DIV_ROUND_UP(level * panel->backlight.pwm_period_ns, 100);
level = DIV_ROUND_UP(pwm_get_duty_cycle(panel->backlight.pwm) * 100,
panel->backlight.pwm_period_ns);
- panel->backlight.level =
- intel_panel_compute_brightness(connector, level);
+ level = intel_panel_compute_brightness(connector, level);
+ panel->backlight.level = clamp(level, panel->backlight.min,
+ panel->backlight.max);
panel->backlight.enabled = panel->backlight.level != 0;
drm_info(&dev_priv->drm, "Using %s PWM for LCD backlight control\n",