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_enable_sw_signaling(f); in sanitycheck()
107 dma_fence_signal(f); in sanitycheck()
108 dma_fence_put(f); in sanitycheck()
115 struct dma_fence *f; in test_signaling() local
118 f = mock_fence(); in test_signaling()
119 if (!f) in test_signaling()
122 dma_fence_enable_sw_signaling(f); in test_signaling()
124 if (dma_fence_is_signaled(f)) { in test_signaling()
129 if (dma_fence_signal(f)) { in test_signaling()
134 if (!dma_fence_is_signaled(f)) { in test_signaling()
139 if (!dma_fence_signal(f)) { in test_signaling()
146 dma_fence_put(f); in test_signaling()
155 static void simple_callback(struct dma_fence *f, struct dma_fence_cb *cb) in simple_callback() argument
163 struct dma_fence *f; in test_add_callback() local
166 f = mock_fence(); in test_add_callback()
167 if (!f) in test_add_callback()
170 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_add_callback()
175 dma_fence_signal(f); in test_add_callback()
183 dma_fence_put(f); in test_add_callback()
190 struct dma_fence *f; in test_late_add_callback() local
193 f = mock_fence(); in test_late_add_callback()
194 if (!f) in test_late_add_callback()
197 dma_fence_enable_sw_signaling(f); in test_late_add_callback()
199 dma_fence_signal(f); in test_late_add_callback()
201 if (!dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_late_add_callback()
206 dma_fence_signal(f); in test_late_add_callback()
214 dma_fence_put(f); in test_late_add_callback()
221 struct dma_fence *f; in test_rm_callback() local
224 f = mock_fence(); in test_rm_callback()
225 if (!f) in test_rm_callback()
228 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_rm_callback()
233 if (!dma_fence_remove_callback(f, &cb.cb)) { in test_rm_callback()
238 dma_fence_signal(f); in test_rm_callback()
246 dma_fence_put(f); in test_rm_callback()
253 struct dma_fence *f; in test_late_rm_callback() local
256 f = mock_fence(); in test_late_rm_callback()
257 if (!f) in test_late_rm_callback()
260 if (dma_fence_add_callback(f, &cb.cb, simple_callback)) { in test_late_rm_callback()
265 dma_fence_signal(f); in test_late_rm_callback()
271 if (dma_fence_remove_callback(f, &cb.cb)) { in test_late_rm_callback()
278 dma_fence_put(f); in test_late_rm_callback()
284 struct dma_fence *f; in test_status() local
287 f = mock_fence(); in test_status()
288 if (!f) in test_status()
291 dma_fence_enable_sw_signaling(f); in test_status()
293 if (dma_fence_get_status(f)) { in test_status()
298 dma_fence_signal(f); in test_status()
299 if (!dma_fence_get_status(f)) { in test_status()
306 dma_fence_put(f); in test_status()
312 struct dma_fence *f; in test_error() local
315 f = mock_fence(); in test_error()
316 if (!f) in test_error()
319 dma_fence_enable_sw_signaling(f); in test_error()
321 dma_fence_set_error(f, -EIO); in test_error()
323 if (dma_fence_get_status(f)) { in test_error()
328 dma_fence_signal(f); in test_error()
329 if (dma_fence_get_status(f) != -EIO) { in test_error()
331 dma_fence_get_status(f)); in test_error()
337 dma_fence_put(f); in test_error()
343 struct dma_fence *f; in test_wait() local
346 f = mock_fence(); in test_wait()
347 if (!f) in test_wait()
350 dma_fence_enable_sw_signaling(f); in test_wait()
352 if (dma_fence_wait_timeout(f, false, 0) != -ETIME) { in test_wait()
357 dma_fence_signal(f); in test_wait()
359 if (dma_fence_wait_timeout(f, false, 0) != 0) { in test_wait()
366 dma_fence_signal(f); in test_wait()
367 dma_fence_put(f); in test_wait()
373 struct dma_fence *f; member
380 dma_fence_signal(wt->f); in wait_timer()
390 wt.f = mock_fence(); in test_wait_timeout()
391 if (!wt.f) in test_wait_timeout()
394 dma_fence_enable_sw_signaling(wt.f); in test_wait_timeout()
396 if (dma_fence_wait_timeout(wt.f, false, 1) != -ETIME) { in test_wait_timeout()
403 if (dma_fence_wait_timeout(wt.f, false, 2) == -ETIME) { in test_wait_timeout()
417 dma_fence_signal(wt.f); in test_wait_timeout()
418 dma_fence_put(wt.f); in test_wait_timeout()
424 struct dma_fence *f[64]; in test_stub() local
428 for (i = 0; i < ARRAY_SIZE(f); i++) { in test_stub()
429 f[i] = dma_fence_get_stub(); in test_stub()
430 if (!dma_fence_is_signaled(f[i])) { in test_stub()
439 dma_fence_put(f[i]); in test_stub()
452 static void __wait_for_callbacks(struct dma_fence *f) in __wait_for_callbacks() argument
454 spin_lock_irq(f->lock); in __wait_for_callbacks()
455 spin_unlock_irq(f->lock); in __wait_for_callbacks()
529 struct dma_fence __rcu *f[2] = {}; in race_signal_callback() local
538 t[i].fences = f; in race_signal_callback()