qcom_tui_heap.h 990 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef _QCOM_TUI_HEAP_H
  6. #define _QCOM_TUI_HEAP_H
  7. #include <linux/mem-buf.h>
  8. struct platform_heap;
  9. #ifdef CONFIG_QCOM_DMABUF_HEAPS_TUI_CARVEOUT
  10. int qcom_tui_carveout_heap_create(struct platform_heap *heap_data);
  11. int qcom_tui_heap_add_pool_fd(struct mem_buf_allocation_data *alloc_data);
  12. void *qcom_tvm_heap_add_kernel_pool(struct dma_heap *heap, size_t size);
  13. void qcom_tvm_heap_remove_kernel_pool(void *handle);
  14. #else
  15. static inline int qcom_tui_carveout_heap_create(struct platform_heap *heap_data)
  16. {
  17. return -EINVAL;
  18. }
  19. static inline int qcom_tui_heap_add_pool_fd(struct mem_buf_allocation_data *alloc_data)
  20. {
  21. return -EINVAL;
  22. }
  23. static inline void *qcom_tvm_heap_add_kernel_pool(struct dma_heap *heap, size_t size)
  24. {
  25. return ERR_PTR(-EINVAL);
  26. }
  27. static inline void qcom_tvm_heap_remove_kernel_pool(void *handle) {}
  28. #endif
  29. #endif /* _QCOM_TUI_HEAP_H */