panthor_heap.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 or MIT */
  2. /* Copyright 2023 Collabora ltd. */
  3. #ifndef __PANTHOR_HEAP_H__
  4. #define __PANTHOR_HEAP_H__
  5. #include <linux/types.h>
  6. struct panthor_device;
  7. struct panthor_heap_pool;
  8. struct panthor_vm;
  9. int panthor_heap_create(struct panthor_heap_pool *pool,
  10. u32 initial_chunk_count,
  11. u32 chunk_size,
  12. u32 max_chunks,
  13. u32 target_in_flight,
  14. u64 *heap_ctx_gpu_va,
  15. u64 *first_chunk_gpu_va);
  16. int panthor_heap_destroy(struct panthor_heap_pool *pool, u32 handle);
  17. struct panthor_heap_pool *
  18. panthor_heap_pool_create(struct panthor_device *ptdev, struct panthor_vm *vm);
  19. void panthor_heap_pool_destroy(struct panthor_heap_pool *pool);
  20. struct panthor_heap_pool *
  21. panthor_heap_pool_get(struct panthor_heap_pool *pool);
  22. void panthor_heap_pool_put(struct panthor_heap_pool *pool);
  23. size_t panthor_heap_pool_size(struct panthor_heap_pool *pool);
  24. int panthor_heap_grow(struct panthor_heap_pool *pool,
  25. u64 heap_gpu_va,
  26. u32 renderpasses_in_flight,
  27. u32 pending_frag_count,
  28. u64 *new_chunk_gpu_va);
  29. int panthor_heap_return_chunk(struct panthor_heap_pool *pool,
  30. u64 heap_gpu_va,
  31. u64 chunk_gpu_va);
  32. #endif