i915_ttm_buddy_man_init(9)
β¨ 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 fruse_ttβ setsuse_ttfor the manager. yes, that's the whole vibe check β¨sizeβ the size in bytes to managevisible_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 aschunk_size, and it can be overridden by setting the BOpage_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 thesizeis not aligned to thechunk_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 fromttm_resource_manager.sizeβ
π₯ RETURN π₯
0 on success, negative error code on failure. slay or don't, no in-between π
π§ SEE ALSO π§
- Kernel file
./drivers/gpu/drm/i915/i915_ttm_buddy_manager.c i915_ttm_buddy_man_fini(9)i915_ttm_buddy_man_reserve(9)i915_ttm_buddy_man_visible_size(9)i915_ttm_buddy_man_avail(9)
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
- 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