gbm_sys/
bindings.rs

1/* automatically generated by rust-bindgen 0.69.5 */
2
3pub const GBM_FORMAT_BIG_ENDIAN: u32 = 2147483648;
4pub const GBM_BO_IMPORT_WL_BUFFER: u32 = 21761;
5pub const GBM_BO_IMPORT_EGL_IMAGE: u32 = 21762;
6pub const GBM_BO_IMPORT_FD: u32 = 21763;
7pub const GBM_BO_IMPORT_FD_MODIFIER: u32 = 21764;
8pub const GBM_MAX_PLANES: u32 = 4;
9#[doc = " \\file gbm.h\n \\brief Generic Buffer Manager"]
10#[repr(C)]
11#[derive(Debug, Copy, Clone)]
12pub struct gbm_device {
13    _unused: [u8; 0],
14}
15#[repr(C)]
16#[derive(Debug, Copy, Clone)]
17pub struct gbm_bo {
18    _unused: [u8; 0],
19}
20#[repr(C)]
21#[derive(Debug, Copy, Clone)]
22pub struct gbm_surface {
23    _unused: [u8; 0],
24}
25#[doc = " Abstraction representing the handle to a buffer allocated by the\n manager"]
26#[repr(C)]
27#[derive(Copy, Clone)]
28pub union gbm_bo_handle {
29    pub ptr: *mut libc::c_void,
30    pub s32: i32,
31    pub u32_: u32,
32    pub s64: i64,
33    pub u64_: u64,
34}
35pub mod gbm_bo_format {
36    #[doc = " Format of the allocated buffer"]
37    pub type Type = libc::c_uint;
38    #[doc = " RGB with 8 bits per channel in a 32 bit value"]
39    pub const GBM_BO_FORMAT_XRGB8888: Type = 0;
40    #[doc = " ARGB with 8 bits per channel in a 32 bit value"]
41    pub const GBM_BO_FORMAT_ARGB8888: Type = 1;
42}
43#[repr(C)]
44#[derive(Debug, Copy, Clone)]
45pub struct gbm_format_name_desc {
46    pub name: [libc::c_char; 5usize],
47}
48pub mod gbm_bo_flags {
49    #[doc = " Flags to indicate the intended use for the buffer - these are passed into\n gbm_bo_create(). The caller must set the union of all the flags that are\n appropriate\n\n \\sa Use gbm_device_is_format_supported() to check if the combination of format\n and use flags are supported"]
50    pub type Type = libc::c_uint;
51    #[doc = " Buffer is going to be presented to the screen using an API such as KMS"]
52    pub const GBM_BO_USE_SCANOUT: Type = 1;
53    #[doc = " Buffer is going to be used as cursor"]
54    pub const GBM_BO_USE_CURSOR: Type = 2;
55    #[doc = " Deprecated"]
56    pub const GBM_BO_USE_CURSOR_64X64: Type = 2;
57    #[doc = " Buffer is to be used for rendering - for example it is going to be used\n as the storage for a color buffer"]
58    pub const GBM_BO_USE_RENDERING: Type = 4;
59    #[doc = " Buffer can be used for gbm_bo_write.  This is guaranteed to work\n with GBM_BO_USE_CURSOR, but may not work for other combinations."]
60    pub const GBM_BO_USE_WRITE: Type = 8;
61    #[doc = " Buffer is linear, i.e. not tiled."]
62    pub const GBM_BO_USE_LINEAR: Type = 16;
63    #[doc = " Buffer is protected, i.e. encrypted and not readable by CPU or any\n other non-secure / non-trusted components nor by non-trusted OpenGL,\n OpenCL, and Vulkan applications."]
64    pub const GBM_BO_USE_PROTECTED: Type = 32;
65}
66extern "C" {
67    pub fn gbm_device_get_fd(gbm: *mut gbm_device) -> libc::c_int;
68}
69extern "C" {
70    pub fn gbm_device_get_backend_name(gbm: *mut gbm_device) -> *const libc::c_char;
71}
72extern "C" {
73    pub fn gbm_device_is_format_supported(
74        gbm: *mut gbm_device,
75        format: u32,
76        flags: u32,
77    ) -> libc::c_int;
78}
79extern "C" {
80    pub fn gbm_device_get_format_modifier_plane_count(
81        gbm: *mut gbm_device,
82        format: u32,
83        modifier: u64,
84    ) -> libc::c_int;
85}
86extern "C" {
87    pub fn gbm_device_destroy(gbm: *mut gbm_device);
88}
89extern "C" {
90    pub fn gbm_create_device(fd: libc::c_int) -> *mut gbm_device;
91}
92extern "C" {
93    pub fn gbm_bo_create(
94        gbm: *mut gbm_device,
95        width: u32,
96        height: u32,
97        format: u32,
98        flags: u32,
99    ) -> *mut gbm_bo;
100}
101extern "C" {
102    pub fn gbm_bo_create_with_modifiers(
103        gbm: *mut gbm_device,
104        width: u32,
105        height: u32,
106        format: u32,
107        modifiers: *const u64,
108        count: libc::c_uint,
109    ) -> *mut gbm_bo;
110}
111extern "C" {
112    pub fn gbm_bo_create_with_modifiers2(
113        gbm: *mut gbm_device,
114        width: u32,
115        height: u32,
116        format: u32,
117        modifiers: *const u64,
118        count: libc::c_uint,
119        flags: u32,
120    ) -> *mut gbm_bo;
121}
122#[repr(C)]
123#[derive(Debug, Copy, Clone)]
124pub struct gbm_import_fd_data {
125    pub fd: libc::c_int,
126    pub width: u32,
127    pub height: u32,
128    pub stride: u32,
129    pub format: u32,
130}
131#[repr(C)]
132#[derive(Debug, Copy, Clone)]
133pub struct gbm_import_fd_modifier_data {
134    pub width: u32,
135    pub height: u32,
136    pub format: u32,
137    pub num_fds: u32,
138    pub fds: [libc::c_int; 4usize],
139    pub strides: [libc::c_int; 4usize],
140    pub offsets: [libc::c_int; 4usize],
141    pub modifier: u64,
142}
143extern "C" {
144    pub fn gbm_bo_import(
145        gbm: *mut gbm_device,
146        type_: u32,
147        buffer: *mut libc::c_void,
148        flags: u32,
149    ) -> *mut gbm_bo;
150}
151pub mod gbm_bo_transfer_flags {
152    #[doc = " Flags to indicate the type of mapping for the buffer - these are\n passed into gbm_bo_map(). The caller must set the union of all the\n flags that are appropriate.\n\n These flags are independent of the GBM_BO_USE_* creation flags. However,\n mapping the buffer may require copying to/from a staging buffer.\n\n See also: pipe_map_flags"]
153    pub type Type = libc::c_uint;
154    #[doc = " Buffer contents read back (or accessed directly) at transfer\n create time."]
155    pub const GBM_BO_TRANSFER_READ: Type = 1;
156    #[doc = " Buffer contents will be written back at unmap time\n (or modified as a result of being accessed directly)."]
157    pub const GBM_BO_TRANSFER_WRITE: Type = 2;
158    #[doc = " Read/modify/write"]
159    pub const GBM_BO_TRANSFER_READ_WRITE: Type = 3;
160}
161extern "C" {
162    pub fn gbm_bo_map(
163        bo: *mut gbm_bo,
164        x: u32,
165        y: u32,
166        width: u32,
167        height: u32,
168        flags: u32,
169        stride: *mut u32,
170        map_data: *mut *mut libc::c_void,
171    ) -> *mut libc::c_void;
172}
173extern "C" {
174    pub fn gbm_bo_unmap(bo: *mut gbm_bo, map_data: *mut libc::c_void);
175}
176extern "C" {
177    pub fn gbm_bo_get_width(bo: *mut gbm_bo) -> u32;
178}
179extern "C" {
180    pub fn gbm_bo_get_height(bo: *mut gbm_bo) -> u32;
181}
182extern "C" {
183    pub fn gbm_bo_get_stride(bo: *mut gbm_bo) -> u32;
184}
185extern "C" {
186    pub fn gbm_bo_get_stride_for_plane(bo: *mut gbm_bo, plane: libc::c_int) -> u32;
187}
188extern "C" {
189    pub fn gbm_bo_get_format(bo: *mut gbm_bo) -> u32;
190}
191extern "C" {
192    pub fn gbm_bo_get_bpp(bo: *mut gbm_bo) -> u32;
193}
194extern "C" {
195    pub fn gbm_bo_get_offset(bo: *mut gbm_bo, plane: libc::c_int) -> u32;
196}
197extern "C" {
198    pub fn gbm_bo_get_device(bo: *mut gbm_bo) -> *mut gbm_device;
199}
200extern "C" {
201    pub fn gbm_bo_get_handle(bo: *mut gbm_bo) -> gbm_bo_handle;
202}
203extern "C" {
204    pub fn gbm_bo_get_fd(bo: *mut gbm_bo) -> libc::c_int;
205}
206extern "C" {
207    pub fn gbm_bo_get_modifier(bo: *mut gbm_bo) -> u64;
208}
209extern "C" {
210    pub fn gbm_bo_get_plane_count(bo: *mut gbm_bo) -> libc::c_int;
211}
212extern "C" {
213    pub fn gbm_bo_get_handle_for_plane(bo: *mut gbm_bo, plane: libc::c_int) -> gbm_bo_handle;
214}
215extern "C" {
216    pub fn gbm_bo_get_fd_for_plane(bo: *mut gbm_bo, plane: libc::c_int) -> libc::c_int;
217}
218extern "C" {
219    pub fn gbm_bo_write(bo: *mut gbm_bo, buf: *const libc::c_void, count: usize) -> libc::c_int;
220}
221extern "C" {
222    pub fn gbm_bo_set_user_data(
223        bo: *mut gbm_bo,
224        data: *mut libc::c_void,
225        destroy_user_data: ::std::option::Option<
226            unsafe extern "C" fn(arg1: *mut gbm_bo, arg2: *mut libc::c_void),
227        >,
228    );
229}
230extern "C" {
231    pub fn gbm_bo_get_user_data(bo: *mut gbm_bo) -> *mut libc::c_void;
232}
233extern "C" {
234    pub fn gbm_bo_destroy(bo: *mut gbm_bo);
235}
236extern "C" {
237    pub fn gbm_surface_create(
238        gbm: *mut gbm_device,
239        width: u32,
240        height: u32,
241        format: u32,
242        flags: u32,
243    ) -> *mut gbm_surface;
244}
245extern "C" {
246    pub fn gbm_surface_create_with_modifiers(
247        gbm: *mut gbm_device,
248        width: u32,
249        height: u32,
250        format: u32,
251        modifiers: *const u64,
252        count: libc::c_uint,
253    ) -> *mut gbm_surface;
254}
255extern "C" {
256    pub fn gbm_surface_create_with_modifiers2(
257        gbm: *mut gbm_device,
258        width: u32,
259        height: u32,
260        format: u32,
261        modifiers: *const u64,
262        count: libc::c_uint,
263        flags: u32,
264    ) -> *mut gbm_surface;
265}
266extern "C" {
267    pub fn gbm_surface_lock_front_buffer(surface: *mut gbm_surface) -> *mut gbm_bo;
268}
269extern "C" {
270    pub fn gbm_surface_release_buffer(surface: *mut gbm_surface, bo: *mut gbm_bo);
271}
272extern "C" {
273    pub fn gbm_surface_has_free_buffers(surface: *mut gbm_surface) -> libc::c_int;
274}
275extern "C" {
276    pub fn gbm_surface_destroy(surface: *mut gbm_surface);
277}
278extern "C" {
279    pub fn gbm_format_get_name(
280        gbm_format: u32,
281        desc: *mut gbm_format_name_desc,
282    ) -> *mut libc::c_char;
283}