i915_ttm_buddy_man_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ i915_ttm_buddy_man_init(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸŽ€ β€” this one's i915_ttm_buddy_man_init, and it's literally the glow-up ritual that sets up a buddy-allocator-based ttm manager. think of it as matchmaking your memory blocks with their perfect power-of-two soulmates πŸ’–


🌸 NAME 🌸

i915_ttm_buddy_man_init β€” setup buddy allocator based ttm manager


πŸ¦‹ SYNOPSIS πŸ¦‹

int i915_ttm_buddy_man_init (struct ttm_device *bdev , unsigned int type
, bool use_tt , u64 size , u64 visible_size , u64 default_page_size ,
u64 chunk_size );

πŸ’… ARGUMENTS πŸ’…

  • bdev β€” the ttm device, aka the main character we're setting all this up for πŸ‘‘
  • type β€” the memory type we wanna manage. pick your lane fr
  • use_tt β€” sets use_tt for the manager. yes, that's the whole vibe check ✨
  • size β€” the size in bytes to manage
  • visible_size β€” the CPU visible size in bytes to manage. it's giving "what you can actually see from here" πŸ‘€
  • default_page_size β€” the default minimum page size in bytes for allocations. lowkey important: this must be at least as large as chunk_size, and it can be overridden by setting the BO page_alignment, to be larger or smaller as needed. so flexible, so iconic πŸ’«
  • chunk_size β€” the minimum page size in bytes for our allocations, i.e. order-zero. the tiny little starter block πŸ“

🌈 DESCRIPTION 🌈

okay so first thing, bestie: the starting address is assumed to be zero here. not me just deciding that πŸ™ˆ β€” it's because it simplifies keeping the property where allocated blocks have natural power-of-two alignment. so long as the real starting address is some large power-of-two, or naturally starts from zero, then this should be fine ✨

also, the i915_ttm_buddy_man_reserve interface can be used to preserve alignment if, say, there's some unusable range from the start of the region. we can revisit this in the future and make the interface accept an actual starting offset and let it take care of the rest. future plans, bestie πŸ’…

heads up 🫢 β€” if the size is not aligned to the chunk_size, then we perform the required rounding to get the usable size. so it's not an error, it's just a little makeover. the final size in pages can be taken from ttm_resource_manager.size ⭐

πŸ”₯ RETURN πŸ”₯

0 on success, negative error code on failure. slay or don't, no in-between πŸ’€


🧚 SEE ALSO 🧚


and that's the whole page, bestie πŸ’œ this lil number lives in ./drivers/gpu/drm/i915, dated October 2026, in the Kernel API Manual β€” so you know it's official. periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from