Files
android_kernel_samsung_sm8750/include/linux/qcom_tvm_heap.h
2025-08-11 14:29:00 +02:00

36 lines
990 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _QCOM_TVM_HEAP_H
#define _QCOM_TVM_HEAP_H
#include <linux/mem-buf.h>
struct platform_heap;
#ifdef CONFIG_QCOM_DMABUF_HEAPS_TVM_CARVEOUT
int qcom_tvm_carveout_heap_create(struct platform_heap *heap_data);
int qcom_tvm_heap_add_pool_fd(struct mem_buf_allocation_data *alloc_data);
void *qcom_tvm_heap_add_kernel_pool(struct dma_heap *heap, size_t size);
void qcom_tvm_heap_remove_kernel_pool(void *handle);
#else
static inline int qcom_tvm_carveout_heap_create(struct platform_heap *heap_data)
{
return -EINVAL;
}
static inline int qcom_tvm_heap_add_pool_fd(struct mem_buf_allocation_data *alloc_data)
{
return -EINVAL;
}
static inline void *qcom_tvm_heap_add_kernel_pool(struct dma_heap *heap, size_t size)
{
return ERR_PTR(-EINVAL);
}
static inline void qcom_tvm_heap_remove_kernel_pool(void *handle) {}
#endif
#endif /* _QCOM_TVM_HEAP_H */