i915_gem_gtt_reserve(9)
β¨ i915_gem_gtt_reserve(9) β¨
okay so bestie, welcome to the Kernel API Manual page for i915_gem_gtt_reserve π
this is the one that literally reserves you a spot in the GTT, no cap π
π NAME π
i915_gem_gtt_reserve β reserve a node in an address_space (GTT) π¦
πΈ SYNOPSIS πΈ
int i915_gem_gtt_reserve (struct i915_address_space *vm , struct
i915_gem_ww_ctx *ww , struct drm_mm_node *node , u64 size , u64 offset ,
unsigned long color , unsigned int flags );
like, that's the whole signature, slay β¨
π ARGUMENTS π
vmβ thestruct i915_address_spaceπ that's your address space, the whole vibe zonewwβ an optionalstruct i915_gem_ww_ctx. optional!! she can beNULL, it's fine πnodeβ thestruct drm_mm_node(typicallyi915_vma.node) β the actual lil node you're placing πsizeβ how much space to allocate inside the GTT, and it must be#I915_GTT_PAGE_SIZEaligned β don't forget, alignment is not optional hereoffsetβ where to insert inside the GTT. must be#I915_GTT_MIN_ALIGNMENTaligned, and the node (offset + size) must fit within the address space π like do the math first bestie, it has to fitcolorβ color to apply to node. ok and this is important: if this node is not from a VMA,colormust be#I915_COLOR_UNEVICTABLEπ₯ no exceptionsflagsβ control search and eviction behaviour π§
π DESCRIPTION π
so i915_gem_gtt_reserve tries to insert the node at the exact offset inside the address space (using size and color) π― like, precise placement, main character energy.
if the node does not fit, she tries to evict any overlapping nodes from the GTT β including any neighbouring nodes if the colors do not match (this is to ensure guard pages between differing domains, iykyk) π see i915_gem_evict_for_node for the gory details on the eviction algorithm π»
#PIN_NONBLOCK may be used to prevent waiting on evicting active overlapping objects π«Ά
and heads up β any overlapping node that is pinned or marked as unevictable will also result in failure π like she simply cannot move those, periodt.
π RETURN π
0β on success π yay-ENOSPCβ if no suitable hole is found π³οΈπ-EINTRβ if asked to wait for eviction and interrupted β
π¦ SEE ALSO π¦
Kernel file ./drivers/gpu/drm/i915/i915_gem_gtt.c and i915_gem_gtt_insert(9) π go read those too, they're lowkey iconic
ok that's the whole page bestie, you're officially certified in GTT node reservation π β¨
and finally, the cute sign-off: this whole thing lives over at ./drivers/gpu/drm/i915, it's from October 2026, and yeah β the manual name is i915_gem_gtt_reserve(9) in case you forgot already ππ see u at the next manpage π«Ά
π¦ 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