All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 1/3] drm/i915: clean up media reset on gm45
Date: Wed,  3 Jul 2013 10:07:56 +0200	[thread overview]
Message-ID: <1372838878-11153-1-git-send-email-daniel.vetter@ffwll.ch> (raw)

Originally I've thought that this fixes up the reset issues on my
gm45, but that was just a red herring due to b0rked testing.

Still I much prefer writing the right values (all other fields are
reserved) instead of potentially dragging gunk around. Hence also
clear the register to 0 after a reset.

v2: Stop claiming this fixes anything and return 0 if successful
instead of stack garbage.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 33cb973..ed9262c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -798,28 +798,29 @@ static int i965_reset_complete(struct drm_device *dev)
 static int i965_do_reset(struct drm_device *dev)
 {
 	int ret;
-	u8 gdrst;
 
 	/*
 	 * Set the domains we want to reset (GRDOM/bits 2 and 3) as
 	 * well as the reset bit (GR/bit 0).  Setting the GR bit
 	 * triggers the reset; when done, the hardware will clear it.
 	 */
-	pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
 	pci_write_config_byte(dev->pdev, I965_GDRST,
-			      gdrst | GRDOM_RENDER |
-			      GRDOM_RESET_ENABLE);
+			      GRDOM_RENDER | GRDOM_RESET_ENABLE);
 	ret =  wait_for(i965_reset_complete(dev), 500);
 	if (ret)
 		return ret;
 
 	/* We can't reset render&media without also resetting display ... */
-	pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
 	pci_write_config_byte(dev->pdev, I965_GDRST,
-			      gdrst | GRDOM_MEDIA |
-			      GRDOM_RESET_ENABLE);
+			      GRDOM_MEDIA | GRDOM_RESET_ENABLE);
 
-	return wait_for(i965_reset_complete(dev), 500);
+	ret =  wait_for(i965_reset_complete(dev), 500);
+	if (ret)
+		return ret;
+
+	pci_write_config_byte(dev->pdev, I965_GDRST, 0);
+
+	return 0;
 }
 
 static int ironlake_do_reset(struct drm_device *dev)
-- 
1.8.3.1

             reply	other threads:[~2013-07-03  8:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03  8:07 Daniel Vetter [this message]
2013-07-03  8:07 ` [PATCH 2/3] drm/i915: run the full gem hw init after a gpu reset Daniel Vetter
2013-07-03  8:43   ` Chris Wilson
2013-07-03  9:22     ` Daniel Vetter
2013-07-03 10:55     ` [PATCH] drm/i915: reinit status page registers after " Daniel Vetter
2013-07-03 10:56     ` Daniel Vetter
2013-07-03 11:13       ` Chris Wilson
2013-07-03 14:33         ` Daniel Vetter
2013-07-03  8:07 ` [PATCH 3/3] drm/i915: WARN if the bios reserved range is bigger than stolen size Daniel Vetter
2013-07-03  8:51   ` Chris Wilson
2013-07-03  8:22 ` [PATCH 1/3] drm/i915: clean up media reset on gm45 Chris Wilson
2013-07-03  8:36   ` Daniel Vetter
2013-07-03  8:40     ` Chris Wilson
2013-07-09 12:44       ` [PATCH 1/2] " Daniel Vetter
2013-07-09 12:44         ` [PATCH 2/2] drm/i915: WARN if the bios reserved range is bigger than stolen size Daniel Vetter
2013-07-09 13:56           ` Chris Wilson
2013-07-09 14:53             ` Daniel Vetter
2013-07-09 13:56         ` [PATCH 1/2] drm/i915: clean up media reset on gm45 Chris Wilson
2013-07-09 14:53           ` Daniel Vetter

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=1372838878-11153-1-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --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.