| /linux/drivers/dma-buf/ |
| H A D | dma-fence.c | 113 static const char *dma_fence_stub_get_name(struct dma_fence *fence) in dma_fence_stub_get_name() argument 153 struct dma_fence *fence; in dma_fence_allocate_private_stub() local 155 fence = kzalloc_obj(*fence); in dma_fence_allocate_private_stub() 156 if (fence == NULL) in dma_fence_allocate_private_stub() 159 dma_fence_init(fence, &dma_fence_stub_ops, NULL, 0, 0); in dma_fence_allocate_private_stub() 161 &fence->flags); in dma_fence_allocate_private_stub() 163 dma_fence_signal_timestamp(fence, timestamp); in dma_fence_allocate_private_stub() 165 return fence; in dma_fence_allocate_private_stub() 353 void dma_fence_signal_timestamp_locked(struct dma_fence *fence, in dma_fence_signal_timestamp_locked() argument 360 dma_fence_assert_held(fence); in dma_fence_signal_timestamp_locked() [all …]
|
| H A D | sync_file.c | 65 struct sync_file *sync_file_create(struct dma_fence *fence) in sync_file_create() argument 73 sync_file->fence = dma_fence_get(fence); in sync_file_create() 106 struct dma_fence *fence; in sync_file_get_fence() local 112 fence = dma_fence_get(sync_file->fence); in sync_file_get_fence() 115 return fence; in sync_file_get_fence() 137 struct dma_fence *fence = sync_file->fence; in sync_file_get_name() local 142 driver = dma_fence_driver_name(fence); in sync_file_get_name() 143 timeline = dma_fence_timeline_name(fence); in sync_file_get_name() 147 fence->context, in sync_file_get_name() 148 fence->seqno); in sync_file_get_name() [all …]
|
| H A D | st-dma-fence-chain.c | 62 struct dma_fence *fence, in mock_chain() argument 71 dma_fence_chain_init(f, dma_fence_get(prev), dma_fence_get(fence), in mock_chain() 182 struct dma_fence *fence; in find_seqno() local 190 fence = dma_fence_get(fc.tail); in find_seqno() 191 err = dma_fence_chain_find_seqno(&fence, 0); in find_seqno() 192 dma_fence_put(fence); in find_seqno() 199 fence = dma_fence_get(fc.tail); in find_seqno() 200 err = dma_fence_chain_find_seqno(&fence, i + 1); in find_seqno() 201 dma_fence_put(fence); in find_seqno() 207 if (fence != fc.chains[i]) { in find_seqno() [all …]
|
| H A D | st-dma-fence-unwrap.c | 85 struct dma_fence *fence) in mock_chain() argument 92 dma_fence_put(fence); in mock_chain() 96 dma_fence_chain_init(f, prev, fence, 1); in mock_chain() 125 struct dma_fence *fence, *f1, *f2, *array; in unwrap_array() local 147 dma_fence_unwrap_for_each(fence, &iter, array) { in unwrap_array() 148 if (fence == f1) { in unwrap_array() 150 } else if (fence == f2) { in unwrap_array() 169 struct dma_fence *fence, *f1, *f2, *chain; in unwrap_chain() local 191 dma_fence_unwrap_for_each(fence, &iter, chain) { in unwrap_chain() 192 if (fence == f1) { in unwrap_chain() [all …]
|
| /linux/drivers/gpu/drm/i915/ |
| H A D | i915_sw_fence.c | 49 static inline void debug_fence_init(struct i915_sw_fence *fence) in debug_fence_init() argument 51 debug_object_init(fence, &i915_sw_fence_debug_descr); in debug_fence_init() 54 static inline __maybe_unused void debug_fence_init_onstack(struct i915_sw_fence *fence) in debug_fence_init_onstack() argument 56 debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr); in debug_fence_init_onstack() 59 static inline void debug_fence_activate(struct i915_sw_fence *fence) in debug_fence_activate() argument 61 debug_object_activate(fence, &i915_sw_fence_debug_descr); in debug_fence_activate() 64 static inline void debug_fence_set_state(struct i915_sw_fence *fence, in debug_fence_set_state() argument 67 debug_object_active_state(fence, &i915_sw_fence_debug_descr, old, new); in debug_fence_set_state() 70 static inline void debug_fence_deactivate(struct i915_sw_fence *fence) in debug_fence_deactivate() argument 72 debug_object_deactivate(fence, &i915_sw_fence_debug_descr); in debug_fence_deactivate() [all …]
|
| H A D | i915_sw_fence.h | 42 void __i915_sw_fence_init(struct i915_sw_fence *fence, 47 #define i915_sw_fence_init(fence, fn) \ argument 52 __i915_sw_fence_init((fence), (fn), #fence, &__key); \ 55 #define i915_sw_fence_init(fence, fn) \ argument 58 __i915_sw_fence_init((fence), (fn), NULL, NULL); \ 62 void i915_sw_fence_reinit(struct i915_sw_fence *fence); 65 void i915_sw_fence_fini(struct i915_sw_fence *fence); 67 static inline void i915_sw_fence_fini(struct i915_sw_fence *fence) {} in i915_sw_fence_fini() argument 70 void i915_sw_fence_commit(struct i915_sw_fence *fence); 72 int i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence, [all …]
|
| H A D | i915_active.h | 48 void i915_active_noop(struct dma_fence *fence, struct dma_fence_cb *cb); 64 void *fence, in __i915_active_fence_init() argument 67 RCU_INIT_POINTER(active->fence, fence); in __i915_active_fence_init() 76 struct dma_fence *fence); 103 struct dma_fence *fence; in i915_active_fence_get() local 106 fence = dma_fence_get_rcu_safe(&active->fence); in i915_active_fence_get() 109 return fence; in i915_active_fence_get() 123 return rcu_access_pointer(active->fence); in i915_active_fence_isset() 178 int i915_sw_fence_await_active(struct i915_sw_fence *fence, 222 struct dma_fence *fence; in __i915_request_await_exclusive() local [all …]
|
| H A D | i915_deps.c | 75 static int i915_deps_grow(struct i915_deps *deps, struct dma_fence *fence, in i915_deps_grow() argument 96 deps->fences[deps->num_deps++] = dma_fence_get(fence); in i915_deps_grow() 100 if (ctx->no_wait_gpu && !dma_fence_is_signaled(fence)) { in i915_deps_grow() 105 ret = dma_fence_wait(fence, ctx->interruptible); in i915_deps_grow() 109 ret = fence->error; in i915_deps_grow() 177 struct dma_fence *fence, in i915_deps_add_dependency() argument 183 if (!fence) in i915_deps_add_dependency() 186 if (dma_fence_is_signaled(fence)) { in i915_deps_add_dependency() 187 ret = fence->error; in i915_deps_add_dependency() 196 if (!entry->context || entry->context != fence->context) in i915_deps_add_dependency() [all …]
|
| /linux/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_amdkfd_fence.c | 68 struct amdgpu_amdkfd_fence *fence; in amdgpu_amdkfd_fence_create() local 70 fence = kzalloc_obj(*fence); in amdgpu_amdkfd_fence_create() 71 if (fence == NULL) in amdgpu_amdkfd_fence_create() 76 fence->mm = mm; in amdgpu_amdkfd_fence_create() 77 get_task_comm(fence->timeline_name, current); in amdgpu_amdkfd_fence_create() 78 spin_lock_init(&fence->lock); in amdgpu_amdkfd_fence_create() 79 fence->svm_bo = svm_bo; in amdgpu_amdkfd_fence_create() 80 fence->context_id = context_id; in amdgpu_amdkfd_fence_create() 81 dma_fence_init(&fence->base, &amdkfd_fence_ops, &fence->lock, in amdgpu_amdkfd_fence_create() 84 return fence; in amdgpu_amdkfd_fence_create() [all …]
|
| /linux/drivers/gpu/drm/vgem/ |
| H A D | vgem_fence.c | 38 static const char *vgem_fence_get_driver_name(struct dma_fence *fence) in vgem_fence_get_driver_name() argument 43 static const char *vgem_fence_get_timeline_name(struct dma_fence *fence) in vgem_fence_get_timeline_name() argument 50 struct vgem_fence *fence = container_of(base, typeof(*fence), base); in vgem_fence_release() local 52 timer_delete_sync(&fence->timer); in vgem_fence_release() 53 dma_fence_free(&fence->base); in vgem_fence_release() 64 struct vgem_fence *fence = timer_container_of(fence, t, timer); in vgem_fence_timeout() local 66 dma_fence_signal(&fence->base); in vgem_fence_timeout() 72 struct vgem_fence *fence; in vgem_fence_create() local 74 fence = kzalloc_obj(*fence); in vgem_fence_create() 75 if (!fence) in vgem_fence_create() [all …]
|
| /linux/drivers/gpu/drm/i915/selftests/ |
| H A D | lib_sw_fence.c | 30 nop_fence_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) in nop_fence_notify() argument 35 void __onstack_fence_init(struct i915_sw_fence *fence, in __onstack_fence_init() argument 39 debug_fence_init_onstack(fence); in __onstack_fence_init() 41 __init_waitqueue_head(&fence->wait, name, key); in __onstack_fence_init() 42 atomic_set(&fence->pending, 1); in __onstack_fence_init() 43 fence->error = 0; in __onstack_fence_init() 44 fence->fn = nop_fence_notify; in __onstack_fence_init() 47 void onstack_fence_fini(struct i915_sw_fence *fence) in onstack_fence_fini() argument 49 if (!fence->fn) in onstack_fence_fini() 52 i915_sw_fence_commit(fence); in onstack_fence_fini() [all …]
|
| H A D | lib_sw_fence.h | 16 #define onstack_fence_init(fence) \ argument 20 __onstack_fence_init((fence), #fence, &__key); \ 23 #define onstack_fence_init(fence) \ argument 24 __onstack_fence_init((fence), NULL, NULL) 27 void __onstack_fence_init(struct i915_sw_fence *fence, 30 void onstack_fence_fini(struct i915_sw_fence *fence); 33 struct i915_sw_fence fence; member 41 void heap_fence_put(struct i915_sw_fence *fence);
|
| /linux/drivers/gpu/drm/radeon/ |
| H A D | radeon_fence.c | 134 struct radeon_fence **fence, in radeon_fence_emit() argument 140 *fence = kmalloc_obj(struct radeon_fence); in radeon_fence_emit() 141 if ((*fence) == NULL) in radeon_fence_emit() 144 (*fence)->rdev = rdev; in radeon_fence_emit() 145 (*fence)->seq = seq = ++rdev->fence_drv[ring].sync_seq[ring]; in radeon_fence_emit() 146 (*fence)->ring = ring; in radeon_fence_emit() 147 (*fence)->is_vm_update = false; in radeon_fence_emit() 148 dma_fence_init(&(*fence)->base, &radeon_fence_ops, in radeon_fence_emit() 152 radeon_fence_ring_emit(rdev, ring, *fence); in radeon_fence_emit() 153 trace_radeon_fence_emit(rdev_to_drm(rdev), ring, (*fence)->seq); in radeon_fence_emit() [all …]
|
| H A D | radeon_sync.c | 63 struct radeon_fence *fence) in radeon_sync_fence() argument 67 if (!fence) in radeon_sync_fence() 70 other = sync->sync_to[fence->ring]; in radeon_sync_fence() 71 sync->sync_to[fence->ring] = radeon_fence_later(fence, other); in radeon_sync_fence() 73 if (fence->is_vm_update) { in radeon_sync_fence() 75 sync->last_vm_update = radeon_fence_later(fence, other); in radeon_sync_fence() 95 struct radeon_fence *fence; in radeon_sync_resv() local 100 fence = to_radeon_fence(f); in radeon_sync_resv() 101 if (fence && fence->rdev == rdev) in radeon_sync_resv() 102 radeon_sync_fence(sync, fence); in radeon_sync_resv() [all …]
|
| /linux/drivers/gpu/drm/ |
| H A D | drm_syncobj.c | 218 struct dma_fence *fence; member 228 struct dma_fence *fence; member 269 struct dma_fence *fence; in drm_syncobj_fence_add_wait() local 271 if (wait->fence) in drm_syncobj_fence_add_wait() 279 fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, 1)); in drm_syncobj_fence_add_wait() 280 if (!fence || dma_fence_chain_find_seqno(&fence, wait->point)) { in drm_syncobj_fence_add_wait() 281 dma_fence_put(fence); in drm_syncobj_fence_add_wait() 283 } else if (!fence) { in drm_syncobj_fence_add_wait() 284 wait->fence = dma_fence_get_stub(); in drm_syncobj_fence_add_wait() 286 wait->fence = fence; in drm_syncobj_fence_add_wait() [all …]
|
| /linux/drivers/gpu/host1x/ |
| H A D | intr.c | 15 struct host1x_syncpt_fence *fence) in host1x_intr_add_fence_to_list() argument 20 if ((s32)(fence_in_list->threshold - fence->threshold) <= 0) { in host1x_intr_add_fence_to_list() 22 list_add(&fence->list, &fence_in_list->list); in host1x_intr_add_fence_to_list() 28 list_add(&fence->list, &list->list); in host1x_intr_add_fence_to_list() 33 struct host1x_syncpt_fence *fence; in host1x_intr_update_hw_state() local 36 fence = list_first_entry(&sp->fences.list, struct host1x_syncpt_fence, list); in host1x_intr_update_hw_state() 38 host1x_hw_intr_set_syncpt_threshold(host, sp->id, fence->threshold); in host1x_intr_update_hw_state() 45 void host1x_intr_add_fence_locked(struct host1x *host, struct host1x_syncpt_fence *fence) in host1x_intr_add_fence_locked() argument 47 struct host1x_fence_list *fence_list = &fence->sp->fences; in host1x_intr_add_fence_locked() 49 INIT_LIST_HEAD(&fence->list); in host1x_intr_add_fence_locked() [all …]
|
| /linux/tools/testing/selftests/sync/ |
| H A D | sync_stress_consumer.c | 40 static int busy_wait_on_fence(int fence) in busy_wait_on_fence() argument 45 error = sync_fence_count_with_status(fence, FENCE_STATUS_ERROR); in busy_wait_on_fence() 47 active = sync_fence_count_with_status(fence, in busy_wait_on_fence() 66 int fence, valid, i; in mpsc_producer_thread() local 72 fence = sw_sync_fence_create(consumer_timeline, "fence", i); in mpsc_producer_thread() 73 valid = sw_sync_fence_is_valid(fence); in mpsc_producer_thread() 82 ASSERT(sync_wait(fence, -1) > 0, in mpsc_producer_thread() 85 ASSERT(busy_wait_on_fence(fence) == 0, in mpsc_producer_thread() 100 sw_sync_fence_destroy(fence); in mpsc_producer_thread() 108 int fence, merged, tmp, valid, it, i; in mpcs_consumer_thread() local [all …]
|
| H A D | sync_stress_merge.c | 43 int fence, tmpfence, merged, valid; in test_merge_stress_random_merge() local 51 fence = sw_sync_fence_create(timelines[0], "fence", 0); in test_merge_stress_random_merge() 52 valid = sw_sync_fence_is_valid(fence); in test_merge_stress_random_merge() 76 merged = sync_merge("merge", tmpfence, fence); in test_merge_stress_random_merge() 78 sw_sync_fence_destroy(fence); in test_merge_stress_random_merge() 79 fence = merged; in test_merge_stress_random_merge() 91 ASSERT(sync_fence_size(fence) == size, in test_merge_stress_random_merge() 97 ret = sync_wait(fence, 0); in test_merge_stress_random_merge() 106 ret = sync_wait(fence, 0); in test_merge_stress_random_merge() 109 sw_sync_fence_destroy(fence); in test_merge_stress_random_merge()
|
| H A D | sync_alloc.c | 46 int timeline, fence, valid; in test_alloc_fence() local 52 fence = sw_sync_fence_create(timeline, "allocFence", 1); in test_alloc_fence() 53 valid = sw_sync_fence_is_valid(fence); in test_alloc_fence() 56 sw_sync_fence_destroy(fence); in test_alloc_fence() 63 int fence, timeline; in test_alloc_fence_negative() local 68 fence = sw_sync_fence_create(-1, "fence", 1); in test_alloc_fence_negative() 69 ASSERT(fence < 0, "Success allocating negative fence\n"); in test_alloc_fence_negative() 71 sw_sync_fence_destroy(fence); in test_alloc_fence_negative()
|
| /linux/drivers/gpu/drm/virtio/ |
| H A D | virtgpu_fence.c | 64 struct virtio_gpu_fence *fence = kzalloc_obj(struct virtio_gpu_fence); in virtio_gpu_fence_alloc() local 66 if (!fence) in virtio_gpu_fence_alloc() 67 return fence; in virtio_gpu_fence_alloc() 69 fence->drv = drv; in virtio_gpu_fence_alloc() 70 fence->ring_idx = ring_idx; in virtio_gpu_fence_alloc() 71 fence->emit_fence_info = !(base_fence_ctx == drv->context); in virtio_gpu_fence_alloc() 78 dma_fence_init(&fence->f, &virtio_gpu_fence_ops, &drv->lock, in virtio_gpu_fence_alloc() 81 return fence; in virtio_gpu_fence_alloc() 86 struct virtio_gpu_fence *fence) in virtio_gpu_fence_emit() argument 92 fence->fence_id = fence->f.seqno = ++drv->current_fence_id; in virtio_gpu_fence_emit() [all …]
|
| /linux/drivers/gpu/drm/msm/ |
| H A D | msm_fence.c | 82 bool msm_fence_completed(struct msm_fence_context *fctx, uint32_t fence) in msm_fence_completed() argument 88 return (int32_t)(fctx->completed_fence - fence) >= 0 || in msm_fence_completed() 89 (int32_t)(*fctx->fenceptr - fence) >= 0; in msm_fence_completed() 93 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) in msm_update_fence() argument 98 if (fence_after(fence, fctx->completed_fence)) in msm_update_fence() 99 fctx->completed_fence = fence; in msm_update_fence() 110 static inline struct msm_fence *to_msm_fence(struct dma_fence *fence) in to_msm_fence() argument 112 return container_of(fence, struct msm_fence, base); in to_msm_fence() 115 static const char *msm_fence_get_driver_name(struct dma_fence *fence) in msm_fence_get_driver_name() argument 120 static const char *msm_fence_get_timeline_name(struct dma_fence *fence) in msm_fence_get_timeline_name() argument [all …]
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_sync.c | 99 static void kick_ufence(struct xe_user_fence *ufence, struct dma_fence *fence) in kick_ufence() argument 103 dma_fence_put(fence); in kick_ufence() 106 static void user_fence_cb(struct dma_fence *fence, struct dma_fence_cb *cb) in user_fence_cb() argument 110 kick_ufence(ufence, fence); in user_fence_cb() 148 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse() 149 if (XE_IOCTL_DBG(xe, !sync->fence)) { in xe_sync_entry_parse() 177 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse() 178 if (XE_IOCTL_DBG(xe, !sync->fence)) { in xe_sync_entry_parse() 183 err = dma_fence_chain_find_seqno(&sync->fence, in xe_sync_entry_parse() 236 if (sync->fence) in xe_sync_entry_add_deps() [all …]
|
| /linux/tools/memory-model/ |
| H A D | linux-kernel.cat | 53 * smp_mb__after_unlock_lock() fence only affects a single lock handover. 58 * to the CPU that executes the fence. Therefore, all those stores are 59 * also affected by the fence. 65 let strong-fence = mb | gp 67 let nonrw-fence = strong-fence | po-rel | acq-po 68 let fence = nonrw-fence | wmb | rmb 95 let ppo = to-r | to-w | (fence & int) | (po-unlock-lock-po & int) 100 let cumul-fence [all...] |
| /linux/drivers/gpu/drm/nouveau/ |
| H A D | nv84_fence.c | 86 nv84_fence_emit(struct nouveau_fence *fence) in nv84_fence_emit() argument 88 struct nouveau_channel *chan = fence->channel; in nv84_fence_emit() 89 struct nv84_fence_chan *fctx = chan->fence; in nv84_fence_emit() 92 return fctx->base.emit32(chan, addr, fence->base.seqno); in nv84_fence_emit() 96 nv84_fence_sync(struct nouveau_fence *fence, in nv84_fence_sync() argument 99 struct nv84_fence_chan *fctx = chan->fence; in nv84_fence_sync() 102 return fctx->base.sync32(chan, addr, fence->base.seqno); in nv84_fence_sync() 108 struct nv84_fence_priv *priv = chan->cli->drm->fence; in nv84_fence_read() 115 struct nv84_fence_priv *priv = chan->cli->drm->fence; in nv84_fence_context_del() 116 struct nv84_fence_chan *fctx = chan->fence; in nv84_fence_context_del() [all …]
|
| H A D | nv10_fence.c | 33 nv10_fence_emit(struct nouveau_fence *fence) in nv10_fence_emit() argument 35 struct nvif_push *push = &fence->channel->chan.push; in nv10_fence_emit() 38 PUSH_MTHD(push, NV06E, SET_REFERENCE, fence->base.seqno); in nv10_fence_emit() 46 nv10_fence_sync(struct nouveau_fence *fence, in nv10_fence_sync() argument 61 struct nv10_fence_chan *fctx = chan->fence; in nv10_fence_context_del() 64 chan->fence = NULL; in nv10_fence_context_del() 73 fctx = chan->fence = kzalloc_obj(*fctx); in nv10_fence_context_new() 87 struct nv10_fence_priv *priv = drm->fence; in nv10_fence_destroy() 90 drm->fence = NULL; in nv10_fence_destroy() 99 priv = drm->fence = kzalloc_obj(*priv); in nv10_fence_create()
|