From: Adam Jackson <ajax@redhat.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/4] drm/i915: Push an fbc disable across suspend
Date: Fri, 23 Apr 2010 11:17:40 -0400 [thread overview]
Message-ID: <1272035862-19447-3-git-send-email-ajax@redhat.com> (raw)
In-Reply-To: <1272035862-19447-1-git-send-email-ajax@redhat.com>
Restore it on the way back up if we disabled it on the way down.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
drivers/gpu/drm/i915/i915_drv.c | 13 +++++++++++++
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/i915_suspend.c | 2 --
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 01e91ea..412bade 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -233,6 +233,9 @@ static int i915_drm_freeze(struct drm_device *dev)
drm_irq_uninstall(dev);
}
+ dev_priv->fbc_disabled_for_suspend = intel_fbc_enabled(dev);
+ intel_disable_fbc(dev);
+
i915_save_state(dev);
intel_opregion_free(dev, 1);
@@ -276,6 +279,16 @@ static int i915_drm_thaw(struct drm_device *dev)
i915_restore_state(dev);
+ if (dev_priv->fbc_disabled_for_suspend) {
+ struct drm_crtc *crtc;
+
+ /* XXX might not be the plane we compressed at suspend; meh */
+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
+ intel_enable_fbc(crtc, 500);
+
+ dev_priv->fbc_disabled_for_suspend = false;
+ }
+
intel_opregion_init(dev, 1);
/* KMS EnterVT equivalent */
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3a19cb4..e9e8c4a 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -341,6 +341,7 @@ typedef struct drm_i915_private {
/* Register state */
bool modeset_on_lid;
+ bool fbc_disabled_for_suspend;
u8 saveLBB;
u32 saveDSPACNTR;
u32 saveDSPBCNTR;
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 60a5800..81cdfb4 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -707,10 +707,8 @@ void i915_restore_display(struct drm_device *dev)
/* only restore FBC info on the platform that supports FBC*/
if (I915_HAS_FBC(dev)) {
if (IS_GM45(dev)) {
- g4x_disable_fbc(dev);
I915_WRITE(DPFC_CB_BASE, dev_priv->saveDPFC_CB_BASE);
} else {
- i8xx_disable_fbc(dev);
I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE);
I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE);
I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2);
--
1.7.0.1
next prev parent reply other threads:[~2010-04-23 15:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 15:17 [PATCH 0/4] Attempt to re-enable FBC on gen3 Adam Jackson
2010-04-23 15:17 ` [PATCH 1/4] drm/i915: Make fbc control wrapper functions Adam Jackson
2010-04-23 15:17 ` Adam Jackson [this message]
2010-04-29 22:45 ` [PATCH 2/4] drm/i915: Push an fbc disable across suspend Eric Anholt
2010-04-30 14:33 ` Adam Jackson
2010-05-02 21:26 ` Daniel Vetter
2010-04-23 15:17 ` [PATCH 3/4] drm/i915: Hide per-chipset fbc disable routines again Adam Jackson
2010-04-23 15:17 ` [PATCH 4/4] Revert "drm/i915: Disable FBC on 915GM and 945GM." Adam Jackson
2010-04-27 21:22 ` [PATCH 0/4] Attempt to re-enable FBC on gen3 Alexander Lam
2010-04-29 8:23 ` Tobias Doerffel
2010-04-30 23:05 ` Jesse Barnes
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=1272035862-19447-3-git-send-email-ajax@redhat.com \
--to=ajax@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox