1 /* SPDX-License-Identifier: GPL-2.0 or MIT */
2 /* Copyright 2023 Collabora ltd. */
4 #ifndef __PANTHOR_HEAP_H__
5 #define __PANTHOR_HEAP_H__
7 #include <linux/types.h>
10 struct panthor_heap_pool;
13 int panthor_heap_create(struct panthor_heap_pool *pool,
14 u32 initial_chunk_count,
19 u64 *first_chunk_gpu_va);
20 int panthor_heap_destroy(struct panthor_heap_pool *pool, u32 handle);
22 struct panthor_heap_pool *
23 panthor_heap_pool_create(struct panthor_device *ptdev, struct panthor_vm *vm);
24 void panthor_heap_pool_destroy(struct panthor_heap_pool *pool);
26 struct panthor_heap_pool *
27 panthor_heap_pool_get(struct panthor_heap_pool *pool);
28 void panthor_heap_pool_put(struct panthor_heap_pool *pool);
30 int panthor_heap_grow(struct panthor_heap_pool *pool,
32 u32 renderpasses_in_flight,
33 u32 pending_frag_count,
34 u64 *new_chunk_gpu_va);
35 int panthor_heap_return_chunk(struct panthor_heap_pool *pool,