• Home
  • Raw
  • Download

Lines Matching refs:syncobj

212 static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj,
226 struct drm_syncobj *syncobj; in drm_syncobj_find() local
231 syncobj = idr_find(&file_private->syncobj_idr, handle); in drm_syncobj_find()
232 if (syncobj) in drm_syncobj_find()
233 drm_syncobj_get(syncobj); in drm_syncobj_find()
237 return syncobj; in drm_syncobj_find()
241 static void drm_syncobj_fence_add_wait(struct drm_syncobj *syncobj, in drm_syncobj_fence_add_wait() argument
249 spin_lock(&syncobj->lock); in drm_syncobj_fence_add_wait()
254 fence = dma_fence_get(rcu_dereference_protected(syncobj->fence, 1)); in drm_syncobj_fence_add_wait()
257 list_add_tail(&wait->node, &syncobj->cb_list); in drm_syncobj_fence_add_wait()
263 spin_unlock(&syncobj->lock); in drm_syncobj_fence_add_wait()
266 static void drm_syncobj_remove_wait(struct drm_syncobj *syncobj, in drm_syncobj_remove_wait() argument
272 spin_lock(&syncobj->lock); in drm_syncobj_remove_wait()
274 spin_unlock(&syncobj->lock); in drm_syncobj_remove_wait()
286 void drm_syncobj_add_point(struct drm_syncobj *syncobj, in drm_syncobj_add_point() argument
296 spin_lock(&syncobj->lock); in drm_syncobj_add_point()
298 prev = drm_syncobj_fence_get(syncobj); in drm_syncobj_add_point()
303 rcu_assign_pointer(syncobj->fence, &chain->base); in drm_syncobj_add_point()
305 list_for_each_entry_safe(cur, tmp, &syncobj->cb_list, node) in drm_syncobj_add_point()
306 syncobj_wait_syncobj_func(syncobj, cur); in drm_syncobj_add_point()
307 spin_unlock(&syncobj->lock); in drm_syncobj_add_point()
322 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, in drm_syncobj_replace_fence() argument
331 spin_lock(&syncobj->lock); in drm_syncobj_replace_fence()
333 old_fence = rcu_dereference_protected(syncobj->fence, in drm_syncobj_replace_fence()
334 lockdep_is_held(&syncobj->lock)); in drm_syncobj_replace_fence()
335 rcu_assign_pointer(syncobj->fence, fence); in drm_syncobj_replace_fence()
338 list_for_each_entry_safe(cur, tmp, &syncobj->cb_list, node) in drm_syncobj_replace_fence()
339 syncobj_wait_syncobj_func(syncobj, cur); in drm_syncobj_replace_fence()
342 spin_unlock(&syncobj->lock); in drm_syncobj_replace_fence()
354 static int drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj) in drm_syncobj_assign_null_handle() argument
361 drm_syncobj_replace_fence(syncobj, fence); in drm_syncobj_assign_null_handle()
387 struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); in drm_syncobj_find_fence() local
392 if (!syncobj) in drm_syncobj_find_fence()
404 *fence = drm_syncobj_fence_get(syncobj); in drm_syncobj_find_fence()
430 drm_syncobj_fence_add_wait(syncobj, &wait); in drm_syncobj_find_fence()
455 drm_syncobj_remove_wait(syncobj, &wait); in drm_syncobj_find_fence()
458 drm_syncobj_put(syncobj); in drm_syncobj_find_fence()
472 struct drm_syncobj *syncobj = container_of(kref, in drm_syncobj_free() local
475 drm_syncobj_replace_fence(syncobj, NULL); in drm_syncobj_free()
476 kfree(syncobj); in drm_syncobj_free()
496 struct drm_syncobj *syncobj; in drm_syncobj_create() local
498 syncobj = kzalloc(sizeof(struct drm_syncobj), GFP_KERNEL); in drm_syncobj_create()
499 if (!syncobj) in drm_syncobj_create()
502 kref_init(&syncobj->refcount); in drm_syncobj_create()
503 INIT_LIST_HEAD(&syncobj->cb_list); in drm_syncobj_create()
504 spin_lock_init(&syncobj->lock); in drm_syncobj_create()
507 ret = drm_syncobj_assign_null_handle(syncobj); in drm_syncobj_create()
509 drm_syncobj_put(syncobj); in drm_syncobj_create()
515 drm_syncobj_replace_fence(syncobj, fence); in drm_syncobj_create()
517 *out_syncobj = syncobj; in drm_syncobj_create()
534 struct drm_syncobj *syncobj, u32 *handle) in drm_syncobj_get_handle() argument
539 drm_syncobj_get(syncobj); in drm_syncobj_get_handle()
543 ret = idr_alloc(&file_private->syncobj_idr, syncobj, 1, 0, GFP_NOWAIT); in drm_syncobj_get_handle()
549 drm_syncobj_put(syncobj); in drm_syncobj_get_handle()
562 struct drm_syncobj *syncobj; in drm_syncobj_create_as_handle() local
564 ret = drm_syncobj_create(&syncobj, flags, NULL); in drm_syncobj_create_as_handle()
568 ret = drm_syncobj_get_handle(file_private, syncobj, handle); in drm_syncobj_create_as_handle()
569 drm_syncobj_put(syncobj); in drm_syncobj_create_as_handle()
576 struct drm_syncobj *syncobj; in drm_syncobj_destroy() local
579 syncobj = idr_remove(&file_private->syncobj_idr, handle); in drm_syncobj_destroy()
582 if (!syncobj) in drm_syncobj_destroy()
585 drm_syncobj_put(syncobj); in drm_syncobj_destroy()
591 struct drm_syncobj *syncobj = file->private_data; in drm_syncobj_file_release() local
593 drm_syncobj_put(syncobj); in drm_syncobj_file_release()
610 int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd) in drm_syncobj_get_fd() argument
621 syncobj, 0); in drm_syncobj_get_fd()
627 drm_syncobj_get(syncobj); in drm_syncobj_get_fd()
638 struct drm_syncobj *syncobj = drm_syncobj_find(file_private, handle); in drm_syncobj_handle_to_fd() local
641 if (!syncobj) in drm_syncobj_handle_to_fd()
644 ret = drm_syncobj_get_fd(syncobj, p_fd); in drm_syncobj_handle_to_fd()
645 drm_syncobj_put(syncobj); in drm_syncobj_handle_to_fd()
652 struct drm_syncobj *syncobj; in drm_syncobj_fd_to_handle() local
665 syncobj = f.file->private_data; in drm_syncobj_fd_to_handle()
666 drm_syncobj_get(syncobj); in drm_syncobj_fd_to_handle()
670 ret = idr_alloc(&file_private->syncobj_idr, syncobj, 1, 0, GFP_NOWAIT); in drm_syncobj_fd_to_handle()
678 drm_syncobj_put(syncobj); in drm_syncobj_fd_to_handle()
688 struct drm_syncobj *syncobj; in drm_syncobj_import_sync_file_fence() local
693 syncobj = drm_syncobj_find(file_private, handle); in drm_syncobj_import_sync_file_fence()
694 if (!syncobj) { in drm_syncobj_import_sync_file_fence()
699 drm_syncobj_replace_fence(syncobj, fence); in drm_syncobj_import_sync_file_fence()
701 drm_syncobj_put(syncobj); in drm_syncobj_import_sync_file_fence()
754 struct drm_syncobj *syncobj = ptr; in drm_syncobj_release_handle() local
756 drm_syncobj_put(syncobj); in drm_syncobj_release_handle()
949 static void syncobj_wait_syncobj_func(struct drm_syncobj *syncobj, in syncobj_wait_syncobj_func() argument
955 fence = rcu_dereference_protected(syncobj->fence, in syncobj_wait_syncobj_func()
956 lockdep_is_held(&syncobj->lock)); in syncobj_wait_syncobj_func()