Commit 770c1231 authored by Takashi Iwai's avatar Takashi Iwai Committed by Daniel Vetter

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: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9830605d
...@@ -311,9 +311,6 @@ void intel_panel_enable_backlight(struct drm_device *dev, ...@@ -311,9 +311,6 @@ void intel_panel_enable_backlight(struct drm_device *dev,
if (dev_priv->backlight_level == 0) if (dev_priv->backlight_level == 0)
dev_priv->backlight_level = intel_panel_get_max_backlight(dev); dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
dev_priv->backlight_enabled = true;
intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
if (INTEL_INFO(dev)->gen >= 4) { if (INTEL_INFO(dev)->gen >= 4) {
uint32_t reg, tmp; uint32_t reg, tmp;
...@@ -326,7 +323,7 @@ void intel_panel_enable_backlight(struct drm_device *dev, ...@@ -326,7 +323,7 @@ void intel_panel_enable_backlight(struct drm_device *dev,
* we don't track the backlight dpms state, hence check whether * we don't track the backlight dpms state, hence check whether
* we have to do anything first. */ * we have to do anything first. */
if (tmp & BLM_PWM_ENABLE) if (tmp & BLM_PWM_ENABLE)
return; goto set_level;
if (dev_priv->num_pipe == 3) if (dev_priv->num_pipe == 3)
tmp &= ~BLM_PIPE_SELECT_IVB; tmp &= ~BLM_PIPE_SELECT_IVB;
...@@ -347,6 +344,14 @@ void intel_panel_enable_backlight(struct drm_device *dev, ...@@ -347,6 +344,14 @@ void intel_panel_enable_backlight(struct drm_device *dev,
I915_WRITE(BLC_PWM_PCH_CTL1, tmp); I915_WRITE(BLC_PWM_PCH_CTL1, tmp);
} }
} }
set_level:
/* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1.
* BLC_PWM_CPU_CTL may be cleared to zero automatically when these
* registers are set.
*/
dev_priv->backlight_enabled = true;
intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
} }
static void intel_panel_init_backlight(struct drm_device *dev) static void intel_panel_init_backlight(struct drm_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment