xref: /aosp_15_r20/external/mesa3d/src/freedreno/vulkan/ion/ion_4.19.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /* Copied from libion:
2  *  https://android.googlesource.com/platform/system/memory/libion/
3  *
4  * This header was automatically generated from a Linux kernel header
5  * of the same name, to make information necessary for userspace to
6  * call into the kernel available to libc.  It contains only constants,
7  * structures, and macros generated from the original header, and thus,
8  * contains no copyrightable information.
9  */
10 
11 #ifndef _UAPI_LINUX_ION_NEW_H
12 #define _UAPI_LINUX_ION_NEW_H
13 #include <linux/ioctl.h>
14 #include <linux/types.h>
15 #define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
16 enum ion_heap_type_ext {
17     ION_HEAP_TYPE_CUSTOM_EXT = 16,
18     ION_HEAP_TYPE_MAX = 31,
19 };
20 enum ion_heap_id {
21     ION_HEAP_SYSTEM = (1 << ION_HEAP_TYPE_SYSTEM),
22     ION_HEAP_DMA_START = (ION_HEAP_SYSTEM << 1),
23     ION_HEAP_DMA_END = (ION_HEAP_DMA_START << 7),
24     ION_HEAP_CUSTOM_START = (ION_HEAP_DMA_END << 1),
25     ION_HEAP_CUSTOM_END = (ION_HEAP_CUSTOM_START << 22),
26 };
27 #define ION_NUM_MAX_HEAPS (32)
28 struct ion_new_allocation_data {
29     __u64 len;
30     __u32 heap_id_mask;
31     __u32 flags;
32     __u32 fd;
33     __u32 unused;
34 };
35 #define MAX_HEAP_NAME 32
36 struct ion_heap_data {
37     char name[MAX_HEAP_NAME];
38     __u32 type;
39     __u32 heap_id;
40     __u32 reserved0;
41     __u32 reserved1;
42     __u32 reserved2;
43 };
44 struct ion_heap_query {
45     __u32 cnt;
46     __u32 reserved0;
47     __u64 heaps;
48     __u32 reserved1;
49     __u32 reserved2;
50 };
51 #define ION_IOC_MAGIC 'I'
52 #define ION_IOC_NEW_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_new_allocation_data)
53 #define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query)
54 #define ION_IOC_ABI_VERSION _IOR(ION_IOC_MAGIC, 9, __u32)
55 #endif
56