Skip to content

Commit 770c123

Browse files
tiwaidanvet
authored andcommitted
drm/i915: Fix blank panel at reopening lid
When you reopen the lid on a laptop with PCH, the panel suddenly goes blank sometimes. It seems because BLC_PWM_CPU_CTL register is cleared to zero when BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1 registers are enabled. This patch fixes the problem by moving the call of the function setting BLC_PWM_CPU_CTL after enabling other two registers. Reported-and-tested-by: Hugh Dickins <hughd@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 9830605 commit 770c123

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/gpu/drm/i915/intel_panel.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ void intel_panel_enable_backlight(struct drm_device *dev,
311311
if (dev_priv->backlight_level == 0)
312312
dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
313313

314-
dev_priv->backlight_enabled = true;
315-
intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
316-
317314
if (INTEL_INFO(dev)->gen >= 4) {
318315
uint32_t reg, tmp;
319316

@@ -326,7 +323,7 @@ void intel_panel_enable_backlight(struct drm_device *dev,
326323
* we don't track the backlight dpms state, hence check whether
327324
* we have to do anything first. */
328325
if (tmp & BLM_PWM_ENABLE)
329-
return;
326+
goto set_level;
330327

331328
if (dev_priv->num_pipe == 3)
332329
tmp &= ~BLM_PIPE_SELECT_IVB;
@@ -347,6 +344,14 @@ void intel_panel_enable_backlight(struct drm_device *dev,
347344
I915_WRITE(BLC_PWM_PCH_CTL1, tmp);
348345
}
349346
}
347+
348+
set_level:
349+
/* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1.
350+
* BLC_PWM_CPU_CTL may be cleared to zero automatically when these
351+
* registers are set.
352+
*/
353+
dev_priv->backlight_enabled = true;
354+
intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
350355
}
351356

352357
static void intel_panel_init_backlight(struct drm_device *dev)

0 commit comments

Comments
 (0)