/linux/drivers/gpu/drm/i915/ |
H A D | i915_sw_fence.c | 8 #include <linux/dma-fence.h> 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 [all …]
|
H A D | i915_sw_fence.h | 12 #include <linux/dma-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); [all …]
|
H A D | i915_deps.c | 6 #include <linux/dma-fence.h> 18 * the migration fence with the unbind fences if these are coalesced 33 /* Min number of fence pointers in the array when an allocation occurs. */ 61 * This function drops all fence references taken, conditionally frees and 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() 127 * encounters an error during the wait or a fence error, the wait for [all …]
|
H A D | i915_active.h | 21 * "fence registers" but pipeline synchronisation objects ala GL_ARB_sync. 30 * In order to use a fence, the object must track the fence it needs to 34 * complete, or waiting for the last GPU user of a "fence register". The 38 * track the most recent fence request, typically this is done as part of 48 void i915_active_noop(struct dma_fence *fence, struct dma_fence_cb *cb); 53 * @fence: initial fence to track, can be NULL 58 * an activity tracker, that is for tracking the last known active fence 59 * associated with it. When the last fence becomes idle, when it is retired 64 void *fence, in __i915_active_fence_init() argument 67 RCU_INIT_POINTER(active->fence, fence); in __i915_active_fence_init() [all …]
|
/linux/drivers/gpu/drm/nouveau/ |
H A D | nouveau_fence.c | 42 nouveau_fctx(struct nouveau_fence *fence) in nouveau_fctx() argument 44 return container_of(fence->base.lock, struct nouveau_fence_chan, lock); in nouveau_fctx() 48 nouveau_fence_signal(struct nouveau_fence *fence) in nouveau_fence_signal() argument 52 dma_fence_signal_locked(&fence->base); in nouveau_fence_signal() 53 list_del(&fence->head); in nouveau_fence_signal() 54 rcu_assign_pointer(fence->channel, NULL); in nouveau_fence_signal() 56 if (test_bit(DMA_FENCE_FLAG_USER_BITS, &fence->base.flags)) { in nouveau_fence_signal() 57 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_signal() 63 dma_fence_put(&fence->base); in nouveau_fence_signal() 68 nouveau_local_fence(struct dma_fence *fence, struct nouveau_drm *drm) in nouveau_local_fence() argument [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(sizeof(*fence), GFP_KERNEL); in vgem_fence_create() 75 if (!fence) in vgem_fence_create() [all …]
|
/linux/include/linux/ |
H A D | dma-fence-chain.h | 3 * fence-chain: chain fences together in a timeline 13 #include <linux/dma-fence.h> 18 * struct dma_fence_chain - fence to represent an node of a fence chain 19 * @base: fence base class 20 * @prev: previous fence of the chain 22 * @fence: encapsulated fence 23 * @lock: spinlock for fence handling 29 struct dma_fence *fence; member 35 * complection of the fence chain. Never used at the same time 54 * to_dma_fence_chain - cast a fence to a dma_fence_chain [all …]
|
H A D | dma-fence-array.h | 3 * fence-array: aggregates fence to be waited together 15 #include <linux/dma-fence.h> 19 * struct dma_fence_array_cb - callback helper for fence array 20 * @cb: fence callback structure for signaling 21 * @array: reference to the parent fence array object 29 * struct dma_fence_array - fence to represent an array of fences 30 * @base: fence base class 31 * @lock: spinlock for fence handling 52 * to_dma_fence_array - cast a fence to a dma_fence_array 53 * @fence: fence to cast to a dma_fence_array [all …]
|
/linux/include/trace/events/ |
H A D | dma_fence.h | 14 TP_PROTO(struct dma_fence *fence), 16 TP_ARGS(fence), 19 __string(driver, dma_fence_driver_name(fence)) 20 __string(timeline, dma_fence_timeline_name(fence)) 28 __entry->context = fence->context; 29 __entry->seqno = fence->seqno; 38 * Safe only for call sites which are guaranteed to not race with fence 39 * signaling,holding the fence->lock and having checked for not signaled, or the 44 TP_PROTO(struct dma_fence *fence), 46 TP_ARGS(fence), [all...] |
/linux/drivers/gpu/drm/amd/amdgpu/ |
H A D | amdgpu_amdkfd_fence.c | 23 #include <linux/dma-fence.h> 36 /* Eviction Fence 37 * Fence helper functions to deal with KFD memory eviction. 41 * All the BOs in a process share an eviction fence. When process X wants 59 * user queues and signal fence. The work item will also start another delayed 67 struct amdgpu_amdkfd_fence *fence; in amdgpu_amdkfd_fence_create() local 69 fence = kzalloc(sizeof(*fence), GFP_KERNEL); in amdgpu_amdkfd_fence_create() 70 if (fence == NULL) in amdgpu_amdkfd_fence_create() 75 fence->mm = mm; in amdgpu_amdkfd_fence_create() 76 get_task_comm(fence->timeline_name, current); in amdgpu_amdkfd_fence_create() [all …]
|
/linux/drivers/gpu/drm/xe/ |
H A D | xe_range_fence.c | 6 #include <linux/dma-fence.h> 21 xe_range_fence_signal_notify(struct dma_fence *fence, struct dma_fence_cb *cb) in xe_range_fence_signal_notify() argument 36 dma_fence_put(rfence->fence); in __xe_range_fence_tree_cleanup() 44 * xe_range_fence_insert() - range fence insert 45 * @tree: range fence tree to insert intoi 46 * @rfence: range fence 47 * @ops: range fence ops 48 * @start: start address of range fence 49 * @last: last address of range fence 50 * @fence: dma fence which signals range fence can be removed + freed [all …]
|
H A D | xe_sync.c | 8 #include <linux/dma-fence-array.h> 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() 146 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse() 147 if (XE_IOCTL_DBG(xe, !sync->fence)) in xe_sync_entry_parse() 171 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse() 172 if (XE_IOCTL_DBG(xe, !sync->fence)) in xe_sync_entry_parse() 175 err = dma_fence_chain_find_seqno(&sync->fence, in xe_sync_entry_parse() [all …]
|
H A D | xe_range_fence.h | 9 #include <linux/dma-fence.h> 16 /** struct xe_range_fence_ops - XE range fence ops */ 18 /** @free: free range fence op */ 22 /** struct xe_range_fence - XE range fence (address conflict tracking) */ 26 /** @start: start address of range fence is interval tree */ 28 /** @last: last address (inclusive) of range fence is interval tree */ 33 * @fence: fence signals address in range fence no longer has conflict 35 struct dma_fence *fence; member 36 /** @tree: interval tree which range fence belongs to */ 39 * @cb: callback when fence signals to remove range fence free from interval tree [all …]
|
H A D | xe_hw_fence_types.h | 9 #include <linux/dma-fence.h> 19 * struct xe_hw_fence_irq - hardware fence IRQ handler 31 /** @enabled: fence signaling enabled */ 38 * struct xe_hw_fence_ctx - hardware fence context 40 * The context for a hardware fence. 1 to 1 relationship with xe_engine. Points 44 /** @gt: GT structure of hardware fence context */ 46 /** @irq: fence irq handler */ 48 /** @dma_fence_ctx: dma fence context for hardware fence */ 50 /** @next_seqno: next seqno for hardware fence */ 52 /** @name: name of hardware fence context */ [all …]
|
H A D | xe_preempt_fence.c | 33 * Opt for keep everything in the fence critical section. This looks really strange since we in preempt_fence_work_func() 34 * have just signalled the fence, however the preempt fences are all signalled via single in preempt_fence_work_func() 37 * ever signalling. Therefore try to keep everything here in the callback in the fence in preempt_fence_work_func() 48 preempt_fence_get_driver_name(struct dma_fence *fence) in preempt_fence_get_driver_name() argument 54 preempt_fence_get_timeline_name(struct dma_fence *fence) in preempt_fence_get_timeline_name() argument 59 static bool preempt_fence_enable_signaling(struct dma_fence *fence) in preempt_fence_enable_signaling() argument 62 container_of(fence, typeof(*pfence), base); in preempt_fence_enable_signaling() 77 * xe_preempt_fence_alloc() - Allocate a preempt fence with minimal 80 * Allocate a preempt fence, and initialize its list head. 104 * xe_preempt_fence_free() - Free a preempt fence allocated using [all …]
|
/linux/drivers/dma-buf/ |
H A D | dma-resv.c | 37 #include <linux/dma-fence-array.h> 49 * can have any number of fences attaches to it. Each fence carries an usage 50 * parameter determining how the operation represented by the fence is using the 60 /* Mask for the lower fence pointer bits */ 69 /* Extract the fence and usage flags from an RCU protected entry in the list. */ 71 struct dma_resv *resv, struct dma_fence **fence, in dma_resv_list_entry() argument 78 *fence = (struct dma_fence *)(tmp & ~DMA_RESV_LIST_MASK); in dma_resv_list_entry() 83 /* Set the fence and usage flags at the specific index in the list. */ 86 struct dma_fence *fence, in dma_resv_list_set() argument 89 long tmp = ((long)fence) | usage; in dma_resv_list_set() [all …]
|
H A D | st-dma-fence-chain.c | 8 #include <linux/dma-fence.h> 9 #include <linux/dma-fence-chain.h> 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() 184 struct dma_fence *fence; in find_seqno() local 192 fence = dma_fence_get(fc.tail); in find_seqno() 193 err = dma_fence_chain_find_seqno(&fence, 0); in find_seqno() 194 dma_fence_put(fence); in find_seqno() 201 fence = dma_fence_get(fc.tail); in find_seqno() 202 err = dma_fence_chain_find_seqno(&fence, i + 1); in find_seqno() [all …]
|
H A D | dma-fence-array.c | 3 * dma-fence-array: aggregate fences to be waited together 14 #include <linux/dma-fence-array.h> 18 static const char *dma_fence_array_get_driver_name(struct dma_fence *fence) in dma_fence_array_get_driver_name() argument 23 static const char *dma_fence_array_get_timeline_name(struct dma_fence *fence) in dma_fence_array_get_timeline_name() argument 70 static bool dma_fence_array_enable_signaling(struct dma_fence *fence) in dma_fence_array_enable_signaling() argument 72 struct dma_fence_array *array = to_dma_fence_array(fence); in dma_fence_array_enable_signaling() 79 * As we may report that the fence is signaled before all in dma_fence_array_enable_signaling() 82 * early. The core fence handling will only hold the reference in dma_fence_array_enable_signaling() 103 static bool dma_fence_array_signaled(struct dma_fence *fence) in dma_fence_array_signaled() argument 105 struct dma_fence_array *array = to_dma_fence_array(fence); in dma_fence_array_signaled() [all …]
|
/linux/drivers/gpu/drm/i915/selftests/ |
H A D | lib_sw_fence.c | 27 /* Small library of different fence types useful for writing tests */ 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() [all …]
|
H A D | i915_sw_fence.c | 32 fence_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) in fence_notify() argument 39 /* Leave the fence for the caller to free it after testing */ in fence_notify() 48 struct i915_sw_fence *fence; in alloc_fence() local 50 fence = kmalloc(sizeof(*fence), GFP_KERNEL); in alloc_fence() 51 if (!fence) in alloc_fence() 54 i915_sw_fence_init(fence, fence_notify); in alloc_fence() 55 return fence; in alloc_fence() 58 static void free_fence(struct i915_sw_fence *fence) in free_fence() argument 60 i915_sw_fence_fini(fence); in free_fence() 61 kfree(fence); in free_fence() [all …]
|
/linux/drivers/gpu/drm/radeon/ |
H A D | radeon_sync.c | 55 * radeon_sync_fence - use the semaphore to sync to a fence 57 * @sync: sync object to add fence to 58 * @fence: fence to sync to 60 * Sync to the fence using the semaphore objects 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() [all …]
|
/linux/drivers/gpu/host1x/ |
H A D | intr.c | 11 #include "fence.h" 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() 21 /* Fence in list is before us, we can insert here */ 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 [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() 46 ASSERT(error == 0, "Error occurred on fence\n"); 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() 74 ASSERT(valid, "Failure creating fence\n"); in mpsc_producer_thread() 78 * means of waiting on the fence in mpsc_producer_thread() 82 ASSERT(sync_wait(fence, -1) > 0, in mpsc_producer_thread() [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() 53 ASSERT(valid, "Failure creating fence\n"); in test_merge_stress_random_merge() 75 tmpfence = sw_sync_fence_create(timeline, "fence", sync_point); 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() 82 ASSERT(valid, "Failure creating fence i\n"); in test_merge_stress_random_merge() 90 /* Confirm our map matches the fence. */ in test_merge_stress_random_merge() [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...] |