All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/4] drm/i915: enable VT switchless resume v3
Date: Tue, 26 Mar 2013 09:25:45 -0700	[thread overview]
Message-ID: <1364315146-20542-3-git-send-email-jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <1364315146-20542-1-git-send-email-jbarnes@virtuousgeek.org>

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: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.c |   14 +++++++++++---
 drivers/gpu/drm/i915/intel_fb.c |    3 +++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6c4b13c..bf57e1c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -458,6 +458,7 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
 static int i915_drm_freeze(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_crtc *crtc;
 
 	/* ignore lid events during suspend */
 	mutex_lock(&dev_priv->modeset_restore_lock);
@@ -481,10 +482,14 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 		cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
 
-		intel_modeset_disable(dev);
-
 		drm_irq_uninstall(dev);
 		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);
@@ -562,7 +567,10 @@ static int __i915_drm_thaw(struct drm_device *dev)
 		drm_irq_install(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
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index f203418..8d81c929 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -150,6 +150,9 @@ static int intelfb_create(struct drm_fb_helper *helper,
 	}
 	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_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
 
-- 
1.7.9.5

  parent reply	other threads:[~2013-03-26 16:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 16:25 [PATCH 1/4] drm/i915: add sprite restore function v3 Jesse Barnes
2013-03-26 16:25 ` [PATCH 2/4] drm/i915: restore cursor and sprite state when forcing a config restore Jesse Barnes
2013-03-26 16:40   ` Rodrigo Vivi
2013-03-26 16:52   ` Daniel Vetter
2013-03-26 17:07   ` [PATCH 1/2] drm/i915: enable VT switchless resume v3 Jesse Barnes
2013-03-26 17:07     ` [PATCH 2/2] drm/i915: emit a hotplug event on resume Jesse Barnes
2013-03-26 20:25   ` drm/i915: restore cursor and sprite state when forcing a config restore v2 Jesse Barnes
2013-03-26 20:46     ` Daniel Vetter
2013-03-26 20:57       ` Jesse Barnes
2013-03-26 16:25 ` Jesse Barnes [this message]
2013-03-26 16:42   ` [PATCH 3/4] drm/i915: enable VT switchless resume v3 Rodrigo Vivi
2013-04-03  9:15   ` Daniel Vetter
2013-04-03 10:54     ` Chris Wilson
2013-04-03 15:13       ` Jesse Barnes
2014-04-21 16:37   ` Knut Petersen
2014-05-16 22:20     ` Jesse Barnes
2014-05-16 22:28       ` Daniel Vetter
2014-05-16 22:38       ` Chris Wilson
2014-05-16 22:42         ` Chris Wilson
2014-05-20 19:53           ` Jesse Barnes
2014-05-20 19:58             ` Jesse Barnes
2014-05-20 20:15               ` Daniel Vetter
2014-05-20 21:10                 ` Jesse Barnes
2014-05-20 21:18                   ` Jesse Barnes
2014-05-20 21:27                     ` Jesse Barnes
2013-03-26 16:25 ` [PATCH 4/4] drm/i915: emit a hotplug event on resume Jesse Barnes
2013-03-26 16:43   ` Rodrigo Vivi
2013-03-26 16:38 ` [PATCH 1/4] drm/i915: add sprite restore function v3 Rodrigo Vivi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364315146-20542-3-git-send-email-jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.