All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/9] drm/i915: Mark up clflushes as belonging to an unordered timeline
@ 2017-04-12 12:48 Chris Wilson
  2017-04-12 12:48 ` [PATCH v2 2/9] drm/i915: Lift timeline ordering to await_dma_fence Chris Wilson
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Chris Wilson @ 2017-04-12 12:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

2 clflushes on two different objects are not ordered, and so do not
belong to the same timeline (context). Either we use a unique context
for each, or we reserve a special global context to mean unordered.
Ideally, we would reserve 0 to mean unordered (DMA_FENCE_NO_CONTEXT) to
have the same semantics everywhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h         | 2 ++
 drivers/gpu/drm/i915/i915_gem.c         | 2 +-
 drivers/gpu/drm/i915/i915_gem_clflush.c | 8 +-------
 drivers/gpu/drm/i915/i915_gem_clflush.h | 1 -
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 1af4e6f5410c..9ff399fdf92b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1511,6 +1511,8 @@ struct i915_gem_mm {
 	/** LRU list of objects with fence regs on them. */
 	struct list_head fence_list;
 
+	u64 unordered_timeline;
+
 	/* the indicator for dispatch video commands on two BSD rings */
 	atomic_t bsd_engine_dispatch_index;
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 33fb11cc5acc..68c0a1c3bf77 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4746,7 +4746,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
 
 	mutex_lock(&dev_priv->drm.struct_mutex);
 
-	i915_gem_clflush_init(dev_priv);
+	dev_priv->mm.unordered_timeline = dma_fence_context_alloc(1);
 
 	if (!i915.enable_execlists) {
 		dev_priv->gt.resume = intel_legacy_submission_resume;
diff --git a/drivers/gpu/drm/i915/i915_gem_clflush.c b/drivers/gpu/drm/i915/i915_gem_clflush.c
index ffd01e02fe94..ffac7a1f0caf 100644
--- a/drivers/gpu/drm/i915/i915_gem_clflush.c
+++ b/drivers/gpu/drm/i915/i915_gem_clflush.c
@@ -27,7 +27,6 @@
 #include "i915_gem_clflush.h"
 
 static DEFINE_SPINLOCK(clflush_lock);
-static u64 clflush_context;
 
 struct clflush {
 	struct dma_fence dma; /* Must be first for dma_fence_free() */
@@ -157,7 +156,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
 		dma_fence_init(&clflush->dma,
 			       &i915_clflush_ops,
 			       &clflush_lock,
-			       clflush_context,
+			       to_i915(obj->base.dev)->mm.unordered_timeline,
 			       0);
 		i915_sw_fence_init(&clflush->wait, i915_clflush_notify);
 
@@ -182,8 +181,3 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
 		GEM_BUG_ON(obj->base.write_domain != I915_GEM_DOMAIN_CPU);
 	}
 }
-
-void i915_gem_clflush_init(struct drm_i915_private *i915)
-{
-	clflush_context = dma_fence_context_alloc(1);
-}
diff --git a/drivers/gpu/drm/i915/i915_gem_clflush.h b/drivers/gpu/drm/i915/i915_gem_clflush.h
index b62d61a2d15f..2455a7820937 100644
--- a/drivers/gpu/drm/i915/i915_gem_clflush.h
+++ b/drivers/gpu/drm/i915/i915_gem_clflush.h
@@ -28,7 +28,6 @@
 struct drm_i915_private;
 struct drm_i915_gem_object;
 
-void i915_gem_clflush_init(struct drm_i915_private *i915);
 void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
 			     unsigned int flags);
 #define I915_CLFLUSH_FORCE BIT(0)
-- 
2.11.0

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

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

end of thread, other threads:[~2017-04-13 10:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12 12:48 [PATCH v2 1/9] drm/i915: Mark up clflushes as belonging to an unordered timeline Chris Wilson
2017-04-12 12:48 ` [PATCH v2 2/9] drm/i915: Lift timeline ordering to await_dma_fence Chris Wilson
2017-04-12 12:48 ` [PATCH v2 3/9] drm/i915: Make ptr_unpack_bits() more function-like Chris Wilson
2017-04-12 12:48 ` [PATCH v2 4/9] drm/i915: Redefine ptr_pack_bits() and friends Chris Wilson
2017-04-12 12:48 ` [PATCH v2 5/9] drm/i915: Squash repeated awaits on the same fence Chris Wilson
2017-04-12 14:24   ` [PATCH v3] " Chris Wilson
2017-04-12 15:39     ` [PATCH v4] " Chris Wilson
2017-04-12 12:48 ` [PATCH v2 6/9] drm/i915: Rename intel_timeline.sync_seqno[] to .global_sync[] Chris Wilson
2017-04-13 10:49   ` Joonas Lahtinen
2017-04-12 12:48 ` [PATCH v2 7/9] drm/i915: Confirm the request is still active before adding it to the await Chris Wilson
2017-04-12 16:31   ` Michał Winiarski
2017-04-13 10:46   ` Joonas Lahtinen
2017-04-12 12:48 ` [PATCH v2 8/9] drm/i915: Do not record a successful syncpoint for a dma-await Chris Wilson
2017-04-12 16:54   ` Michał Winiarski
2017-04-12 12:48 ` [PATCH v2 9/9] drm/i915: Switch the global i915.semaphores check to a local predicate Chris Wilson
2017-04-12 14:41   ` Joonas Lahtinen
2017-04-12 13:20 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/9] drm/i915: Mark up clflushes as belonging to an unordered timeline Patchwork
2017-04-12 15:01 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/9] drm/i915: Mark up clflushes as belonging to an unordered timeline (rev2) Patchwork
2017-04-12 17:00 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/9] drm/i915: Mark up clflushes as belonging to an unordered timeline (rev3) 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.