Commit 0168bdfc authored by Chris Wilson's avatar Chris Wilson Committed by Rodrigo Vivi

drm/i915: Always wake the device to flush the GTT

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: e2a2aa36 ("drm/i915: Check we have an wake device before flushing GTT writes")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170829192546.1087-1-chris@chris-wilson.co.uk
(cherry picked from commit b69a784f)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 3b24e7e8
...@@ -695,13 +695,12 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains) ...@@ -695,13 +695,12 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)
switch (obj->base.write_domain) { switch (obj->base.write_domain) {
case I915_GEM_DOMAIN_GTT: case I915_GEM_DOMAIN_GTT:
if (INTEL_GEN(dev_priv) >= 6 && !HAS_LLC(dev_priv)) { if (INTEL_GEN(dev_priv) >= 6 && !HAS_LLC(dev_priv)) {
if (intel_runtime_pm_get_if_in_use(dev_priv)) { intel_runtime_pm_get(dev_priv);
spin_lock_irq(&dev_priv->uncore.lock); spin_lock_irq(&dev_priv->uncore.lock);
POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base)); POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base));
spin_unlock_irq(&dev_priv->uncore.lock); spin_unlock_irq(&dev_priv->uncore.lock);
intel_runtime_pm_put(dev_priv); intel_runtime_pm_put(dev_priv);
} }
}
intel_fb_obj_flush(obj, intel_fb_obj_flush(obj,
fb_write_origin(obj, I915_GEM_DOMAIN_GTT)); fb_write_origin(obj, I915_GEM_DOMAIN_GTT));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment