drm_gpuvm_sm_unmap(9)
πΈ drm_gpuvm_sm_unmap(9) β Kernel API Manual πΈ
okay so bestie, we're in the kernel API manual today, and this one is called drm_gpuvm_sm_unmap. Buckle up π
β¨ NAME β¨
drm_gpuvm_sm_unmap β calls the &drm_gpuva_ops to split on unmap π
π¦ SYNOPSIS π¦
int drm_gpuvm_sm_unmap (struct drm_gpuvm *gpuvm , void *priv , u64
req_addr , u64 req_range );
like, that's the whole signature. iykyk β¨
π ARGUMENTS π
gpuvmβ thedrm_gpuvmrepresenting the GPU VA space, the main character πprivβ pointer to a driver private data structure, your little secret stash πreq_addrβ the start address of the range to unmap βreq_rangeβ the range of the mappings to unmap, so like how much we're clearing out π
π DESCRIPTION π
so this function iterates the given range of the GPU VA space, no biggie. it utilizes the drm_gpuvm_ops to call back into the driver with the operations to unmap and, if required, split existing mappings. the way that it just handles all of it for you?? obsessed π«Ά
Drivers may use these callbacks to update the GPU VA space right away within the callback β super convenient, lowkey iconic. But here's the important bit, bestie, listen up β οΈ: in case the driver decides to copy and store the operations for later processing, neither this function nor drm_gpuvm_sm_map is allowed to be called before the drm_gpuvm's view of the GPU VA space was updated with the previous set of operations. like, that's the rule. no cap. To update the drm_gpuvm's view of the GPU VA space, drm_gpuva_insert, drm_gpuva_destroy_locked and/or drm_gpuva_destroy_unlocked should be used. those are your girls for that job π
A sequence of callbacks can contain unmap and remap operations, depending on whether there are actual overlapping mappings to split. so like sometimes it's just unmaps, sometimes it's unmaps and remaps. depends on the vibe check π₯
There can be an arbitrary amount of unmap operations and a maximum of two remap operations. arbitrary! but max two. remember that β¨
β RETURN β
0 on success or a negative error code. slay when it's 0 π
πΈ SEE ALSO πΈ
Kernel file ./drivers/gpu/drm/drm_gpuvm.c β plus the entire friend group, all of (9) fame π«Ά:
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_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)
this page lives in./drivers/gpu/drmand it's dated October 2026 π go read the wholedrm_gpuvm.cfile, it's giving main character energy, fr fr π§π
k bye bestie, ily, go unmap responsibly π β¨π
π¦ 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