Lines Matching full:sync

43  * amdgpu_sync_create - zero init sync object
45 * @sync: sync object to initialize
47 * Just clear the sync object for now.
49 void amdgpu_sync_create(struct amdgpu_sync *sync) in amdgpu_sync_create() argument
51 hash_init(sync->fences); in amdgpu_sync_create()
52 sync->last_vm_update = NULL; in amdgpu_sync_create()
125 * @sync: sync object to add the fence to
131 static bool amdgpu_sync_add_later(struct amdgpu_sync *sync, struct dma_fence *f) in amdgpu_sync_add_later() argument
135 hash_for_each_possible(sync->fences, e, node, f->context) { in amdgpu_sync_add_later()
146 * amdgpu_sync_fence - remember to sync to this fence
148 * @sync: sync object to add fence to
149 * @f: fence to sync to
151 * Add the fence to the sync object.
153 int amdgpu_sync_fence(struct amdgpu_sync *sync, struct dma_fence *f) in amdgpu_sync_fence() argument
160 if (amdgpu_sync_add_later(sync, f)) in amdgpu_sync_fence()
167 hash_add(sync->fences, &e->node, f->context); in amdgpu_sync_fence()
173 * amdgpu_sync_vm_fence - remember to sync to this VM fence
176 * @sync: sync object to add fence to
179 * Add the fence to the sync object and remember it as VM update.
181 int amdgpu_sync_vm_fence(struct amdgpu_sync *sync, struct dma_fence *fence) in amdgpu_sync_vm_fence() argument
186 amdgpu_sync_keep_later(&sync->last_vm_update, fence); in amdgpu_sync_vm_fence()
187 return amdgpu_sync_fence(sync, fence); in amdgpu_sync_vm_fence()
191 * amdgpu_sync_resv - sync to a reservation object
193 * @sync: sync object to add fences from reservation object to
195 * @mode: how owner affects which fences we sync to
198 * Sync to the fence
200 int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync, in amdgpu_sync_resv() argument
212 /* always sync to the exclusive fence */ in amdgpu_sync_resv()
214 r = amdgpu_sync_fence(sync, f); in amdgpu_sync_resv()
228 /* Always sync to moves, no matter what */ in amdgpu_sync_resv()
230 r = amdgpu_sync_fence(sync, f); in amdgpu_sync_resv()
242 /* Never sync to VM updates either. */ in amdgpu_sync_resv()
247 /* Ignore fences depending on the sync mode */ in amdgpu_sync_resv()
269 "Adding eviction fence to sync obj"); in amdgpu_sync_resv()
270 r = amdgpu_sync_fence(sync, f); in amdgpu_sync_resv()
280 * @sync: the sync object
283 * Returns the next fence not signaled yet without removing it from the sync
286 struct dma_fence *amdgpu_sync_peek_fence(struct amdgpu_sync *sync, in amdgpu_sync_peek_fence() argument
293 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_peek_fence()
322 * amdgpu_sync_get_fence - get the next fence from the sync object
324 * @sync: sync object to use
326 * Get and removes the next fence from the sync object not signaled yet.
328 struct dma_fence *amdgpu_sync_get_fence(struct amdgpu_sync *sync) in amdgpu_sync_get_fence() argument
334 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_get_fence()
350 * amdgpu_sync_clone - clone a sync object
352 * @source: sync object to clone
353 * @clone: pointer to destination sync object
384 int amdgpu_sync_wait(struct amdgpu_sync *sync, bool intr) in amdgpu_sync_wait() argument
390 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_wait()
404 * amdgpu_sync_free - free the sync object
406 * @sync: sync object to use
408 * Free the sync object.
410 void amdgpu_sync_free(struct amdgpu_sync *sync) in amdgpu_sync_free() argument
416 hash_for_each_safe(sync->fences, i, tmp, e, node) { in amdgpu_sync_free()
422 dma_fence_put(sync->last_vm_update); in amdgpu_sync_free()
426 * amdgpu_sync_init - init sync object subsystem
442 * amdgpu_sync_fini - fini sync object subsystem