drm_gpuvm_s...p_ops_create(9)
β¨ drm_gpuvm_sm_unmap_ops_create(9) β¨
okay so bestie, we're in the Kernel API Manual today and this page is called drm_gpuvm_s...p_ops_create(9) (the title got cutely truncated, the real full name is drm_gpuvm_sm_unmap_ops_create) π
πΈ NAME πΈ
drm_gpuvm_sm_unmap_ops_create β literally creates the &drm_gpuva_ops you need to split stuff on unmap π
π¦ SYNOPSIS π¦
struct drm_gpuva_ops * drm_gpuvm_sm_unmap_ops_create (struct drm_gpuvm
*gpuvm , u64 req_addr , u64 req_range );
π ARGUMENTS π
gpuvmβ thedrm_gpuvmthat's representing the GPU VA space, aka our main character πreq_addrβ the start address of the range you wanna unmap, fr frreq_rangeβ how big the range of mappings to unmap is
π§ DESCRIPTION π§
So what this function does is it creates a whole list of operations to perform the unmapping, and β if it's required β the splitting of the mappings that overlap the unmap range. it's giving "let me handle the messy part" energy π
You can iterate that list with drm_gpuva_for_each_op, and bestie, you must process it in the given order. no shuffling, no skipping, ok? The list can contain both unmap and remap operations, depending on whether there are actual overlapping mappings that need splitting.
You can get an arbitrary amount of unmap operations, but a maximum of two remap operations. that's the cap. two. periodt βοΈ
ok now this part is important, don't scroll past it π β before you call this function again with another range to unmap, you've gotta update thedrm_gpuvm's view of the GPU VA space first. The operations you previously obtained must be processed or abandoned. And to update thedrm_gpuvm's view of the GPU VA space, you should usedrm_gpuva_insert,drm_gpuva_destroy_lockedand/ordrm_gpuva_destroy_unlocked. those are the sanctioned tools, no freestyling π
And once the caller finishes processing the returned drm_gpuva_ops, they must free them with drm_gpuva_ops_free. like, that's not optional, that's a leak if you don't π«Ά
β RETURN β
a pointer to the drm_gpuva_ops on success, or an ERR_PTR on failure. that's it, that's the vibe check π
π₯ SEE ALSO π₯
Kernel file ./drivers/gpu/drm/drm_gpuvm.c β and honestly? the whole extended universe:
- 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_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_prefetch_ops_create(9)
- drm_gpuvm_bo_unmap_ops_create(9)
- drm_gpuva_ops_free(9)
okay that's the page!! π this little gem lives over in ./drivers/gpu/drm, it's from the Kernel API Manual, and it's dated October 2026. go forth and unmap responsibly, bestie β mwah ππ¦β¨
π¦ 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