drm_gpuvm_prepare_vm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gpuvm_prepare_vm(9) β€” a Kernel API Manual moment

okay so bestie, this is a page from the Kernel API Manual, and it's literally all about drm_gpuvm_prepare_vm(9) β€” the little function that gets your GPUVMs common dma-resv ready to go. no cap, it's giving "quietly essential" energy. πŸŽ€


✨ SYNOPSIS ✨

int drm_gpuvm_prepare_vm (struct drm_gpuvm *gpuvm , struct drm_exec
*exec , unsigned int num_fences );

🫢 ARGUMENTS 🫢

  • gpuvm β€” the drm_gpuvm, aka the whole reason we're here 🌸
  • exec β€” the drm_exec context, your trusty little locking sidekick
  • num_fences β€” the amount of dma_fences to reserve. yes, the actual count. be honest with it πŸ’–

πŸ’… DESCRIPTION πŸ’…

So here's the tea: this calls drm_exec_prepare_obj for the GPUVMs dummy drm_gem_object. that's the whole vibe. ✨

but wait β€” if num_fences is zero, it calls drm_exec_lock_obj instead. plot twist, lowkey iconic. πŸ”₯

⚠️ and listen: if you're using this function directly, it is the driver's responsibility to call drm_exec_init and drm_exec_fini accordingly. like, nobody's gonna do it for you, bestie. that's your job. πŸ™ˆ

🌈 RETURN 🌈

0 on success, negative error code on failure. that's it. that's the whole mood. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

buckle up, this list is long and we're NOT skipping a single one, periodt:

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_objects(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)


🧚 that's the whole page, bestie. go forth and prepare those VMs. πŸ’œ

signed, sealed, delivered from ./drivers/gpu/drm β€” dated October 2026, and it's drm_gpuvm_prepare_vm(9) all the way down. mwah πŸ’‹

πŸ“¦ where this page comes from