All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lutomirski <luto@mit.edu>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.sf.net
Subject: Re: [resend] i915: high power consumption after suspend/resume
Date: Tue, 10 Nov 2009 09:42:52 -0500	[thread overview]
Message-ID: <cb0375e10911100642p348cc701la840e0b39aa8615f@mail.gmail.com> (raw)
In-Reply-To: <20091106135722.5abfdd03@jbarnes-piketon>

Just to confuse matters further, the following patch does *not* help.
Even with this patch applied, power consumption often goes high when
resuming, and writing 1 to i915_wedged after fully resuming fixes it.

I now officially have no clue what's going on.  Maybe there's
something wrong with the i915 resume code that increases power
consumption.

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 7f436ec..71472a9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -99,11 +99,28 @@ static int i915_resume(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int ret = 0;
+	u8 gdrst;
+	unsigned long timeout;
+

 	if (pci_enable_device(dev->pdev))
 		return -1;
 	pci_set_master(dev->pdev);

+	pci_read_config_byte(dev->pdev, GDRST, &gdrst);
+	pci_write_config_byte(dev->pdev, GDRST, gdrst | GDRST_RENDER);
+	udelay(50);
+	//pci_write_config_byte(dev->pdev, GDRST, gdrst & 0xfe);
+	
+	/* ...we don't want to loop forever though, 500ms should be plenty */
+	timeout = jiffies + msecs_to_jiffies(500);
+	do {
+		udelay(100);
+		pci_read_config_byte(dev->pdev, GDRST, &gdrst);
+	} while ((gdrst & 0x1) && time_after(timeout, jiffies));
+	printk(KERN_INFO "i915: Reset on resume took %d ms\n",
+	       jiffies_to_msecs(jiffies - timeout + msecs_to_jiffies(500)));
+
 	i915_restore_state(dev);

 	intel_opregion_init(dev, 1);

--Andy

      reply	other threads:[~2009-11-10 14:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-03 16:39 i915: high power consumption after suspend/resume Andrew Lutomirski
2009-10-03 16:50 ` [resend] " Andrew Lutomirski
2009-10-05 16:21   ` Jesse Barnes
2009-10-08  3:44     ` Andrew Lutomirski
2009-10-29 16:47       ` Jesse Barnes
2009-10-29 17:22         ` Andrew Lutomirski
2009-10-29 17:40           ` Andrew Lutomirski
2009-10-30  6:25             ` Andrew Lutomirski
2009-10-30 15:37               ` Jesse Barnes
2009-10-30 18:55                 ` Andrew Lutomirski
2009-11-05  4:00                   ` Andrew Lutomirski
2009-11-05 16:28                     ` Jesse Barnes
2009-11-06 20:25                       ` Andrew Lutomirski
2009-11-06 21:57                         ` Jesse Barnes
2009-11-10 14:42                           ` Andrew Lutomirski [this message]

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=cb0375e10911100642p348cc701la840e0b39aa8615f@mail.gmail.com \
    --to=luto@mit.edu \
    --cc=dri-devel@lists.sf.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.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.