All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects
@ 2016-11-14  8:54 Chris Wilson
  2016-11-14  8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
  2016-11-14 10:17 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2016-11-14  8:54 UTC (permalink / raw)
  To: intel-gfx

Generalise the skip for physical and stolen objects by skipping anything
we do not have a valid address inside the sg.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5afa3ea29ce7..4931bfcff2a2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2963,14 +2963,19 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
 	 * to GPU, and we can ignore the cache flush because it'll happen
 	 * again at bind time.
 	 */
-	if (!obj->mm.pages)
+	if (!obj->mm.pages) {
+		GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU);
 		return;
+	}
 
 	/*
 	 * Stolen memory is always coherent with the GPU as it is explicitly
 	 * marked as wc by the system, or the system is cache-coherent.
+	 * Similarly, we only access struct pages through the CPU cache, so
+	 * anything not backed by physical memory we consider to be always
+	 * coherent and not need clflushing.
 	 */
-	if (obj->stolen || obj->phys_handle)
+	if (!i915_gem_object_has_struct_page(obj))
 		return;
 
 	/* If the GPU is snooping the contents of the CPU cache,
-- 
2.10.2

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

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

end of thread, other threads:[~2016-11-14 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14  8:54 [PATCH 1/2] drm/i915: Skip clflushes for all non-page backed objects Chris Wilson
2016-11-14  8:54 ` [PATCH 2/2] drm/i915: Skip final clflush if LLC is coherent Chris Wilson
2016-11-14 13:57   ` Ville Syrjälä
2016-11-14 10:17 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] drm/i915: Skip clflushes for all non-page backed objects Patchwork

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.