Commit 309b1e3a authored by Matthew Garrett's avatar Matthew Garrett Committed by Chris Wilson

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: default avatarMatthew Garrett <mjg@redhat.com>
Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 434ed097
......@@ -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,9 +359,13 @@ 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);
if (intel_lvds->pfit_control == I915_READ(PFIT_CONTROL))
intel_lvds_lock_panel(dev, false);
else
intel_lvds_set_power(dev, false);
}
......@@ -363,6 +377,9 @@ 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);
if ((I915_READ(PP_CONTROL) & PANEL_UNLOCK_REGS) == PANEL_UNLOCK_REGS)
intel_lvds_lock_panel(dev, true);
else
intel_lvds_set_power(dev, true);
}
......
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