• Home
  • Raw
  • Download

Lines Matching refs:fence

38 static inline void debug_fence_init(struct i915_sw_fence *fence)  in debug_fence_init()  argument
40 debug_object_init(fence, &i915_sw_fence_debug_descr); in debug_fence_init()
43 static inline void debug_fence_activate(struct i915_sw_fence *fence) in debug_fence_activate() argument
45 debug_object_activate(fence, &i915_sw_fence_debug_descr); in debug_fence_activate()
48 static inline void debug_fence_set_state(struct i915_sw_fence *fence, in debug_fence_set_state() argument
51 debug_object_active_state(fence, &i915_sw_fence_debug_descr, old, new); in debug_fence_set_state()
54 static inline void debug_fence_deactivate(struct i915_sw_fence *fence) in debug_fence_deactivate() argument
56 debug_object_deactivate(fence, &i915_sw_fence_debug_descr); in debug_fence_deactivate()
59 static inline void debug_fence_destroy(struct i915_sw_fence *fence) in debug_fence_destroy() argument
61 debug_object_destroy(fence, &i915_sw_fence_debug_descr); in debug_fence_destroy()
64 static inline void debug_fence_free(struct i915_sw_fence *fence) in debug_fence_free() argument
66 debug_object_free(fence, &i915_sw_fence_debug_descr); in debug_fence_free()
70 static inline void debug_fence_assert(struct i915_sw_fence *fence) in debug_fence_assert() argument
72 debug_object_assert_init(fence, &i915_sw_fence_debug_descr); in debug_fence_assert()
77 static inline void debug_fence_init(struct i915_sw_fence *fence) in debug_fence_init() argument
81 static inline void debug_fence_activate(struct i915_sw_fence *fence) in debug_fence_activate() argument
85 static inline void debug_fence_set_state(struct i915_sw_fence *fence, in debug_fence_set_state() argument
90 static inline void debug_fence_deactivate(struct i915_sw_fence *fence) in debug_fence_deactivate() argument
94 static inline void debug_fence_destroy(struct i915_sw_fence *fence) in debug_fence_destroy() argument
98 static inline void debug_fence_free(struct i915_sw_fence *fence) in debug_fence_free() argument
102 static inline void debug_fence_assert(struct i915_sw_fence *fence) in debug_fence_assert() argument
108 static int __i915_sw_fence_notify(struct i915_sw_fence *fence, in __i915_sw_fence_notify() argument
113 fn = (i915_sw_fence_notify_t)(fence->flags & I915_SW_FENCE_MASK); in __i915_sw_fence_notify()
114 return fn(fence, state); in __i915_sw_fence_notify()
118 void i915_sw_fence_fini(struct i915_sw_fence *fence) in i915_sw_fence_fini() argument
120 debug_fence_free(fence); in i915_sw_fence_fini()
124 static void __i915_sw_fence_wake_up_all(struct i915_sw_fence *fence, in __i915_sw_fence_wake_up_all() argument
127 wait_queue_head_t *x = &fence->wait; in __i915_sw_fence_wake_up_all()
131 debug_fence_deactivate(fence); in __i915_sw_fence_wake_up_all()
132 atomic_set_release(&fence->pending, -1); /* 0 -> -1 [done] */ in __i915_sw_fence_wake_up_all()
164 debug_fence_assert(fence); in __i915_sw_fence_wake_up_all()
167 static void __i915_sw_fence_complete(struct i915_sw_fence *fence, in __i915_sw_fence_complete() argument
170 debug_fence_assert(fence); in __i915_sw_fence_complete()
172 if (!atomic_dec_and_test(&fence->pending)) in __i915_sw_fence_complete()
175 debug_fence_set_state(fence, DEBUG_FENCE_IDLE, DEBUG_FENCE_NOTIFY); in __i915_sw_fence_complete()
177 if (__i915_sw_fence_notify(fence, FENCE_COMPLETE) != NOTIFY_DONE) in __i915_sw_fence_complete()
180 debug_fence_set_state(fence, DEBUG_FENCE_NOTIFY, DEBUG_FENCE_IDLE); in __i915_sw_fence_complete()
182 __i915_sw_fence_wake_up_all(fence, continuation); in __i915_sw_fence_complete()
184 debug_fence_destroy(fence); in __i915_sw_fence_complete()
185 __i915_sw_fence_notify(fence, FENCE_FREE); in __i915_sw_fence_complete()
188 static void i915_sw_fence_complete(struct i915_sw_fence *fence) in i915_sw_fence_complete() argument
190 debug_fence_assert(fence); in i915_sw_fence_complete()
192 if (WARN_ON(i915_sw_fence_done(fence))) in i915_sw_fence_complete()
195 __i915_sw_fence_complete(fence, NULL); in i915_sw_fence_complete()
198 static void i915_sw_fence_await(struct i915_sw_fence *fence) in i915_sw_fence_await() argument
200 debug_fence_assert(fence); in i915_sw_fence_await()
201 WARN_ON(atomic_inc_return(&fence->pending) <= 1); in i915_sw_fence_await()
204 void __i915_sw_fence_init(struct i915_sw_fence *fence, in __i915_sw_fence_init() argument
211 debug_fence_init(fence); in __i915_sw_fence_init()
213 __init_waitqueue_head(&fence->wait, name, key); in __i915_sw_fence_init()
214 atomic_set(&fence->pending, 1); in __i915_sw_fence_init()
215 fence->flags = (unsigned long)fn; in __i915_sw_fence_init()
218 void i915_sw_fence_commit(struct i915_sw_fence *fence) in i915_sw_fence_commit() argument
220 debug_fence_activate(fence); in i915_sw_fence_commit()
221 i915_sw_fence_complete(fence); in i915_sw_fence_commit()
234 static bool __i915_sw_fence_check_if_after(struct i915_sw_fence *fence, in __i915_sw_fence_check_if_after() argument
239 if (__test_and_set_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags)) in __i915_sw_fence_check_if_after()
242 if (fence == signaler) in __i915_sw_fence_check_if_after()
245 list_for_each_entry(wq, &fence->wait.head, entry) { in __i915_sw_fence_check_if_after()
256 static void __i915_sw_fence_clear_checked_bit(struct i915_sw_fence *fence) in __i915_sw_fence_clear_checked_bit() argument
260 if (!__test_and_clear_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags)) in __i915_sw_fence_clear_checked_bit()
263 list_for_each_entry(wq, &fence->wait.head, entry) { in __i915_sw_fence_clear_checked_bit()
271 static bool i915_sw_fence_check_if_after(struct i915_sw_fence *fence, in i915_sw_fence_check_if_after() argument
281 err = __i915_sw_fence_check_if_after(fence, signaler); in i915_sw_fence_check_if_after()
282 __i915_sw_fence_clear_checked_bit(fence); in i915_sw_fence_check_if_after()
288 static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, in __i915_sw_fence_await_sw_fence() argument
295 debug_fence_assert(fence); in __i915_sw_fence_await_sw_fence()
303 if (unlikely(i915_sw_fence_check_if_after(fence, signaler))) in __i915_sw_fence_await_sw_fence()
323 wq->private = fence; in __i915_sw_fence_await_sw_fence()
325 i915_sw_fence_await(fence); in __i915_sw_fence_await_sw_fence()
340 int i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, in i915_sw_fence_await_sw_fence() argument
344 return __i915_sw_fence_await_sw_fence(fence, signaler, wq, 0); in i915_sw_fence_await_sw_fence()
347 int i915_sw_fence_await_sw_fence_gfp(struct i915_sw_fence *fence, in i915_sw_fence_await_sw_fence_gfp() argument
351 return __i915_sw_fence_await_sw_fence(fence, signaler, NULL, gfp); in i915_sw_fence_await_sw_fence_gfp()
356 struct i915_sw_fence *fence; member
372 i915_sw_fence_complete(cb->fence); in timer_i915_sw_fence_wake()
383 i915_sw_fence_complete(cb->fence); in dma_i915_sw_fence_wake()
389 int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence, in i915_sw_fence_await_dma_fence() argument
397 debug_fence_assert(fence); in i915_sw_fence_await_dma_fence()
410 cb->fence = fence; in i915_sw_fence_await_dma_fence()
411 i915_sw_fence_await(fence); in i915_sw_fence_await_dma_fence()
434 int i915_sw_fence_await_reservation(struct i915_sw_fence *fence, in i915_sw_fence_await_reservation() argument
444 debug_fence_assert(fence); in i915_sw_fence_await_reservation()
459 pending = i915_sw_fence_await_dma_fence(fence, in i915_sw_fence_await_reservation()
479 pending = i915_sw_fence_await_dma_fence(fence, in i915_sw_fence_await_reservation()