drm_suballoc_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_suballoc_insert(9)

okay so this is a page from the Kernel API Manual β€” it's the drm_suballoc_insert(9) manual, and we are literally about to make it make sense 🫢

TL;DR: initialize a suballocation and insert a hole. That's the whole vibe. ✨


πŸŽ€ SYNOPSIS πŸŽ€

int drm_suballoc_insert (struct drm_suballoc_manager *sa_manager ,
struct drm_suballoc *sa , size_t size , bool intr , size_t align );

no cap, that's the signature, copy it exactly bestie πŸ’…


🌸 ARGUMENTS 🌸

  • sa_manager β€” pointer to the sa_manager. your manager. the one in charge πŸ‘‘
  • sa β€” The struct drm_suballoc. yes that one πŸŽ€
  • size β€” number of bytes we want to suballocate. how much you're claiming, in bytes 🌈
  • intr β€” Whether to perform waits interruptible. and listen, this should typically always be true ⚠️ β€” the only exception is if the caller needs to propagate a non-interruptible context from above layers. so like, don't just set it to false for funsies 😭
  • align β€” Alignment. Must not exceed the default manager alignment, fr fr. If align is zero, then the manager alignment is used. zero = "you pick for me" energy πŸ¦‹

✨ DESCRIPTION ✨

Try to make a suballocation on a pre-allocated suballoc object of size size β€” and that size will be rounded up to the alignment specified in drm_suballoc_manager_init. it's giving "close enough, we'll pad it" πŸ’€βœ¨


πŸ”₯ RETURN πŸ”₯

zero on success, errno on failure. so if you get 0, you ate. if you get an errno, that's your sign to go read the errno 🌸


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/gpu/drm/drm_suballoc.c β€” go read the source, iykyk πŸ‘‘


bestie reminder: align must not exceed the default manager alignment. that's not a suggestion, that's a rule πŸ’…

okay that's the whole page!! mwah πŸ’– this one came from ./drivers/gpu/drm, dated October 2026 β€” go forth and suballocate responsibly, you're gonna slay πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from