xref: /aosp_15_r20/external/mesa3d/src/freedreno/vulkan/ion/ion.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_H
12 #define _UAPI_LINUX_ION_H
13 #include <linux/ioctl.h>
14 #include <linux/types.h>
15 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
16 typedef int ion_user_handle_t;
17 enum ion_heap_type {
18  ION_HEAP_TYPE_SYSTEM,
19  ION_HEAP_TYPE_SYSTEM_CONTIG,
20 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
21  ION_HEAP_TYPE_CARVEOUT,
22  ION_HEAP_TYPE_CHUNK,
23  ION_HEAP_TYPE_DMA,
24  ION_HEAP_TYPE_CUSTOM,
25 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
26  ION_NUM_HEAPS = 16,
27 };
28 #define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM)
29 #define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG)
30 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
31 #define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT)
32 #define ION_HEAP_TYPE_DMA_MASK (1 << ION_HEAP_TYPE_DMA)
33 #define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
34 #define ION_FLAG_CACHED 1
35 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
36 #define ION_FLAG_CACHED_NEEDS_SYNC 2
37 struct ion_allocation_data {
38  size_t len;
39  size_t align;
40 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
41  unsigned int heap_id_mask;
42  unsigned int flags;
43  ion_user_handle_t handle;
44 };
45 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
46 struct ion_fd_data {
47  ion_user_handle_t handle;
48  int fd;
49 };
50 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
51 struct ion_handle_data {
52  ion_user_handle_t handle;
53 };
54 struct ion_custom_data {
55 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
56  unsigned int cmd;
57  unsigned long arg;
58 };
59 #define ION_IOC_MAGIC 'I'
60 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
61 #define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0,   struct ion_allocation_data)
62 #define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
63 #define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data)
64 #define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
65 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
66 #define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data)
67 #define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data)
68 #define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data)
69 #endif
70 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
71