aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 8320279fad58..ef6455104ff1 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -53,6 +53,16 @@ static struct intel_lvds *enc_to_intel_lvds(struct drm_encoder *encoder)
53 return container_of(enc_to_intel_encoder(encoder), struct intel_lvds, base); 53 return container_of(enc_to_intel_encoder(encoder), struct intel_lvds, base);
54} 54}
55 55
56static void intel_lvds_lock_panel(struct drm_device *dev, bool lock)
57{
58 struct drm_i915_private *dev_priv = dev->dev_private;
59
60 if (lock)
61 I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) & 0x3);
62 else
63 I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
64}
65
56/** 66/**
57 * Sets the power state for the panel. 67 * Sets the power state for the panel.
58 */ 68 */
@@ -349,10 +359,14 @@ static void intel_lvds_prepare(struct drm_encoder *encoder)
349{ 359{
350 struct drm_device *dev = encoder->dev; 360 struct drm_device *dev = encoder->dev;
351 struct drm_i915_private *dev_priv = dev->dev_private; 361 struct drm_i915_private *dev_priv = dev->dev_private;
362 struct intel_lvds *intel_lvds = enc_to_intel_lvds(encoder);
352 363
353 dev_priv->backlight_level = intel_panel_get_backlight(dev); 364 dev_priv->backlight_level = intel_panel_get_backlight(dev);
354 365
355 intel_lvds_set_power(dev, false); 366 if (intel_lvds->pfit_control == I915_READ(PFIT_CONTROL))
367 intel_lvds_lock_panel(dev, false);
368 else
369 intel_lvds_set_power(dev, false);
356} 370}
357 371
358static void intel_lvds_commit( struct drm_encoder *encoder) 372static void intel_lvds_commit( struct drm_encoder *encoder)
@@ -363,7 +377,10 @@ static void intel_lvds_commit( struct drm_encoder *encoder)
363 if (dev_priv->backlight_level == 0) 377 if (dev_priv->backlight_level == 0)
364 dev_priv->backlight_level = intel_panel_get_max_backlight(dev); 378 dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
365 379
366 intel_lvds_set_power(dev, true); 380 if ((I915_READ(PP_CONTROL) & PANEL_UNLOCK_REGS) == PANEL_UNLOCK_REGS)
381 intel_lvds_lock_panel(dev, true);
382 else
383 intel_lvds_set_power(dev, true);
367} 384}
368 385
369static void intel_lvds_mode_set(struct drm_encoder *encoder, 386static void intel_lvds_mode_set(struct drm_encoder *encoder,