Lines Matching full:sync
108 struct xe_sync_entry *sync, in xe_sync_entry_parse() argument
135 sync->syncobj = drm_syncobj_find(xef->drm, sync_in.handle); in xe_sync_entry_parse()
136 if (XE_IOCTL_DBG(xe, !sync->syncobj)) in xe_sync_entry_parse()
140 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse()
141 if (XE_IOCTL_DBG(xe, !sync->fence)) in xe_sync_entry_parse()
156 sync->syncobj = drm_syncobj_find(xef->drm, sync_in.handle); in xe_sync_entry_parse()
157 if (XE_IOCTL_DBG(xe, !sync->syncobj)) in xe_sync_entry_parse()
161 sync->chain_fence = dma_fence_chain_alloc(); in xe_sync_entry_parse()
162 if (!sync->chain_fence) in xe_sync_entry_parse()
165 sync->fence = drm_syncobj_fence_get(sync->syncobj); in xe_sync_entry_parse()
166 if (XE_IOCTL_DBG(xe, !sync->fence)) in xe_sync_entry_parse()
169 err = dma_fence_chain_find_seqno(&sync->fence, in xe_sync_entry_parse()
187 sync->addr = sync_in.addr; in xe_sync_entry_parse()
189 sync->ufence = user_fence_create(xe, sync_in.addr, in xe_sync_entry_parse()
191 if (XE_IOCTL_DBG(xe, IS_ERR(sync->ufence))) in xe_sync_entry_parse()
192 return PTR_ERR(sync->ufence); in xe_sync_entry_parse()
201 sync->type = sync_in.type; in xe_sync_entry_parse()
202 sync->flags = sync_in.flags; in xe_sync_entry_parse()
203 sync->timeline_value = sync_in.timeline_value; in xe_sync_entry_parse()
208 int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job) in xe_sync_entry_add_deps() argument
210 if (sync->fence) in xe_sync_entry_add_deps()
212 dma_fence_get(sync->fence)); in xe_sync_entry_add_deps()
217 void xe_sync_entry_signal(struct xe_sync_entry *sync, struct dma_fence *fence) in xe_sync_entry_signal() argument
219 if (!(sync->flags & DRM_XE_SYNC_FLAG_SIGNAL)) in xe_sync_entry_signal()
222 if (sync->chain_fence) { in xe_sync_entry_signal()
223 drm_syncobj_add_point(sync->syncobj, sync->chain_fence, in xe_sync_entry_signal()
224 fence, sync->timeline_value); in xe_sync_entry_signal()
229 sync->chain_fence = NULL; in xe_sync_entry_signal()
230 } else if (sync->syncobj) { in xe_sync_entry_signal()
231 drm_syncobj_replace_fence(sync->syncobj, fence); in xe_sync_entry_signal()
232 } else if (sync->ufence) { in xe_sync_entry_signal()
236 user_fence_get(sync->ufence); in xe_sync_entry_signal()
237 err = dma_fence_add_callback(fence, &sync->ufence->cb, in xe_sync_entry_signal()
240 kick_ufence(sync->ufence, fence); in xe_sync_entry_signal()
243 user_fence_put(sync->ufence); in xe_sync_entry_signal()
249 void xe_sync_entry_cleanup(struct xe_sync_entry *sync) in xe_sync_entry_cleanup() argument
251 if (sync->syncobj) in xe_sync_entry_cleanup()
252 drm_syncobj_put(sync->syncobj); in xe_sync_entry_cleanup()
253 dma_fence_put(sync->fence); in xe_sync_entry_cleanup()
254 dma_fence_chain_free(sync->chain_fence); in xe_sync_entry_cleanup()
255 if (sync->ufence) in xe_sync_entry_cleanup()
256 user_fence_put(sync->ufence); in xe_sync_entry_cleanup()
261 * @sync: input syncs
274 xe_sync_in_fence_get(struct xe_sync_entry *sync, int num_sync, in xe_sync_in_fence_get() argument
286 if (sync[i].fence) { in xe_sync_in_fence_get()
288 fence = sync[i].fence; in xe_sync_in_fence_get()
303 if (sync[i].fence) { in xe_sync_in_fence_get()
304 dma_fence_get(sync[i].fence); in xe_sync_in_fence_get()
305 fences[current_fence++] = sync[i].fence; in xe_sync_in_fence_get()
345 * xe_sync_ufence_get() - Get user fence from sync
346 * @sync: input sync
348 * Get a user fence reference from sync.
352 struct xe_user_fence *xe_sync_ufence_get(struct xe_sync_entry *sync) in xe_sync_ufence_get() argument
354 user_fence_get(sync->ufence); in xe_sync_ufence_get()
356 return sync->ufence; in xe_sync_ufence_get()