summaryrefslogtreecommitdiffstats
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 21:20:05 +0100
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 8320279fad5..ef6455104ff 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)
return container_of(enc_to_intel_encoder(encoder), struct intel_lvds, base);
}
+static void intel_lvds_lock_panel(struct drm_device *dev, bool lock)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+
+ if (lock)
+ I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) & 0x3);
+ else
+ I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
+}
+
/**
* Sets the power state for the panel.
*/
@@ -349,10 +359,14 @@ static void intel_lvds_prepare(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
+ struct intel_lvds *intel_lvds = enc_to_intel_lvds(encoder);
dev_priv->backlight_level = intel_panel_get_backlight(dev);
- intel_lvds_set_power(dev, false);
+ if (intel_lvds->pfit_control == I915_READ(PFIT_CONTROL))
+ intel_lvds_lock_panel(dev, false);
+ else
+ intel_lvds_set_power(dev, false);
}
static void intel_lvds_commit( struct drm_encoder *encoder)
@@ -363,7 +377,10 @@ static void intel_lvds_commit( struct drm_encoder *encoder)
if (dev_priv->backlight_level == 0)
dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
- intel_lvds_set_power(dev, true);
+ if ((I915_READ(PP_CONTROL) & PANEL_UNLOCK_REGS) == PANEL_UNLOCK_REGS)
+ intel_lvds_lock_panel(dev, true);
+ else
+ intel_lvds_set_power(dev, true);
}
static void intel_lvds_mode_set(struct drm_encoder *encoder,