Commit 24576d23 authored by Jesse Barnes's avatar Jesse Barnes Committed by Daniel Vetter

drm/i915: enable VT switchless resume v3

With the other bits in place, we can do this safely.

v2: disable backlight on suspend to prevent premature enablement on resume
v3: disable CRTCs on suspend to allow RTD3 (Kristen)
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b5644d05
...@@ -458,6 +458,7 @@ bool i915_semaphore_is_enabled(struct drm_device *dev) ...@@ -458,6 +458,7 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
static int i915_drm_freeze(struct drm_device *dev) static int i915_drm_freeze(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_crtc *crtc;
/* ignore lid events during suspend */ /* ignore lid events during suspend */
mutex_lock(&dev_priv->modeset_restore_lock); mutex_lock(&dev_priv->modeset_restore_lock);
...@@ -481,10 +482,14 @@ static int i915_drm_freeze(struct drm_device *dev) ...@@ -481,10 +482,14 @@ static int i915_drm_freeze(struct drm_device *dev)
cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work); cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
intel_modeset_disable(dev);
drm_irq_uninstall(dev); drm_irq_uninstall(dev);
dev_priv->enable_hotplug_processing = false; dev_priv->enable_hotplug_processing = false;
/*
* Disable CRTCs directly since we want to preserve sw state
* for _thaw.
*/
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
dev_priv->display.crtc_disable(crtc);
} }
i915_save_state(dev); i915_save_state(dev);
...@@ -562,7 +567,10 @@ static int __i915_drm_thaw(struct drm_device *dev) ...@@ -562,7 +567,10 @@ static int __i915_drm_thaw(struct drm_device *dev)
drm_irq_install(dev); drm_irq_install(dev);
intel_modeset_init_hw(dev); intel_modeset_init_hw(dev);
intel_modeset_setup_hw_state(dev, false);
drm_modeset_lock_all(dev);
intel_modeset_setup_hw_state(dev, true);
drm_modeset_unlock_all(dev);
/* /*
* ... but also need to make sure that hotplug processing * ... but also need to make sure that hotplug processing
......
...@@ -150,6 +150,9 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -150,6 +150,9 @@ static int intelfb_create(struct drm_fb_helper *helper,
} }
info->screen_size = size; info->screen_size = size;
/* This driver doesn't need a VT switch to restore the mode on resume */
info->skip_vt_switch = true;
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
......
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