i915_gem_gtt_reserve(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the struct i915_address_space πŸ‘‘ that's your address space, the whole vibe zone
  • ww β€” an optional struct i915_gem_ww_ctx. optional!! she can be NULL, it's fine πŸ™ˆ
  • node β€” the struct drm_mm_node (typically i915_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_SIZE aligned ⭐ don't forget, alignment is not optional here
  • offset β€” where to insert inside the GTT. must be #I915_GTT_MIN_ALIGNMENT aligned, and the node (offset + size) must fit within the address space πŸ“ like do the math first bestie, it has to fit
  • color β€” color to apply to node. ok and this is important: if this node is not from a VMA, color must be #I915_COLOR_UNEVICTABLE πŸ”₯ no exceptions
  • flags β€” 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