Lines Matching full:sync
45 * amdgpu_sync_create - zero init sync object
47 * @sync: sync object to initialize
49 * Just clear the sync object for now.
51 void amdgpu_sync_create(struct amdgpu_sync *sync) in amdgpu_sync_create() argument
53 hash_init(sync->fences); in amdgpu_sync_create()
54 sync->last_vm_update = NULL; in amdgpu_sync_create()
127 * @sync: sync object to add the fence to
133 static bool amdgpu_sync_add_later(struct amdgpu_sync *sync, struct dma_fence *f) in amdgpu_sync_add_later() argument
137 hash_for_each_possible(sync->fences, e, node, f->context) { in amdgpu_sync_add_later()
148 * amdgpu_sync_fence - remember to sync to this fence
150 * @sync: sync object to add fence to
151 * @f: fence to sync to
153 * Add the fence to the sync object.
155 int amdgpu_sync_fence(struct amdgpu_sync *sync, struct dma_fence *f) in amdgpu_sync_fence() argument
162 if (amdgpu_sync_add_later(sync, f)) in amdgpu_sync_fence()
169 hash_add(sync->fences, &e->node, f->context); in amdgpu_sync_fence()
175 * amdgpu_sync_vm_fence - remember to sync to this VM fence
177 * @sync: sync object to add fence to
180 * Add the fence to the sync object and remember it as VM update.
182 int amdgpu_sync_vm_fence(struct amdgpu_sync *sync, struct dma_fence *fence) in amdgpu_sync_vm_fence() argument
187 amdgpu_sync_keep_later(&sync->last_vm_update, fence); in amdgpu_sync_vm_fence()
188 return amdgpu_sync_fence(sync, fence); in amdgpu_sync_vm_fence()
191 /* Determine based on the owner and mode if we should sync to a fence or not */
198 /* Always sync to moves, no matter what */ in amdgpu_sync_test_fence()
209 /* Never sync to VM updates either. */ in amdgpu_sync_test_fence()
214 /* Ignore fences depending on the sync mode */ in amdgpu_sync_test_fence()
236 "Adding eviction fence to sync obj"); in amdgpu_sync_test_fence()
241 * amdgpu_sync_resv - sync to a reservation object
244 * @sync: sync object to add fences from reservation object to
246 * @mode: how owner affects which fences we sync to
249 * Sync to the fence
251 int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync, in amdgpu_sync_resv() argument
263 /* always sync to the exclusive fence */ in amdgpu_sync_resv()
270 r = amdgpu_sync_fence(sync, f); in amdgpu_sync_resv()
287 r = amdgpu_sync_fence(sync, f); in amdgpu_sync_resv()
298 * @sync: the sync object
301 * Returns the next fence not signaled yet without removing it from the sync
304 struct dma_fence *amdgpu_sync_peek_fence(struct amdgpu_sync *sync, in amdgpu_sync_peek_fence() argument
311 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_peek_fence()
340 * amdgpu_sync_get_fence - get the next fence from the sync object
342 * @sync: sync object to use
344 * Get and removes the next fence from the sync object not signaled yet.
346 struct dma_fence *amdgpu_sync_get_fence(struct amdgpu_sync *sync) in amdgpu_sync_get_fence() argument
352 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_get_fence()
368 * amdgpu_sync_clone - clone a sync object
370 * @source: sync object to clone
371 * @clone: pointer to destination sync object
402 int amdgpu_sync_wait(struct amdgpu_sync *sync, bool intr) in amdgpu_sync_wait() argument
408 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_wait()
422 * amdgpu_sync_free - free the sync object
424 * @sync: sync object to use
426 * Free the sync object.
428 void amdgpu_sync_free(struct amdgpu_sync *sync) in amdgpu_sync_free() argument
434 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_free()
440 dma_fence_put(sync->last_vm_update); in amdgpu_sync_free()
444 * amdgpu_sync_init - init sync object subsystem
460 * amdgpu_sync_fini - fini sync object subsystem