drm/i915: Rename intel_timeline.sync_seqno[] to .global_sync[]
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 May 2017 09:39:22 +0000 (10:39 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 May 2017 10:08:52 +0000 (11:08 +0100)
With the addition of the inter-context intel_time.sync map, having a
very similar sync_seqno[] is confusing. Aide the reader by denoting that
this is a pre-allocated array for storing semaphore sync points wrt to
the global seqno.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170503093924.5320-5-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_request.c
drivers/gpu/drm/i915/i915_gem_timeline.h

index 637b8cddf988830edf97ca9ee3041264a976927f..b6246b50e375b3e5eb65b7113788570161a56340 100644 (file)
@@ -218,8 +218,8 @@ static int reset_all_global_seqno(struct drm_i915_private *i915, u32 seqno)
                tl->seqno = seqno;
 
                list_for_each_entry(timeline, &i915->gt.timelines, link)
-                       memset(timeline->engine[id].sync_seqno, 0,
-                              sizeof(timeline->engine[id].sync_seqno));
+                       memset(timeline->engine[id].global_sync, 0,
+                              sizeof(timeline->engine[id].global_sync));
        }
 
        return 0;
@@ -715,7 +715,7 @@ i915_gem_request_await_request(struct drm_i915_gem_request *to,
                return ret < 0 ? ret : 0;
        }
 
-       if (seqno <= to->timeline->sync_seqno[from->engine->id])
+       if (seqno <= to->timeline->global_sync[from->engine->id])
                return 0;
 
        trace_i915_gem_ring_sync_to(to, from);
@@ -733,7 +733,7 @@ i915_gem_request_await_request(struct drm_i915_gem_request *to,
                        return ret;
        }
 
-       to->timeline->sync_seqno[from->engine->id] = seqno;
+       to->timeline->global_sync[from->engine->id] = seqno;
        return 0;
 }
 
index ff65c648407faaba8d17d643d994867dc3080169..bfb5eb94c64d0eadacfa48a999110a0f96cdbed9 100644 (file)
@@ -68,7 +68,14 @@ struct intel_timeline {
         * redundant and we can discard it without loss of generality.
         */
        struct i915_syncmap *sync;
-       u32 sync_seqno[I915_NUM_ENGINES];
+       /**
+        * Separately to the inter-context seqno map above, we track the last
+        * barrier (e.g. semaphore wait) to the global engine timelines. Note
+        * that this tracks global_seqno rather than the context.seqno, and
+        * so it is subject to the limitations of hw wraparound and that we
+        * may need to revoke global_seqno (on pre-emption).
+        */
+       u32 global_sync[I915_NUM_ENGINES];
 
        struct i915_gem_timeline *common;
 };