drm_gpuvm_sm_unmap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 β€” the drm_gpuvm representing 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 🫢:


this page lives in ./drivers/gpu/drm and it's dated October 2026 πŸ“… go read the whole drm_gpuvm.c file, it's giving main character energy, fr fr πŸ§šπŸ’–

k bye bestie, ily, go unmap responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from