drm_gpuvm_s...p_ops_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the drm_gpuvm that's representing the GPU VA space, aka our main character πŸ‘‘
  • req_addr β€” the start address of the range you wanna unmap, fr fr
  • req_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 the drm_gpuvm's view of the GPU VA space first. The operations you previously obtained must be processed or abandoned. And to update the drm_gpuvm's view of the GPU VA space, you should use drm_gpuva_insert, drm_gpuva_destroy_locked and/or drm_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:


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