Lines Matching full:f
22 } *to_mock_fence(struct dma_fence *f) { in to_mock_fence() argument
23 return container_of(f, struct mock_fence, base); in to_mock_fence()
26 static const char *mock_name(struct dma_fence *f) in mock_name() argument
31 static void mock_fence_release(struct dma_fence *f) in mock_fence_release() argument
33 kmem_cache_free(slab_fences, to_mock_fence(f)); in mock_fence_release()
41 static void mock_wakeup(struct dma_fence *f, struct dma_fence_cb *cb) in mock_wakeup() argument
46 static long mock_wait(struct dma_fence *f, bool intr, long timeout) in mock_wait() argument
51 if (dma_fence_add_callback(f, &cb.cb, mock_wakeup)) in mock_wait()
57 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &f->flags)) in mock_wait()
67 if (!dma_fence_remove_callback(f, &cb.cb)) in mock_wait()
85 struct mock_fence *f; in mock_fence() local
87 f = kmem_cache_alloc(slab_fences, GFP_KERNEL); in mock_fence()
88 if (!f) in mock_fence()
91 spin_lock_init(&f->lock); in mock_fence()
92 dma_fence_init(&f->base, &mock_ops, &f->lock, 0, 0); in mock_fence()
94 return &f->base; in mock_fence()
99 struct dma_fence *f; in sanitycheck() local
101 f = mock_fence(); in sanitycheck()
102 if (!f) in sanitycheck()
105 dma_fence_signal(f); in sanitycheck()
106 dma_fence_put(f); in sanitycheck()
113 struct dma_fence *f; in test_signaling() local
116 f = mock_fence(); in test_signaling()
117 if (!f) in test_signaling()
120 if (dma_fence_is_signaled(f)) { in test_signaling()
125 if (dma_fence_signal(f)) { in test_signaling()
130 if (!dma_fence_is_signaled(f)) { in test_signaling()
135 if (!dma_fence_signal(f)) { in test_signaling()
142 dma_fence_put(f); in test_signaling()
151 static void simple_callback(struct dma_fence *f, struct dma_fence_cb *cb) in simple_callback() argument
159 struct dma_fence *f; in test_add_callback() local
162 f = mock_fence(); in test_add_callback()
163 if (!f) in test_add_callback()
166 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_add_callback()
171 dma_fence_signal(f); in test_add_callback()
179 dma_fence_put(f); in test_add_callback()
186 struct dma_fence *f; in test_late_add_callback() local
189 f = mock_fence(); in test_late_add_callback()
190 if (!f) in test_late_add_callback()
193 dma_fence_signal(f); in test_late_add_callback()
195 if (!dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_late_add_callback()
200 dma_fence_signal(f); in test_late_add_callback()
208 dma_fence_put(f); in test_late_add_callback()
215 struct dma_fence *f; in test_rm_callback() local
218 f = mock_fence(); in test_rm_callback()
219 if (!f) in test_rm_callback()
222 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_rm_callback()
227 if (!dma_fence_remove_callback(f, &cb.cb)) { in test_rm_callback()
232 dma_fence_signal(f); in test_rm_callback()
240 dma_fence_put(f); in test_rm_callback()
247 struct dma_fence *f; in test_late_rm_callback() local
250 f = mock_fence(); in test_late_rm_callback()
251 if (!f) in test_late_rm_callback()
254 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_late_rm_callback()
259 dma_fence_signal(f); in test_late_rm_callback()
265 if (dma_fence_remove_callback(f, &cb.cb)) { in test_late_rm_callback()
272 dma_fence_put(f); in test_late_rm_callback()
278 struct dma_fence *f; in test_status() local
281 f = mock_fence(); in test_status()
282 if (!f) in test_status()
285 if (dma_fence_get_status(f)) { in test_status()
290 dma_fence_signal(f); in test_status()
291 if (!dma_fence_get_status(f)) { in test_status()
298 dma_fence_put(f); in test_status()
304 struct dma_fence *f; in test_error() local
307 f = mock_fence(); in test_error()
308 if (!f) in test_error()
311 dma_fence_set_error(f, -EIO); in test_error()
313 if (dma_fence_get_status(f)) { in test_error()
318 dma_fence_signal(f); in test_error()
319 if (dma_fence_get_status(f) != -EIO) { in test_error()
321 dma_fence_get_status(f)); in test_error()
327 dma_fence_put(f); in test_error()
333 struct dma_fence *f; in test_wait() local
336 f = mock_fence(); in test_wait()
337 if (!f) in test_wait()
340 if (dma_fence_wait_timeout(f, false, 0) != -ETIME) { in test_wait()
345 dma_fence_signal(f); in test_wait()
347 if (dma_fence_wait_timeout(f, false, 0) != 0) { in test_wait()
354 dma_fence_signal(f); in test_wait()
355 dma_fence_put(f); in test_wait()
361 struct dma_fence *f; member
368 dma_fence_signal(wt->f); in wait_timer()
378 wt.f = mock_fence(); in test_wait_timeout()
379 if (!wt.f) in test_wait_timeout()
382 if (dma_fence_wait_timeout(wt.f, false, 1) != -ETIME) { in test_wait_timeout()
389 if (dma_fence_wait_timeout(wt.f, false, 2) == -ETIME) { in test_wait_timeout()
403 dma_fence_signal(wt.f); in test_wait_timeout()
404 dma_fence_put(wt.f); in test_wait_timeout()
410 struct dma_fence *f[64]; in test_stub() local
414 for (i = 0; i < ARRAY_SIZE(f); i++) { in test_stub()
415 f[i] = dma_fence_get_stub(); in test_stub()
416 if (!dma_fence_is_signaled(f[i])) { in test_stub()
425 dma_fence_put(f[i]); in test_stub()
438 static void __wait_for_callbacks(struct dma_fence *f) in __wait_for_callbacks() argument
440 spin_lock_irq(f->lock); in __wait_for_callbacks()
441 spin_unlock_irq(f->lock); in __wait_for_callbacks()
510 struct dma_fence __rcu *f[2] = {}; in race_signal_callback() local
519 t[i].fences = f; in race_signal_callback()