/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 …]
|
/linux/drivers/gpu/drm/radeon/ |
H A D | radeon_fence.c | 50 * for GPU/CPU synchronization. When the fence is written, 51 * it is expected that all buffers associated with that fence 59 * radeon_fence_write - write a fence value 63 * @ring: ring index the fence is associated with 65 * Writes a fence value to memory or a scratch register (all asics). 80 * radeon_fence_read - read a fence value 83 * @ring: ring index the fence is associated with 85 * Reads a fence value from memory or a scratch register (all asics). 86 * Returns the value of the fence read from memory or register. 124 * radeon_fence_emit - emit a fence on the requested ring [all …]
|
/linux/drivers/gpu/drm/i915/gt/ |
H A D | intel_ggtt_fencing.c | 18 * DOC: fence register handling 37 * dynamically associated with objects. Furthermore fence state is committed to 41 * cases the fence can be removed forcefully with i915_gem_object_put_fence(). 49 static struct drm_i915_private *fence_to_i915(struct i915_fence_reg *fence) in fence_to_i915() argument 51 return fence->ggtt->vm.i915; in fence_to_i915() 54 static struct intel_uncore *fence_to_uncore(struct i915_fence_reg *fence) in fence_to_uncore() argument 56 return fence->ggtt->vm.gt->uncore; in fence_to_uncore() 59 static void i965_write_fence_reg(struct i915_fence_reg *fence) in i965_write_fence_reg() argument 65 if (GRAPHICS_VER(fence_to_i915(fence)) >= 6) { in i965_write_fence_reg() 66 fence_reg_lo = FENCE_REG_GEN6_LO(fence->id); in i965_write_fence_reg() [all …]
|
/linux/drivers/gpu/drm/scheduler/ |
H A D | sched_fence.c | 50 struct dma_fence *fence) in drm_sched_fence_set_parent() argument 55 * fence's parent set before test_bit() in drm_sched_fence_set_parent() 57 smp_store_release(&s_fence->parent, dma_fence_get(fence)); in drm_sched_fence_set_parent() 60 dma_fence_set_deadline(fence, s_fence->deadline); in drm_sched_fence_set_parent() 63 void drm_sched_fence_scheduled(struct drm_sched_fence *fence, in drm_sched_fence_scheduled() argument 66 /* Set the parent before signaling the scheduled fence, such that, in drm_sched_fence_scheduled() 73 drm_sched_fence_set_parent(fence, parent); in drm_sched_fence_scheduled() 75 dma_fence_signal(&fence->scheduled); in drm_sched_fence_scheduled() 78 void drm_sched_fence_finished(struct drm_sched_fence *fence, int result) in drm_sched_fence_finished() argument 81 dma_fence_set_error(&fence->finished, result); in drm_sched_fence_finished() [all …]
|
/linux/drivers/gpu/drm/vmwgfx/ |
H A D | vmwgfx_fence.c | 51 struct vmw_fence_obj fence; member 55 * struct vmw_event_fence_action - fence action that delivers a drm event. 57 * @action: A struct vmw_fence_action to hook up to a fence. 59 * @fence: A referenced pointer to the fence to keep it alive while @action 63 * current time tv_sec val when the fence signals. 65 * be assigned the current time tv_usec val when the fence signals. 71 struct vmw_fence_obj *fence; member 79 fman_from_fence(struct vmw_fence_obj *fence) in fman_from_fence() argument 81 return container_of(fence->base.lock, struct vmw_fence_manager, lock); in fman_from_fence() 104 * a) When a new fence seqno has been submitted by the fifo code. [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 del_timer_sync(&fence->timer); in vgem_fence_release() 53 dma_fence_free(&fence->base); in vgem_fence_release() 56 static void vgem_fence_value_str(struct dma_fence *fence, char *str, int size) in vgem_fence_value_str() argument 58 snprintf(str, size, "%llu", fence->seqno); in vgem_fence_value_str() 61 static void vgem_fence_timeline_value_str(struct dma_fence *fence, char *str, in vgem_fence_timeline_value_str() argument 65 dma_fence_is_signaled(fence) ? fence->seqno : 0); in vgem_fence_timeline_value_str() 79 struct vgem_fence *fence = from_timer(fence, t, timer); in vgem_fence_timeout() local [all …]
|
/linux/drivers/gpu/drm/nouveau/ |
H A D | nouveau_fence.c | 42 from_fence(struct dma_fence *fence) in from_fence() argument 44 return container_of(fence, struct nouveau_fence, base); in from_fence() 48 nouveau_fctx(struct nouveau_fence *fence) in nouveau_fctx() argument 50 return container_of(fence->base.lock, struct nouveau_fence_chan, lock); in nouveau_fctx() 54 nouveau_fence_signal(struct nouveau_fence *fence) in nouveau_fence_signal() argument 58 dma_fence_signal_locked(&fence->base); in nouveau_fence_signal() 59 list_del(&fence->head); in nouveau_fence_signal() 60 rcu_assign_pointer(fence->channel, NULL); in nouveau_fence_signal() 62 if (test_bit(DMA_FENCE_FLAG_USER_BITS, &fence->base.flags)) { in nouveau_fence_signal() 63 struct nouveau_fence_chan *fctx = nouveau_fctx(fence); in nouveau_fence_signal() [all …]
|
/linux/drivers/gpu/drm/xe/ |
H A D | xe_hw_fence.c | 45 struct xe_hw_fence *fence = in fence_free() local 48 if (!WARN_ON_ONCE(!fence)) in fence_free() 49 kmem_cache_free(xe_hw_fence_slab, fence); in fence_free() 55 struct xe_hw_fence *fence, *next; in hw_fence_irq_run_cb() local 61 list_for_each_entry_safe(fence, next, &irq->pending, irq_link) { in hw_fence_irq_run_cb() 62 struct dma_fence *dma_fence = &fence->dma; in hw_fence_irq_run_cb() 64 trace_xe_hw_fence_try_signal(fence); in hw_fence_irq_run_cb() 66 trace_xe_hw_fence_signal(fence); in hw_fence_irq_run_cb() 67 list_del_init(&fence->irq_link); in hw_fence_irq_run_cb() 86 struct xe_hw_fence *fence, *next; in xe_hw_fence_irq_finish() local [all …]
|
H A D | xe_gt_tlb_invalidation.c | 40 static void xe_gt_tlb_invalidation_fence_fini(struct xe_gt_tlb_invalidation_fence *fence) in xe_gt_tlb_invalidation_fence_fini() argument 42 if (WARN_ON_ONCE(!fence->gt)) in xe_gt_tlb_invalidation_fence_fini() 45 xe_pm_runtime_put(gt_to_xe(fence->gt)); in xe_gt_tlb_invalidation_fence_fini() 46 fence->gt = NULL; /* fini() should be called once */ in xe_gt_tlb_invalidation_fence_fini() 50 __invalidation_fence_signal(struct xe_device *xe, struct xe_gt_tlb_invalidation_fence *fence) in __invalidation_fence_signal() argument 52 bool stack = test_bit(FENCE_STACK_BIT, &fence->base.flags); in __invalidation_fence_signal() 54 trace_xe_gt_tlb_invalidation_fence_signal(xe, fence); in __invalidation_fence_signal() 55 xe_gt_tlb_invalidation_fence_fini(fence); in __invalidation_fence_signal() 56 dma_fence_signal(&fence->base); in __invalidation_fence_signal() 58 dma_fence_put(&fence->base); in __invalidation_fence_signal() [all …]
|
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 …]
|
/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/drivers/dma-buf/ |
H A D | dma-fence-chain.c | 3 * fence-chain: chain fences together in a timeline 10 #include <linux/dma-fence-chain.h> 12 static bool dma_fence_chain_enable_signaling(struct dma_fence *fence); 15 * dma_fence_chain_get_prev - use RCU to get a reference to the previous fence 18 * Use dma_fence_get_rcu_safe to get a reference to the previous fence of the 33 * @fence: current chain node 35 * Walk the chain to the next node. Returns the next fence or NULL if we are at 39 struct dma_fence *dma_fence_chain_walk(struct dma_fence *fence) in dma_fence_chain_walk() argument 44 chain = to_dma_fence_chain(fence); in dma_fence_chain_walk() 46 dma_fence_put(fence); in dma_fence_chain_walk() [all …]
|
H A D | sync_file.c | 8 #include <linux/dma-fence-unwrap.h> 58 * @fence: fence to add to the sync_fence 60 * Creates a sync_file containg @fence. This function acquires and additional 61 * reference of @fence for the newly-created &sync_file, if it succeeds. The 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() 97 * sync_file_get_fence - get the fence related to the sync_file fd 98 * @fd: sync_file fd to get the fence from 100 * Ensures @fd references a valid sync_file and returns a fence that 101 * represents all fence in the sync_file. On error NULL is returned. [all …]
|
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/amd/amdgpu/ |
H A D | amdgpu_fence.c | 46 * for GPU/CPU synchronization. When the fence is written, 47 * it is expected that all buffers associated with that fence 92 * amdgpu_fence_write - write a fence value 94 * @ring: ring the fence is associated with 97 * Writes a fence value to memory (all asics). 108 * amdgpu_fence_read - read a fence value 110 * @ring: ring the fence is associated with 112 * Reads a fence value from memory (all asics). 113 * Returns the value of the fence read from memory. 129 * amdgpu_fence_emit - emit a fence on the requested ring [all …]
|
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/include/trace/events/ |
H A D | dma_fence.h | 14 TP_PROTO(struct dma_fence *fence), 16 TP_ARGS(fence), 19 __string(driver, fence->ops->get_driver_name(fence)) 20 __string(timeline, fence->ops->get_timeline_name(fence)) 28 __entry->context = fence->context; 29 __entry->seqno = fence->seqno; 39 TP_PROTO(struct dma_fence *fence), 41 TP_ARGS(fence) [all...] |
/linux/drivers/gpu/drm/ |
H A D | drm_syncobj.c | 3 * Parts ported from amdgpu (fence wait code). 41 * - Import and export a syncobj's underlying fence to/from a sync file 42 * - Reset a syncobj (set its fence to NULL) 43 * - Signal a syncobj (set a trivially signaled fence) 44 * - Wait for a syncobj's fence to appear and be signaled 57 * to an already signaled fence depending on whether the 63 * the syncobj, the syncobj's fence is replaced with a fence which will be 67 * struct &dma_fence_chain pointing to the DRM driver's fence and also 68 * pointing to the previous fence that was in the syncobj. The new struct 69 * &dma_fence_chain fence replace the syncobj's fence and will be signaled by [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 …]
|