drm_gpuvm_prepare_objects(9)
π NAME π
okay bestie, meet drm_gpuvm_prepare_objects(9) β it's from the Kernel API Manual, and its whole job is prepare all associated BOs. no cap. π
β¨ SYNOPSIS β¨
int drm_gpuvm_prepare_objects (struct drm_gpuvm *gpuvm , struct drm_exec
*exec , unsigned int num_fences );
π«Ά ARGUMENTS π«Ά
gpuvmβ thedrm_gpuvm. that's the main character here.execβ thedrm_execlocking context. the locking situation.num_fencesβ the amount ofdma_fencesto reserve. yes, reserve.
π§ DESCRIPTION π§
So this one calls drm_exec_prepare_obj for all the drm_gem_objects that the given drm_gpuvm contains mappings of. literally all of them. π₯
If num_fences is zero, then drm_exec_lock_obj is called instead. plot twist, but make it locking. π
Using this function directly means the drivers have the responsibility to call drm_exec_init and drm_exec_fini accordingly. like, you gotta handle your own setup and cleanup, bestie. π«Ά
β οΈ NOTE β οΈ
This function is safe against concurrent insertion and removal of external objects. yay for that. π
But it is not safe against concurrent usage itself. nope. π
Drivers need to make sure to protect this case with either an outer VM lock, or by calling drm_gpuvm_prepare_vm before this function within the drm_exec_until_all_locked loop, such that the GPUVM's dma-resv lock ensures mutual exclusion. that's the whole mutual-exclusion moment. periodt. π
π RETURN π
0 on success, negative error code on failure. slay when zero, sad little negative when not. π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_gpuvm.c Overview(9)Split and Merge(9)Madvise Logic - Splitting and Traversal(9)Locking(9)Examples(9)get_next_vm_bo_from_list(9)for_each_vm_bo_in_list(9)restore_vm_bo_list(9)drm_gpuvm_bo_is_zombie(9)drm_gpuvm_bo_list_add(9)drm_gpuvm_bo_list_del_init(9)drm_gpuvm_bo_list_del(9)drm_gpuvm_range_valid(9)drm_gpuvm_resv_object_alloc(9)drm_gpuvm_init(9)drm_gpuvm_put(9)drm_gpuvm_prepare_vm(9)drm_gpuvm_prepare_range(9)drm_gpuvm_exec_lock(9)drm_gpuvm_exec_lock_array(9)drm_gpuvm_exec_lock_range(9)drm_gpuvm_validate(9)drm_gpuvm_resv_add_fence(9)drm_gpuvm_bo_create(9)drm_gpuvm_bo_put(9)drm_gpuvm_bo_put_deferred(9)drm_gpuvm_bo_deferred_cleanup(9)drm_gpuvm_bo_find(9)drm_gpuvm_bo_obtain_locked(9)drm_gpuvm_bo_obtain_prealloc(9)drm_gpuvm_bo_extobj_add(9)drm_gpuvm_bo_evict(9)drm_gpuva_insert(9)drm_gpuva_remove(9)drm_gpuva_link(9)drm_gpuva_unlink(9)drm_gpuva_unlink_defer(9)drm_gpuva_find_first(9)drm_gpuva_find(9)drm_gpuvm_interval_empty(9)drm_gpuva_map(9)drm_gpuva_remap(9)drm_gpuva_unmap(9)drm_gpuvm_sm_map(9)drm_gpuvm_sm_unmap(9)drm_gpuvm_sm_map_exec_lock(9)drm_gpuvm_sm_unmap_exec_lock(9)drm_gpuvm_sm_map_ops_create(9)drm_gpuvm_madvise_ops_create(9)drm_gpuvm_sm_unmap_ops_create(9)drm_gpuvm_prefetch_ops_create(9)drm_gpuvm_bo_unmap_ops_create(9)drm_gpuva_ops_free(9)
mwah π this little page comes from ./drivers/gpu/drm, dated October 2026, and signs off as drm_gpuvm_prepare_objects(9). bye bestie, go prepare those BOs πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms