All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: stable@kernel.org
Subject: [PATCH][v2] drm/1915: save the right fence registers for Sandybridge
Date: Thu, 16 Sep 2010 16:34:23 +0800	[thread overview]
Message-ID: <1284626063-11395-1-git-send-email-yuanhan.liu@intel.com> (raw)

Sandybridge uses different address offset(0x100000) for fence table registers,
so make sure we have the right fence registers saved before suspend.

This would fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=30199

Cc: stable@kernel.org
Signed-off-by: Yuanhan Liu <yuanhan.liu@intel.com>
---
 drivers/gpu/drm/i915/i915_suspend.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 2c6b98f..04a4032 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -789,7 +789,10 @@ int i915_save_state(struct drm_device *dev)
 		dev_priv->saveSWF2[i] = I915_READ(SWF30 + (i << 2));
 
 	/* Fences */
-	if (IS_I965G(dev)) {
+	if (IS_GEN6(dev)) {
+		for (i = 0; i < 16; i++)
+			dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_SANDYBRIDGE_0 + (i * 8));
+	} else if (IS_I965G(dev)) {
 		for (i = 0; i < 16; i++)
 			dev_priv->saveFENCE[i] = I915_READ64(FENCE_REG_965_0 + (i * 8));
 	} else {
@@ -815,7 +818,10 @@ int i915_restore_state(struct drm_device *dev)
 	I915_WRITE(HWS_PGA, dev_priv->saveHWS);
 
 	/* Fences */
-	if (IS_I965G(dev)) {
+	if (IS_GEN6(dev)) {
+		for (i = 0; i < 16; i++)
+			I915_WRITE64(FENCE_REG_SANDYBRIDGE_0 + (i * 8), dev_priv->saveFENCE[i]);
+	} else if (IS_I965G(dev)) {
 		for (i = 0; i < 16; i++)
 			I915_WRITE64(FENCE_REG_965_0 + (i * 8), dev_priv->saveFENCE[i]);
 	} else {
-- 
1.7.2.2

             reply	other threads:[~2010-09-16  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16  8:34 Yuanhan Liu [this message]
2010-09-16  8:39 ` [PATCH][v2] drm/1915: save the right fence registers for Sandybridge Geir Ove Myhr
2010-09-16  8:50   ` Liu, Yuanhan

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=1284626063-11395-1-git-send-email-yuanhan.liu@intel.com \
    --to=yuanhan.liu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=stable@kernel.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.