stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Mark CPU cache as dirty when used for rendering
@ 2016-11-07 15:46 Chris Wilson
  2016-11-07 16:35 ` Ville Syrjälä
  2016-11-07 16:52 ` [PATCH v2] " Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2016-11-07 15:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson, Jani Nikula, Ville Syrjälä, # v4 . 0+

On LLC, or even snooped, machines rendering via the GPU ends up in the CPU
cache. This cacheline dirt also needs to be flushed to main memory when
moving to an incoherent domain, such as the display's scanout engine.
Mostly, this happens because either the object is marked as dirty from
its first use or is avoided by setting the object into the display
domain from the start.

Fixes: 0f71979ab7fb ("drm/i915: Performed deferred clflush inside set-cache-level")
References: https://bugs.freedesktop.org/show_bug.cgi?id=95414
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.0+
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 30f6eb516ca3..30b684fecf09 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1282,6 +1282,7 @@ void i915_vma_move_to_active(struct i915_vma *vma,
 
 		/* update for the implicit flush after a batch */
 		obj->base.write_domain &= ~I915_GEM_GPU_DOMAINS;
+		obj->cache_dirty |= obj->cache_level != I915_CACHE_NONE;
 	}
 
 	if (flags & EXEC_OBJECT_NEEDS_FENCE)
-- 
2.10.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-07 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07 15:46 [PATCH] drm/i915: Mark CPU cache as dirty when used for rendering Chris Wilson
2016-11-07 16:35 ` Ville Syrjälä
2016-11-07 16:52 ` [PATCH v2] " Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).