panthor_heap_create(9)
π panthor_heap_create(9) β Create a heap context π
okay so bestie, welcome to the Kernel API Manual, section 9 β¨ this one's all about panthor_heap_create β the little function that spins up a brand-new heap context from a pool you already have lying around. it's giving "let me birth a heap for u" energy, and honestly? iconic. π
πΈ SYNOPSIS πΈ
int panthor_heap_create (struct panthor_heap_pool *pool , u32
initial_chunk_count , u32 chunk_size , u32 max_chunks , u32
target_in_flight , u64 *heap_ctx_gpu_va , u64 *first_chunk_gpu_va );
like, yes, that's a lot of arguments. breathe. we'll get through them together, i promise π«Ά
π¦ ARGUMENTS π¦
poolβ the pool you're instantiating this heap context from. your source of heap-y goodness, your main character origin story πinitial_chunk_countβ how many chunks get allocated at initialization time. and bestie, it must be at least1. not zero. not negative. one or more. the math is mathing π₯chunk_sizeβ the size of each chunk. two very important vibe checks here: it must be page-aligned, and it has to lie in the[128k:8M]range. don't try to sneak outside that window, it's not gonna slay πmax_chunksβ the maximum number of chunks that can be allocated. the ceiling. the limit. the "know your bounds" moment πtarget_in_flightβ the maximum number of in-flight render passes. that's the target, and yes, "in-flight" is the exact terminology, iykyk β¨heap_ctx_gpu_vaβ a pointer that holds the GPU address of the allocated heap context. so like, it's a pointer to a place that holds the address. very pointer-inception, very πfirst_chunk_gpu_vaβ a pointer holding the GPU address of the first chunk assigned to the heap context. the first one!! the opener!! the main character chunk π₯
π RETURN π
- a positive handle on success β slay, it worked π
- a negative error otherwise β sad girl hours, something went wrong π
β SEE ALSO β
go read these next, bestie, they're all in the kernel file ./drivers/gpu/drm/panthor/panthor_heap.c fr fr:
- struct
panthor_heap_chunk_header(9) - struct
panthor_heap_chunk(9) - struct
panthor_heap(9) - struct
panthor_heap_pool(9) panthor_heap_destroy(9)panthor_heap_return_chunk(9)panthor_heap_grow(9)panthor_heap_pool_put(9)panthor_heap_pool_get(9)panthor_heap_pool_create(9)panthor_heap_pool_destroy(9)panthor_heap_pool_size(9)
like, that's the whole friend group right there π«Άβ¨
quick reminder:initial_chunk_countmust be at least 1, andchunk_sizemust be page-aligned and inside[128k:8M]. break those rules and it's not giving success, it's giving negative error π
and that's the page, bestie!! brought to you by ./drivers/gpu/drm/panthor, dated October 2026 β the panthor_heap_create(9) era, and we ate π
πβ¨
π¦ 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