Lines Matching full:active
19 * Active refs memory management
22 * they idle (when we know the active requests are inactive) and allocate the
40 node_from_active(struct i915_active_fence *active) in node_from_active() argument
42 return container_of(active, struct active_node, base); in node_from_active()
47 static inline bool is_barrier(const struct i915_active_fence *active) in is_barrier() argument
49 return IS_ERR(rcu_access_pointer(active->fence)); in is_barrier()
83 return (void *)ref->active ?: (void *)ref->retire ?: (void *)ref; in active_debug_hint()
209 __active_fence_slot(struct i915_active_fence *active) in __active_fence_slot() argument
211 return (struct dma_fence ** __force)&active->fence; in __active_fence_slot()
217 struct i915_active_fence *active = in active_fence_cb() local
218 container_of(cb, typeof(*active), cb); in active_fence_cb()
220 return cmpxchg(__active_fence_slot(active), fence, NULL) == fence; in active_fence_cb()
276 /* While active, the tree can only be built; not destroyed */ in __active_lookup()
346 int (*active)(struct i915_active *ref), in __i915_active_init()
356 ref->active = active; in __i915_active_init()
424 replace_barrier(struct i915_active *ref, struct i915_active_fence *active) in replace_barrier() argument
426 if (!is_barrier(active)) /* proto-node used by our idle barrier? */ in replace_barrier()
434 return __active_del_barrier(ref, node_from_active(active)); in replace_barrier()
439 struct i915_active_fence *active; in i915_active_ref() local
448 active = active_instance(ref, idx); in i915_active_ref()
449 if (!active) { in i915_active_ref()
454 if (replace_barrier(ref, active)) { in i915_active_ref()
455 RCU_INIT_POINTER(active->fence, NULL); in i915_active_ref()
458 } while (unlikely(is_barrier(active))); in i915_active_ref()
460 if (!__i915_active_fence_set(active, fence)) in i915_active_ref()
470 struct i915_active_fence *active, in __i915_active_set_fence() argument
475 if (replace_barrier(ref, active)) { in __i915_active_set_fence()
476 RCU_INIT_POINTER(active->fence, fence); in __i915_active_set_fence()
481 prev = __i915_active_fence_set(active, fence); in __i915_active_set_fence()
510 /* Only valid while active, see i915_active_acquire_for_context() */ in __i915_active_ref()
542 if (!ref->active) { in i915_active_acquire()
552 err = ref->active(ref); in i915_active_acquire()
564 struct i915_active_fence *active; in i915_active_acquire_for_context() local
571 active = active_instance(ref, idx); in i915_active_acquire_for_context()
572 if (!active) { in i915_active_acquire_for_context()
577 return 0; /* return with active ref */ in i915_active_acquire_for_context()
586 static void enable_signaling(struct i915_active_fence *active) in enable_signaling() argument
590 if (unlikely(is_barrier(active))) in enable_signaling()
593 fence = i915_active_fence_get(active); in enable_signaling()
652 * After the wait is complete, the caller may free the active. in __i915_active_wait()
659 static int __await_active(struct i915_active_fence *active, in __await_active() argument
665 if (is_barrier(active)) /* XXX flush the barrier? */ in __await_active()
668 fence = i915_active_fence_get(active); in __await_active()
817 * i915_active, due to overlapping active phases there is likely a in reuse_idle_barrier()
1047 * __i915_active_fence_set: Update the last active fence along its timeline
1048 * @active: the active tracker
1051 * Records the new @fence as the last active fence along its timeline in
1052 * this active tracker, moving the tracking callbacks from the previous
1059 __i915_active_fence_set(struct i915_active_fence *active, in __i915_active_fence_set() argument
1065 if (fence == rcu_access_pointer(active->fence)) in __i915_active_fence_set()
1072 * C already resident as the active->fence. in __i915_active_fence_set()
1091 prev = xchg(__active_fence_slot(active), fence); in __i915_active_fence_set()
1095 __list_del_entry(&active->cb.node); in __i915_active_fence_set()
1098 list_add_tail(&active->cb.node, &fence->cb_list); in __i915_active_fence_set()
1104 int i915_active_fence_set(struct i915_active_fence *active, in i915_active_fence_set() argument
1110 /* Must maintain timeline ordering wrt previous active requests */ in i915_active_fence_set()
1112 fence = __i915_active_fence_set(active, &rq->fence); in i915_active_fence_set()