All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915: Always wake the device to flush the GTT
Date: Tue, 29 Aug 2017 11:33:07 +0100	[thread overview]
Message-ID: <20170829103307.15922-1-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20170828190042.2384-1-chris@chris-wilson.co.uk>

Since we hold the device wakeref when writing through the GTT (otherwise
the writes would fail), we presumed that before the device sleeps those
writes would naturally be flushed and that we wouldn't need our mmio
read trick. However, that presumption seems false and a sleepy bxt seems
to require us to always manually flush the GTT writes prior to direct
access.

Fixes: e2a2aa36a509 ("drm/i915: Check we have an wake device before flushing GTT writes")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 43834dee4e8d..890fe2802973 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -695,12 +695,11 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)
 	switch (obj->base.write_domain) {
 	case I915_GEM_DOMAIN_GTT:
 		if (INTEL_GEN(dev_priv) >= 6 && !HAS_LLC(dev_priv)) {
-			if (intel_runtime_pm_get_if_in_use(dev_priv)) {
-				spin_lock_irq(&dev_priv->uncore.lock);
-				POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base));
-				spin_unlock_irq(&dev_priv->uncore.lock);
-				intel_runtime_pm_put(dev_priv);
-			}
+			intel_runtime_pm_get(dev_priv);
+			spin_lock_irq(&dev_priv->uncore.lock);
+			POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base));
+			spin_unlock_irq(&dev_priv->uncore.lock);
+			intel_runtime_pm_put(dev_priv);
 		}
 
 		intel_fb_obj_flush(obj,
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-08-29 10:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 19:00 [PATCH] drm/i915: Always wake the device to flush the GTT Chris Wilson
2017-08-28 19:21 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-28 20:15 ` ✓ Fi.CI.IGT: " Patchwork
2017-08-29  9:59   ` Chris Wilson
2017-08-29 10:23     ` Saarinen, Jani
2017-08-29 10:33 ` Chris Wilson [this message]
2017-08-29 14:54   ` [PATCH] " Joonas Lahtinen
2017-08-29 14:59     ` Chris Wilson
2017-08-30 12:23       ` Daniel Vetter
2017-08-30 12:56         ` Chris Wilson
2017-08-30 12:59           ` Chris Wilson
2017-08-30 13:12           ` Chris Wilson
2017-08-30 13:59           ` Daniel Vetter
2017-08-30 15:13             ` Chris Wilson
2017-08-31  8:08               ` Daniel Vetter
2017-08-29 19:25   ` [Resend for flip-flops] " Chris Wilson
2017-08-30  8:13     ` Chris Wilson
2017-08-29 10:55 ` ✗ Fi.CI.BAT: warning for drm/i915: Always wake the device to flush the GTT (rev2) Patchwork
2017-08-29 15:43 ` [PATCH] drm/i915: Flush indirect GTT writes upon runtime-suspend Chris Wilson
2017-08-29 16:09 ` ✓ Fi.CI.BAT: success for drm/i915: Always wake the device to flush the GTT (rev3) Patchwork
2017-08-29 18:50 ` ✓ Fi.CI.IGT: " Patchwork
2017-08-29 19:21   ` Chris Wilson
2017-08-29 19:24     ` Chris Wilson
2017-08-29 19:43 ` ✓ Fi.CI.BAT: success for drm/i915: Always wake the device to flush the GTT (rev4) Patchwork
2017-08-29 23:13 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20170829103307.15922-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --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.