drm/panel-edp: Add STA 116QHD024002
[drm/drm-misc.git] / include / linux / dma-heap.h
blob27d15f60950a2093e592be1b961c02e672826e58
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * DMABUF Heaps Allocation Infrastructure
5 * Copyright (C) 2011 Google, Inc.
6 * Copyright (C) 2019 Linaro Ltd.
7 */
9 #ifndef _DMA_HEAPS_H
10 #define _DMA_HEAPS_H
12 #include <linux/types.h>
14 struct dma_heap;
16 /**
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.
22 struct dma_heap_ops {
23 struct dma_buf *(*allocate)(struct dma_heap *heap,
24 unsigned long len,
25 u32 fd_flags,
26 u64 heap_flags);
29 /**
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 {
38 const char *name;
39 const struct dma_heap_ops *ops;
40 void *priv;
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 */