From: Gareth Yu <gareth.yu@xxxxxxxxx> Turn on the panel from zero brightness of the last state, the panel was set a maximum PWM in the flow. Once the panel initialization is completed, the backlight is restored to xero brightness. There is a flckering generated. This flicker happens in "Screen dimming and power off" of Google's design and resume from sleep. The sample of DMESG is below. (suspend) [53949.248875] i915 0000:00:02.0: [drm:intel_edp_backlight_off] [53949.452046] i915 0000:00:02.0: [drm:intel_backlight_set_pwm_level] set backlight PWM = 0 (wakeup) [53986.067356] i915 0000:00:02.0: [drm:intel_edp_backlight_on] [53986.067367] i915 0000:00:02.0: [drm:intel_backlight_enable] pipe A [53986.067476] i915 0000:00:02.0: [drm:intel_backlight_set_pwm_level] set backlight PWM = 96000 [53986.119766] backlight intel_backlight: PM: calling backlight_resume+0x0/0x7a @ 4916, parent: card0-eDP-1 [53986.119781] backlight intel_backlight: PM: backlight_resume+0x0/0x7a returned 0 after 0 usecs [53986.220068] [drm:intel_backlight_device_update_status] updating intel_backlight, brightness=26321/96000 [53986.220086] i915 0000:00:02.0: [drm:intel_panel_actually_set_backlight] set backlight level = 27961 Set the brightness to the minimum value when the brightness is less or equal to the minimum value to mitigate this flickering. Cc : Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@xxxxxxxxx> Cc : Matt Roper <matthew.d.roper@xxxxxxxxx> Cc : Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Signed-off-by: Gareth Yu <gareth.yu@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 3f3cd944a1c5..1cfac72aacc6 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -761,7 +761,7 @@ static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state, WARN_ON(panel->backlight.max == 0); - if (panel->backlight.level <= panel->backlight.min) { + if (panel->backlight.level < panel->backlight.min) { panel->backlight.level = panel->backlight.max; if (panel->backlight.device) panel->backlight.device->props.brightness = -- 2.25.1