magma_common_defs/
magma_common_defs.rs1pub const MAX_INFLIGHT_MESSAGES: u64 = 1000;
8pub const MAX_INFLIGHT_MEMORY_MB: u64 = 100;
9pub const MAX_INFLIGHT_BYTES: u64 = MAX_INFLIGHT_MEMORY_MB * 1024 * 1024;
10
11pub const MAGMA_DEVICE_NAMESPACE: &[u8; 31] = b"/loader-gpu-devices/svc/magma/\0";
12pub const MAGMA_API_VERSION: u32 = 14;
13pub const MAGMA_LOG_ERROR: u32 = 1;
14pub const MAGMA_LOG_WARNING: u32 = 2;
15pub const MAGMA_LOG_INFO: u32 = 3;
16pub const MAGMA_LOG_DEBUG: u32 = 4;
17pub const MAGMA_QUERY_VENDOR_ID: u64 = 0;
18pub const MAGMA_QUERY_DEVICE_ID: u64 = 1;
19pub const MAGMA_QUERY_VENDOR_VERSION: u64 = 2;
20pub const MAGMA_QUERY_IS_TOTAL_TIME_SUPPORTED: u64 = 3;
21pub const MAGMA_QUERY_MAXIMUM_INFLIGHT_PARAMS: u64 = 5;
22pub const MAGMA_QUERY_VENDOR_PARAM_0: u64 = 10000;
23pub const MAGMA_QUERY_TOTAL_TIME: u64 = 500;
24pub const MAGMA_INVALID_OBJECT_ID: u32 = 0;
25pub const MAGMA_COMMAND_BUFFER_VENDOR_FLAGS_0: u32 = 65536;
26pub const MAGMA_STATUS_OK: i32 = 0;
27pub const MAGMA_STATUS_INTERNAL_ERROR: i32 = -1;
28pub const MAGMA_STATUS_INVALID_ARGS: i32 = -2;
29pub const MAGMA_STATUS_ACCESS_DENIED: i32 = -3;
30pub const MAGMA_STATUS_MEMORY_ERROR: i32 = -4;
31pub const MAGMA_STATUS_CONTEXT_KILLED: i32 = -5;
32pub const MAGMA_STATUS_CONNECTION_LOST: i32 = -6;
33pub const MAGMA_STATUS_TIMED_OUT: i32 = -7;
34pub const MAGMA_STATUS_UNIMPLEMENTED: i32 = -8;
35pub const MAGMA_STATUS_BAD_STATE: i32 = -9;
36pub const MAGMA_STATUS_CONSTRAINTS_INTERSECTION_EMPTY: i32 = -10;
37pub const MAGMA_STATUS_TOO_MANY_GROUP_CHILD_COMBINATIONS: i32 = -11;
38pub const MAGMA_STATUS_ALIAS_FOR_LAST: i32 = -11;
39pub const MAGMA_CACHE_OPERATION_CLEAN: u32 = 0;
40pub const MAGMA_CACHE_OPERATION_CLEAN_INVALIDATE: u32 = 1;
41pub const MAGMA_CACHE_POLICY_CACHED: u32 = 0;
42pub const MAGMA_CACHE_POLICY_WRITE_COMBINING: u32 = 1;
43pub const MAGMA_CACHE_POLICY_UNCACHED: u32 = 2;
44pub const MAGMA_DUMP_TYPE_NORMAL: u32 = 1;
45pub const MAGMA_PERF_COUNTER_RESULT_DISCONTINUITY: u32 = 1;
46pub const MAGMA_IMPORT_SEMAPHORE_ONE_SHOT: u64 = 1;
47pub const MAGMA_FORMAT_INVALID: u32 = 0;
48pub const MAGMA_FORMAT_R8G8B8A8: u32 = 1;
49pub const MAGMA_FORMAT_BGRA32: u32 = 101;
50pub const MAGMA_FORMAT_I420: u32 = 102;
51pub const MAGMA_FORMAT_M420: u32 = 103;
52pub const MAGMA_FORMAT_NV12: u32 = 104;
53pub const MAGMA_FORMAT_YUY2: u32 = 105;
54pub const MAGMA_FORMAT_MJPEG: u32 = 106;
55pub const MAGMA_FORMAT_YV12: u32 = 107;
56pub const MAGMA_FORMAT_BGR24: u32 = 108;
57pub const MAGMA_FORMAT_RGB565: u32 = 109;
58pub const MAGMA_FORMAT_RGB332: u32 = 110;
59pub const MAGMA_FORMAT_RGB2220: u32 = 111;
60pub const MAGMA_FORMAT_L8: u32 = 112;
61pub const MAGMA_FORMAT_R8: u32 = 113;
62pub const MAGMA_FORMAT_R8G8: u32 = 114;
63pub const MAGMA_FORMAT_A2R10G10B10: u32 = 115;
64pub const MAGMA_FORMAT_A2B10G10R10: u32 = 116;
65pub const MAGMA_FORMAT_P010: u32 = 117;
66pub const MAGMA_FORMAT_R8G8B8: u32 = 118;
67pub const MAGMA_FORMAT_MODIFIER_LINEAR: u32 = 0;
68pub const MAGMA_FORMAT_MODIFIER_INTEL_X_TILED: u64 = 72057594037927937;
69pub const MAGMA_FORMAT_MODIFIER_INTEL_Y_TILED: u64 = 72057594037927938;
70pub const MAGMA_FORMAT_MODIFIER_INTEL_YF_TILED: u64 = 72057594037927939;
71pub const MAGMA_FORMAT_MODIFIER_INTEL_Y_TILED_CCS: u64 = 72057594054705154;
72pub const MAGMA_FORMAT_MODIFIER_INTEL_YF_TILED_CCS: u64 = 72057594054705155;
73pub const MAGMA_FORMAT_MODIFIER_ARM_YUV_BIT: u32 = 16;
74pub const MAGMA_FORMAT_MODIFIER_ARM_SPLIT_BLOCK_BIT: u32 = 32;
75pub const MAGMA_FORMAT_MODIFIER_ARM_SPARSE_BIT: u32 = 64;
76pub const MAGMA_FORMAT_MODIFIER_ARM_BCH_BIT: u32 = 2048;
77pub const MAGMA_FORMAT_MODIFIER_ARM_TE_BIT: u32 = 4096;
78pub const MAGMA_FORMAT_MODIFIER_ARM_TILED_HEADER_BIT: u32 = 8192;
79pub const MAGMA_FORMAT_MODIFIER_ARM: u64 = 576460752303423488;
80pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16: u64 = 576460752303423489;
81pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_32X8: u64 = 576460752303423490;
82pub const MAGMA_FORMAT_MODIFIER_ARM_LINEAR_TE: u64 = 576460752303427584;
83pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_TE: u64 = 576460752303427585;
84pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_32X8_TE: u64 = 576460752303427586;
85pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_YUV_TILED_HEADER: u64 = 576460752303431697;
86pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV: u64 = 576460752303423601;
87pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TE: u64 = 576460752303427697;
88pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TILED_HEADER: u64 =
89 576460752303431793;
90pub const MAGMA_FORMAT_MODIFIER_ARM_AFBC_16X16_SPLIT_BLOCK_SPARSE_YUV_TE_TILED_HEADER: u64 =
91 576460752303435889;
92pub const MAGMA_COLORSPACE_INVALID: u32 = 0;
93pub const MAGMA_COLORSPACE_SRGB: u32 = 1;
94pub const MAGMA_COLORSPACE_REC601_NTSC: u32 = 2;
95pub const MAGMA_COLORSPACE_REC601_NTSC_FULL_RANGE: u32 = 3;
96pub const MAGMA_COLORSPACE_REC601_PAL: u32 = 4;
97pub const MAGMA_COLORSPACE_REC601_PAL_FULL_RANGE: u32 = 5;
98pub const MAGMA_COLORSPACE_REC709: u32 = 6;
99pub const MAGMA_COLORSPACE_REC2020: u32 = 7;
100pub const MAGMA_COLORSPACE_REC2100: u32 = 8;
101pub const MAGMA_COHERENCY_DOMAIN_CPU: u32 = 0;
102pub const MAGMA_COHERENCY_DOMAIN_RAM: u32 = 1;
103pub const MAGMA_COHERENCY_DOMAIN_INACCESSIBLE: u32 = 2;
104pub const MAGMA_POLL_TYPE_SEMAPHORE: u32 = 1;
105pub const MAGMA_POLL_TYPE_HANDLE: u32 = 2;
106pub const MAGMA_POLL_CONDITION_READABLE: u32 = 1;
107pub const MAGMA_POLL_CONDITION_SIGNALED: u32 = 3;
108pub const MAGMA_BUFFER_RANGE_OP_POPULATE_TABLES: u32 = 1;
109pub const MAGMA_BUFFER_RANGE_OP_COMMIT: u32 = 2;
110pub const MAGMA_BUFFER_RANGE_OP_DEPOPULATE_TABLES: u32 = 3;
111pub const MAGMA_BUFFER_RANGE_OP_DECOMMIT: u32 = 4;
112pub const MAGMA_SYSMEM_FLAG_PROTECTED: u32 = 1;
113pub const MAGMA_SYSMEM_FLAG_FOR_CLIENT: u32 = 4;
114pub const MAGMA_MAX_IMAGE_PLANES: u32 = 4;
115pub const MAGMA_MAX_DRM_FORMAT_MODIFIERS: u32 = 16;
116pub const MAGMA_MAP_FLAG_VENDOR_SHIFT: u64 = 16;
117pub const MAGMA_MAP_FLAG_READ: u64 = 1;
118pub const MAGMA_MAP_FLAG_WRITE: u64 = 2;
119pub const MAGMA_MAP_FLAG_EXECUTE: u64 = 4;
120pub const MAGMA_MAP_FLAG_GROWABLE: u64 = 8;
121pub const MAGMA_MAP_FLAG_VENDOR_0: u64 = 65536;
122pub const MAGMA_IMAGE_CREATE_FLAGS_PRESENTABLE: u32 = 1;
123pub const MAGMA_IMAGE_CREATE_FLAGS_VULKAN_USAGE: u32 = 2;
124pub const MAGMA_PRIORITY_LOW: u32 = 128;
125pub const MAGMA_PRIORITY_MEDIUM: u32 = 256;
126pub const MAGMA_PRIORITY_HIGH: u32 = 512;
127pub const MAGMA_PRIORITY_REALTIME: u32 = 1024;
128pub type magma_log_severity_t = i8;
129pub type magma_query_t = u64;
130pub type magma_status_t = i32;
131pub type magma_cache_operation_t = u32;
132pub type magma_cache_policy_t = u32;
133pub type magma_format_t = u32;
134pub type magma_format_modifier_t = u64;
135pub type magma_colorspace_t = u32;
136pub type magma_coherency_domain_t = u32;
137pub type magma_buffer_range_op_t = u32;
138pub type magma_bool_t = u8;
139pub type magma_device_t = u64;
140pub type magma_buffer_t = u64;
141pub type magma_semaphore_t = u64;
142pub type magma_perf_count_pool_t = u64;
143pub type magma_connection_t = u64;
144pub type magma_sysmem_connection_t = u64;
145pub type magma_handle_t = u32;
146pub type magma_buffer_id_t = u64;
147pub type magma_semaphore_id_t = u64;
148#[repr(C)]
149#[derive(Copy, Clone)]
150pub struct magma_poll_item {
151 pub __bindgen_anon_1: magma_poll_item__bindgen_ty_1,
152 pub type_: u32,
153 pub condition: u32,
154 pub result: u32,
155 pub unused: u32,
156}
157#[repr(C)]
158#[derive(Copy, Clone)]
159pub union magma_poll_item__bindgen_ty_1 {
160 pub semaphore: magma_semaphore_t,
161 pub handle: magma_handle_t,
162}
163pub type magma_poll_item_t = magma_poll_item;
164#[repr(C)]
165#[derive(Debug, Copy, Clone)]
166pub struct magma_exec_resource {
167 pub buffer_id: magma_buffer_id_t,
168 pub offset: u64,
169 pub length: u64,
170}
171pub type magma_exec_resource_t = magma_exec_resource;
172#[repr(C)]
173#[derive(Debug, Copy, Clone)]
174pub struct magma_exec_command_buffer {
175 pub resource_index: u32,
176 pub unused: u32,
177 pub start_offset: u64,
178}
179pub type magma_exec_command_buffer_t = magma_exec_command_buffer;
180#[repr(C)]
181#[derive(Debug, Copy, Clone)]
182pub struct magma_command_descriptor {
183 pub resource_count: u32,
184 pub command_buffer_count: u32,
185 pub wait_semaphore_count: u32,
186 pub signal_semaphore_count: u32,
187 pub resources: *mut magma_exec_resource,
188 pub command_buffers: *mut magma_exec_command_buffer,
189 pub semaphore_ids: *mut u64,
190 pub flags: u64,
191}
192pub type magma_command_descriptor_t = magma_command_descriptor;
193#[repr(C)]
194#[derive(Debug, Copy, Clone)]
195pub struct magma_inline_command_buffer {
196 pub data: *mut ::core::ffi::c_void,
197 pub size: u64,
198 pub semaphore_ids: *mut u64,
199 pub semaphore_count: u32,
200}
201pub type magma_inline_command_buffer_t = magma_inline_command_buffer;
202#[repr(C)]
203#[derive(Debug, Copy, Clone)]
204pub struct magma_total_time_query_result {
205 pub gpu_time_ns: u64,
206 pub monotonic_time_ns: u64,
207}
208pub type magma_total_time_query_result_t = magma_total_time_query_result;
209#[repr(C)]
210#[derive(Debug, Copy, Clone)]
211pub struct magma_buffer_offset {
212 pub buffer_id: u64,
213 pub offset: u64,
214 pub length: u64,
215}
216pub type magma_buffer_offset_t = magma_buffer_offset;
217#[repr(C)]
218#[derive(Debug, Copy, Clone)]
219pub struct magma_buffer_info {
220 pub committed_byte_count: u64,
221 pub size: u64,
222}
223pub type magma_buffer_info_t = magma_buffer_info;
224#[repr(C)]
225#[derive(Debug, Copy, Clone)]
226pub struct magma_image_create_info {
227 pub drm_format: u64,
228 pub drm_format_modifiers: [u64; 16usize],
229 pub width: u32,
230 pub height: u32,
231 pub flags: u64,
232}
233pub type magma_image_create_info_t = magma_image_create_info;
234#[repr(C)]
235#[derive(Debug, Copy, Clone)]
236pub struct magma_image_info {
237 pub plane_strides: [u64; 4usize],
238 pub plane_offsets: [u32; 4usize],
239 pub drm_format_modifier: u64,
240 pub coherency_domain: u32,
241 pub unused: u32,
242}
243pub type magma_image_info_t = magma_image_info;
244pub type magma_priority_t = u64;