<div dir="ltr">Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@gmail.com">rodrigo.vivi@gmail.com</a>><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 26, 2013 at 1:25 PM, Jesse Barnes <span dir="ltr"><<a href="mailto:jbarnes@virtuousgeek.org" target="_blank">jbarnes@virtuousgeek.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With the other bits in place, we can do this safely.<br>
<br>
v2: disable backlight on suspend to prevent premature enablement on resume<br>
v3: disable CRTCs on suspend to allow RTD3 (Kristen)<br>
<br>
Signed-off-by: Jesse Barnes <<a href="mailto:jbarnes@virtuousgeek.org">jbarnes@virtuousgeek.org</a>><br>
---<br>
 drivers/gpu/drm/i915/i915_drv.c |   14 +++++++++++---<br>
 drivers/gpu/drm/i915/intel_fb.c |    3 +++<br>
 2 files changed, 14 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c<br>
index 6c4b13c..bf57e1c 100644<br>
--- a/drivers/gpu/drm/i915/i915_drv.c<br>
+++ b/drivers/gpu/drm/i915/i915_drv.c<br>
@@ -458,6 +458,7 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)<br>
 static int i915_drm_freeze(struct drm_device *dev)<br>
 {<br>
        struct drm_i915_private *dev_priv = dev->dev_private;<br>
+       struct drm_crtc *crtc;<br>
<br>
        /* ignore lid events during suspend */<br>
        mutex_lock(&dev_priv->modeset_restore_lock);<br>
@@ -481,10 +482,14 @@ static int i915_drm_freeze(struct drm_device *dev)<br>
<br>
                cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);<br>
<br>
-               intel_modeset_disable(dev);<br>
-<br>
                drm_irq_uninstall(dev);<br>
                dev_priv->enable_hotplug_processing = false;<br>
+               /*<br>
+                * Disable CRTCs directly since we want to preserve sw state<br>
+                * for _thaw.<br>
+                */<br>
+               list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)<br>
+                       dev_priv->display.crtc_disable(crtc);<br>
        }<br>
<br>
        i915_save_state(dev);<br>
@@ -562,7 +567,10 @@ static int __i915_drm_thaw(struct drm_device *dev)<br>
                drm_irq_install(dev);<br>
<br>
                intel_modeset_init_hw(dev);<br>
-               intel_modeset_setup_hw_state(dev, false);<br>
+<br>
+               drm_modeset_lock_all(dev);<br>
+               intel_modeset_setup_hw_state(dev, true);<br>
+               drm_modeset_unlock_all(dev);<br>
<br>
                /*<br>
                 * ... but also need to make sure that hotplug processing<br>
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c<br>
index f203418..8d81c929 100644<br>
--- a/drivers/gpu/drm/i915/intel_fb.c<br>
+++ b/drivers/gpu/drm/i915/intel_fb.c<br>
@@ -150,6 +150,9 @@ static int intelfb_create(struct drm_fb_helper *helper,<br>
        }<br>
        info->screen_size = size;<br>
<br>
+       /* This driver doesn't need a VT switch to restore the mode on resume */<br>
+       info->skip_vt_switch = true;<br>
+<br>
        drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);<br>
        drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Rodrigo Vivi</div><div>Blog: <a href="http://blog.vivi.eng.br" target="_blank">http://blog.vivi.eng.br</a></div><div> </div>
</div>