drm_vma_offset_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_vma_offset_add(9) πŸ’…

okay so bestie, we're in the Kernel API Manual today and this page is literally called drm_vma_offset_add(9) β€” a whole little function about adding offset nodes to a manager. stay with me, it's gonna slay 🫢


✨ NAME ✨

drm_vma_offset_add β€” add an offset node to the manager, no cap πŸŽ€


✨ SYNOPSIS ✨

int drm_vma_offset_add (struct drm_vma_offset_manager *mgr , struct
       drm_vma_offset_node *node , unsigned long pages );

yes that's the whole signature, write it down, it's iconic ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mgr β€” the manager object itself. the main character of this whole operation πŸ‘‘
  • node β€” the node you're adding. like, the thing that's about to be added πŸ’…
  • pages β€” the allocation size that user-space actually gets to see, measured in number of pages. not bytes, bestie, pages πŸ“

🌸 DESCRIPTION 🌸

okay so the whole vibe here: you're adding a node to the offset-manager. that's it, that's the function πŸŽ€

if the node was already added, this does absolutely nothing and returns 0. like, no drama, no error, just a chill "already handled it" situation πŸ™ˆ

pages is the size of the object, given in number of pages. and after this call succeeds? you can access the offset of the node until it is removed again. so keep that in mind, because that access window is real πŸ¦‹

now, if this call fails, it's totally safe to either retry the operation or call drm_vma_offset_remove β€” whichever you feel like. and the best part? there's no cleanup required in that case. none. zero. you're free πŸ’€

one more thing that lowkey matters a lot: pages is not required to be the same size as the underlying memory object you want to map. it only limits the size that user-space can map into their own address space. so it's a cap, not a mirror ⭐


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slay ✨
  • a negative error code on failure β€” not slay 😭

πŸ’œ SEE ALSO πŸ’œ


fr fr go read those if you want the full lore, iykyk πŸ“š

and that's the page bestie! this whole thing lives in ./drivers/gpu/drm and the manual is dated October 2026 β€” so yes, it's from the future and still eating πŸ’…πŸ«Ά see you in the next man page ⭐

πŸ“¦ where this page comes from