aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-05-18 13:53:16 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-08 16:20:05 -0400
commit309b1e3ab750c0ad4d77c6a6e434402e3346baf4 (patch)
treee982b01ef2a240b0d3bd22480bb5e2904c1402fa /drivers/gpu/drm/i915/intel_lvds.c
parent434ed097245423c5ea277d18121c0fad0df42abf (diff)
drm/i915: Don't disable panel for modesetting if pfit hasn't changed
It seems to be possible to program a new mode without disabling the panel if the panel fitter setup doesn't change. Add support for that. Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-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,