| /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/dma-buf/ |
| H A D | dma-fence.c | 3 * Fence mechanism for dma-buf and to allow for asynchronous dma access 16 #include <linux/dma-fence.h> 30 * fence context counter: each execution context should have its own 31 * fence context, this allows checking if fences belong to the same 44 * A fence is initialized using dma_fence_init() and completed using 59 * fence to be updated. 68 * DOC: fence cross-driver contract 94 * This means any code required for fence completion cannot acquire a 99 * callbacks. This means any code required for fence completion cannot 104 * for fence completio 113 dma_fence_stub_get_name(struct dma_fence * fence) dma_fence_stub_get_name() argument 153 struct dma_fence *fence; dma_fence_allocate_private_stub() local 353 dma_fence_signal_timestamp_locked(struct dma_fence * fence,ktime_t timestamp) dma_fence_signal_timestamp_locked() argument 401 dma_fence_signal_timestamp(struct dma_fence * fence,ktime_t timestamp) dma_fence_signal_timestamp() argument 427 dma_fence_signal_locked(struct dma_fence * fence) dma_fence_signal_locked() argument 444 dma_fence_check_and_signal_locked(struct dma_fence * fence) dma_fence_check_and_signal_locked() argument 464 dma_fence_check_and_signal(struct dma_fence * fence) dma_fence_check_and_signal() argument 487 dma_fence_signal(struct dma_fence * fence) dma_fence_signal() argument 524 dma_fence_wait_timeout(struct dma_fence * fence,bool intr,signed long timeout) dma_fence_wait_timeout() argument 572 struct dma_fence *fence = dma_fence_release() local 622 dma_fence_free(struct dma_fence * fence) dma_fence_free() argument 628 __dma_fence_enable_signaling(struct dma_fence * fence) __dma_fence_enable_signaling() argument 665 dma_fence_enable_sw_signaling(struct dma_fence * fence) dma_fence_enable_sw_signaling() argument 697 dma_fence_add_callback(struct dma_fence * fence,struct dma_fence_cb * cb,dma_fence_func_t func) dma_fence_add_callback() argument 737 dma_fence_get_status(struct dma_fence * fence) dma_fence_get_status() argument 769 dma_fence_remove_callback(struct dma_fence * fence,struct dma_fence_cb * cb) dma_fence_remove_callback() argument 790 dma_fence_default_wait_cb(struct dma_fence * fence,struct dma_fence_cb * cb) dma_fence_default_wait_cb() argument 811 dma_fence_default_wait(struct dma_fence * fence,bool intr,signed long timeout) dma_fence_default_wait() argument 867 struct dma_fence *fence = fences[i]; dma_fence_test_signaled_any() local 926 struct dma_fence *fence = fences[i]; dma_fence_wait_any_timeout() local 1019 dma_fence_set_deadline(struct dma_fence * fence,ktime_t deadline) dma_fence_set_deadline() argument 1038 dma_fence_describe(struct dma_fence * fence,struct seq_file * seq) dma_fence_describe() argument 1061 __dma_fence_init(struct dma_fence * fence,const struct dma_fence_ops * ops,spinlock_t * lock,u64 context,u64 seqno,unsigned long flags) __dma_fence_init() argument 1109 dma_fence_init(struct dma_fence * fence,const struct dma_fence_ops * ops,spinlock_t * lock,u64 context,u64 seqno) dma_fence_init() argument 1136 dma_fence_init64(struct dma_fence * fence,const struct dma_fence_ops * ops,spinlock_t * lock,u64 context,u64 seqno) dma_fence_init64() argument 1164 dma_fence_driver_name(struct dma_fence * fence) dma_fence_driver_name() argument 1197 dma_fence_timeline_name(struct dma_fence * fence) dma_fence_timeline_name() argument [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 | st-dma-fence-chain.c | 9 #include <linux/dma-fence.h> 10 #include <linux/dma-fence-chain.h> 61 struct dma_fence *fence, in mock_chain() 70 dma_fence_chain_init(f, dma_fence_get(prev), dma_fence_get(fence), in mock_chain() 177 struct dma_fence *fence; in fence_chains_fini() 182 KUNIT_ASSERT_EQ_MSG(test, err, 0, "Failed to init fence chains"); in find_seqno() local 184 fence = dma_fence_get(fc.tail); in find_seqno() 185 err = dma_fence_chain_find_seqno(&fence, 0); in find_seqno() 186 dma_fence_put(fence); in find_seqno() 193 fence in find_seqno() 62 mock_chain(struct dma_fence * prev,struct dma_fence * fence,u64 seqno) mock_chain() argument 260 struct dma_fence *fence; find_signaled() local 298 struct dma_fence *fence; find_out_of_order() local 342 struct dma_fence *fence; find_gap() local 398 struct dma_fence *fence = dma_fence_get(data->fc.tail); __find_race() local [all...] |
| H A D | st-dma-fence-unwrap.c | 8 #include <linux/dma-fence.h> 9 #include <linux/dma-fence-array.h> 10 #include <linux/dma-fence-chain.h> 11 #include <linux/dma-fence-unwrap.h> 84 struct dma_fence *fence) in mock_chain() 91 dma_fence_put(fence); in mock_chain() 95 dma_fence_chain_init(f, prev, fence, 1); in mock_chain() 119 struct dma_fence *fence, *f1, *f2, *array; in sanitycheck() 129 KUNIT_FAIL(test, "Failed to create mock fence"); in unwrap_array() 139 dma_fence_unwrap_for_each(fence, in unwrap_array() 85 mock_chain(struct dma_fence * prev,struct dma_fence * fence) mock_chain() argument 125 struct dma_fence *fence, *f1, *f2, *array; unwrap_array() local 169 struct dma_fence *fence, *f1, *f2, *chain; unwrap_chain() local 213 struct dma_fence *fence, *f1, *f2, *array, *chain; unwrap_chain_array() local 261 struct dma_fence *fence, *f1, *f2, *f3; unwrap_merge() local 313 struct dma_fence *fence, *f1, *f2; unwrap_merge_duplicate() local 352 struct dma_fence *fence, *f1, *f2, *f3, *f4; unwrap_merge_seqno() local 418 struct dma_fence *fence, *f1, *f2, *a1, *a2, *c1, *c2; unwrap_merge_order() local 484 struct dma_fence *fence, *f1, *f2, *f3, *f4, *f5; unwrap_merge_complex() local 547 struct dma_fence *fence, *f1, *f2, *f3, *f4, *f5, *f6, *f7; unwrap_merge_complex_seqno() local [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 …]
|
| 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/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/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 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() [all …]
|
| H A D | amdgpu_userq_fence.c | 27 #include <linux/dma-fence-unwrap.h> 149 struct dma_fence *fence; in amdgpu_userq_fence_driver_process() local 169 fence = &userq_fence->base; in amdgpu_userq_fence_driver_process() 171 dma_fence_signal(fence); in amdgpu_userq_fence_driver_process() 176 dma_fence_put(fence); in amdgpu_userq_fence_driver_process() 189 struct amdgpu_userq_fence *fence, *tmp; in amdgpu_userq_fence_driver_destroy() local 194 list_for_each_entry_safe(fence, tmp, &fence_drv->fences, link) { in amdgpu_userq_fence_driver_destroy() 195 f = &fence->base; in amdgpu_userq_fence_driver_destroy() 202 list_del(&fence->link); in amdgpu_userq_fence_driver_destroy() 270 struct amdgpu_userq_fence *fence, in amdgpu_userq_fence_init() argument 309 struct amdgpu_userq_fence *fence = to_amdgpu_userq_fence(f); amdgpu_userq_fence_get_timeline_name() local 316 struct amdgpu_userq_fence *fence = to_amdgpu_userq_fence(f); amdgpu_userq_fence_signaled() local 331 struct dma_fence *fence = container_of(rcu, struct dma_fence, rcu); amdgpu_userq_fence_free() local 418 amdgpu_userq_fence_driver_set_error(struct amdgpu_userq_fence * fence,int error) amdgpu_userq_fence_driver_set_error() argument 440 struct amdgpu_userq_fence *fence = to_amdgpu_userq_fence(f); amdgpu_userq_fence_driver_force_completion() local 464 struct amdgpu_userq_fence *fence; amdgpu_userq_signal_ioctl() local 603 struct dma_fence *fence, *f; amdgpu_userq_wait_count_fences() local 664 struct dma_fence *fence; amdgpu_userq_wait_count_fences() local 674 struct dma_fence *fence; amdgpu_userq_wait_count_fences() local 693 amdgpu_userq_wait_add_fence(struct drm_amdgpu_userq_wait * wait_info,struct dma_fence ** fences,unsigned int * num_fences,struct dma_fence * fence) amdgpu_userq_wait_add_fence() argument 716 struct dma_fence **fences, *fence, *f; amdgpu_userq_wait_return_fence_info() local 760 struct dma_fence *fence; amdgpu_userq_wait_return_fence_info() local 799 struct dma_fence *fence; amdgpu_userq_wait_return_fence_info() local 813 struct dma_fence *fence; amdgpu_userq_wait_return_fence_info() local [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 tha 218 struct dma_fence *fence; global() member 228 struct dma_fence *fence; global() member 269 struct dma_fence *fence; drm_syncobj_fence_add_wait() local 335 drm_syncobj_add_point(struct drm_syncobj * syncobj,struct dma_fence_chain * chain,struct dma_fence * fence,uint64_t point) drm_syncobj_add_point() argument 373 drm_syncobj_replace_fence(struct drm_syncobj * syncobj,struct dma_fence * fence) drm_syncobj_replace_fence() argument 409 struct dma_fence *fence = dma_fence_allocate_private_stub(ktime_get()); drm_syncobj_assign_null_handle() local 438 drm_syncobj_find_fence(struct drm_file * file_private,u32 handle,u64 point,u64 flags,struct dma_fence ** fence) drm_syncobj_find_fence() argument 555 drm_syncobj_create(struct drm_syncobj ** out_syncobj,uint32_t flags,struct dma_fence * fence) drm_syncobj_create() argument 729 struct dma_fence *fence = sync_file_get_fence(fd); drm_syncobj_import_sync_file_fence() local 761 struct dma_fence *fence; drm_syncobj_export_sync_file() local 923 struct dma_fence *fence, *tmp; drm_syncobj_transfer_to_timeline() local 964 struct dma_fence *fence; drm_syncobj_transfer_to_binary() local 1002 syncobj_wait_fence_func(struct dma_fence * fence,struct dma_fence_cb * cb) syncobj_wait_fence_func() argument 1014 struct dma_fence *fence; syncobj_wait_syncobj_func() local 1042 struct dma_fence *fence; drm_syncobj_array_wait_timeout() local 1077 struct dma_fence *fence; drm_syncobj_array_wait_timeout() local 1407 syncobj_eventfd_entry_fence_func(struct dma_fence * fence,struct dma_fence_cb * cb) syncobj_eventfd_entry_fence_func() argument 1422 struct dma_fence *fence; syncobj_eventfd_entry_func() local 1636 struct dma_fence *fence = dma_fence_get_stub(); drm_syncobj_timeline_signal_ioctl() local 1679 struct dma_fence *fence; drm_syncobj_query_ioctl() local [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 57 xe_range_fence_insert(struct xe_range_fence_tree * tree,struct xe_range_fence * rfence,const struct xe_range_fence_ops * ops,u64 start,u64 last,struct dma_fence * fence) xe_range_fence_insert() argument [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() 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() 269 xe_sync_entry_signal(struct xe_sync_entry * sync,struct dma_fence * fence) xe_sync_entry_signal() argument 337 struct dma_fence *fence; xe_sync_in_fence_get() local [all...] |
| H A D | xe_preempt_fence.c | 28 xe_gt_dbg(q->gt, "PREEMPT FENCE RETRY guc_id=%d", in preempt_fence_work_func() 44 * Opt for keep everything in the fence critical section. This looks really strange since we in preempt_fence_work_func() 45 * have just signalled the fence, however the preempt fences are all signalled via single in preempt_fence_work_func() 48 * ever signalling. Therefore try to keep everything here in the callback in the fence in preempt_fence_work_func() 59 preempt_fence_get_driver_name(struct dma_fence *fence) in preempt_fence_get_driver_name() argument 65 preempt_fence_get_timeline_name(struct dma_fence *fence) in preempt_fence_get_timeline_name() argument 70 static bool preempt_fence_enable_signaling(struct dma_fence *fence) in preempt_fence_enable_signaling() argument 73 container_of(fence, typeof(*pfence), base); in preempt_fence_enable_signaling() 88 * xe_preempt_fence_alloc() - Allocate a preempt fence with minimal 91 * Allocate a preempt fence, and initialize its list head. [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 …]
|
| /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 …]
|
| /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 55 host1x_intr_remove_fence(struct host1x * host,struct host1x_syncpt_fence * fence) host1x_intr_remove_fence() argument 78 struct host1x_syncpt_fence *fence, *tmp; host1x_intr_handle_interrupt() local [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/drivers/gpu/drm/msm/ |
| H A D | msm_fence.c | 7 #include <linux/dma-fence.h> 34 /* If deadline fence has already passed, nothing to do: */ in deadline_work() 61 * Start out close to the 32b fence rollover point, so we can in msm_fence_context_alloc() 62 * catch bugs with fence comparisons. in msm_fence_context_alloc() 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() [all …]
|
| H A D | msm_fence.h | 13 * struct msm_fence_context - fence context for gpu 15 * Each ringbuffer has a single fence context, with the GPU writing an 16 * incrementing fence seqno at the end of each submit 21 /** @name: human readable name for fence timeline */ 29 * Last assigned fence, incremented each time a fence is created 30 * on this fence context. If last_fence == completed_fence, 36 * The last completed fence, updated from the CPU after interrupt 42 * The address that the GPU directly writes with completed fence 44 * this to see if a fence has already signaled but the CPU hasn't 50 * @spinlock: fence context spinlock [all …]
|
| /linux/drivers/gpu/drm/virtio/ |
| H A D | virtgpu_fence.c | 45 /* leaked fence outside driver before completing in virtio_gpu_fence_signaled() 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() 73 /* This only partially initializes the fence because the seqno is in virtio_gpu_fence_alloc() 74 * unknown yet. The fence must not be used outside of the driver in virtio_gpu_fence_alloc() 78 dma_fence_init(&fence->f, &virtio_gpu_fence_ops, &drv->lock, in virtio_gpu_fence_alloc() [all …]
|