1 /* SPDX-License-Identifier: GPL-2.0 */
3 * DMABUF Heaps Allocation Infrastructure
5 * Copyright (C) 2011 Google, Inc.
6 * Copyright (C) 2019 Linaro Ltd.
12 #include <linux/types.h>
17 * struct dma_heap_ops - ops to operate on a given heap
18 * @allocate: allocate dmabuf and return struct dma_buf ptr
20 * allocate returns dmabuf on success, ERR_PTR(-errno) on error.
23 struct dma_buf
*(*allocate
)(struct dma_heap
*heap
,
30 * struct dma_heap_export_info - information needed to export a new dmabuf heap
31 * @name: used for debugging/device-node name
32 * @ops: ops struct for this heap
33 * @priv: heap exporter private data
35 * Information needed to export a new dmabuf heap.
37 struct dma_heap_export_info
{
39 const struct dma_heap_ops
*ops
;
43 void *dma_heap_get_drvdata(struct dma_heap
*heap
);
45 const char *dma_heap_get_name(struct dma_heap
*heap
);
47 struct dma_heap
*dma_heap_add(const struct dma_heap_export_info
*exp_info
);
49 #endif /* _DMA_HEAPS_H */