1pub const g2d_format_G2D_RGB565: g2d_format = 0;
7pub const g2d_format_G2D_RGBA8888: g2d_format = 1;
8pub const g2d_format_G2D_RGBX8888: g2d_format = 2;
9pub const g2d_format_G2D_BGRA8888: g2d_format = 3;
10pub const g2d_format_G2D_BGRX8888: g2d_format = 4;
11pub const g2d_format_G2D_BGR565: g2d_format = 5;
12pub const g2d_format_G2D_ARGB8888: g2d_format = 6;
13pub const g2d_format_G2D_ABGR8888: g2d_format = 7;
14pub const g2d_format_G2D_XRGB8888: g2d_format = 8;
15pub const g2d_format_G2D_XBGR8888: g2d_format = 9;
16pub const g2d_format_G2D_RGB888: g2d_format = 10;
17pub const g2d_format_G2D_BGR888: g2d_format = 11;
18pub const g2d_format_G2D_RGBA5551: g2d_format = 12;
19pub const g2d_format_G2D_RGBX5551: g2d_format = 13;
20pub const g2d_format_G2D_BGRA5551: g2d_format = 14;
21pub const g2d_format_G2D_BGRX5551: g2d_format = 15;
22pub const g2d_format_G2D_NV12: g2d_format = 20;
23pub const g2d_format_G2D_I420: g2d_format = 21;
24pub const g2d_format_G2D_YV12: g2d_format = 22;
25pub const g2d_format_G2D_NV21: g2d_format = 23;
26pub const g2d_format_G2D_YUYV: g2d_format = 24;
27pub const g2d_format_G2D_YVYU: g2d_format = 25;
28pub const g2d_format_G2D_UYVY: g2d_format = 26;
29pub const g2d_format_G2D_VYUY: g2d_format = 27;
30pub const g2d_format_G2D_NV16: g2d_format = 28;
31pub const g2d_format_G2D_NV61: g2d_format = 29;
32pub type g2d_format = ::std::os::raw::c_uint;
33pub const g2d_blend_func_G2D_ZERO: g2d_blend_func = 0;
34pub const g2d_blend_func_G2D_ONE: g2d_blend_func = 1;
35pub const g2d_blend_func_G2D_SRC_ALPHA: g2d_blend_func = 2;
36pub const g2d_blend_func_G2D_ONE_MINUS_SRC_ALPHA: g2d_blend_func = 3;
37pub const g2d_blend_func_G2D_DST_ALPHA: g2d_blend_func = 4;
38pub const g2d_blend_func_G2D_ONE_MINUS_DST_ALPHA: g2d_blend_func = 5;
39pub const g2d_blend_func_G2D_PRE_MULTIPLIED_ALPHA: g2d_blend_func = 16;
40pub const g2d_blend_func_G2D_DEMULTIPLY_OUT_ALPHA: g2d_blend_func = 32;
41pub type g2d_blend_func = ::std::os::raw::c_uint;
42pub const g2d_cap_mode_G2D_BLEND: g2d_cap_mode = 0;
43pub const g2d_cap_mode_G2D_DITHER: g2d_cap_mode = 1;
44pub const g2d_cap_mode_G2D_GLOBAL_ALPHA: g2d_cap_mode = 2;
45pub const g2d_cap_mode_G2D_BLEND_DIM: g2d_cap_mode = 3;
46pub const g2d_cap_mode_G2D_BLUR: g2d_cap_mode = 4;
47pub const g2d_cap_mode_G2D_YUV_BT_601: g2d_cap_mode = 5;
48pub const g2d_cap_mode_G2D_YUV_BT_709: g2d_cap_mode = 6;
49pub const g2d_cap_mode_G2D_YUV_BT_601FR: g2d_cap_mode = 7;
50pub const g2d_cap_mode_G2D_YUV_BT_709FR: g2d_cap_mode = 8;
51pub const g2d_cap_mode_G2D_WARPING: g2d_cap_mode = 9;
52pub type g2d_cap_mode = ::std::os::raw::c_uint;
53pub const g2d_feature_G2D_SCALING: g2d_feature = 0;
54pub const g2d_feature_G2D_ROTATION: g2d_feature = 1;
55pub const g2d_feature_G2D_SRC_YUV: g2d_feature = 2;
56pub const g2d_feature_G2D_DST_YUV: g2d_feature = 3;
57pub const g2d_feature_G2D_MULTI_SOURCE_BLT: g2d_feature = 4;
58pub const g2d_feature_G2D_FAST_CLEAR: g2d_feature = 5;
59pub const g2d_feature_G2D_WARP_DEWARP: g2d_feature = 6;
60pub type g2d_feature = ::std::os::raw::c_uint;
61pub const g2d_rotation_G2D_ROTATION_0: g2d_rotation = 0;
62pub const g2d_rotation_G2D_ROTATION_90: g2d_rotation = 1;
63pub const g2d_rotation_G2D_ROTATION_180: g2d_rotation = 2;
64pub const g2d_rotation_G2D_ROTATION_270: g2d_rotation = 3;
65pub const g2d_rotation_G2D_FLIP_H: g2d_rotation = 4;
66pub const g2d_rotation_G2D_FLIP_V: g2d_rotation = 5;
67pub type g2d_rotation = ::std::os::raw::c_uint;
68pub const g2d_cache_mode_G2D_CACHE_CLEAN: g2d_cache_mode = 0;
69pub const g2d_cache_mode_G2D_CACHE_FLUSH: g2d_cache_mode = 1;
70pub const g2d_cache_mode_G2D_CACHE_INVALIDATE: g2d_cache_mode = 2;
71pub type g2d_cache_mode = ::std::os::raw::c_uint;
72pub const g2d_hardware_type_G2D_HARDWARE_2D: g2d_hardware_type = 0;
73pub const g2d_hardware_type_G2D_HARDWARE_VG: g2d_hardware_type = 1;
74pub type g2d_hardware_type = ::std::os::raw::c_uint;
75pub type g2d_phys_addr_t = ::std::os::raw::c_int;
76#[repr(C)]
77#[derive(Debug, Copy, Clone)]
78pub struct g2d_surface {
79 pub format: g2d_format,
80 pub planes: [g2d_phys_addr_t; 3usize],
81 pub left: ::std::os::raw::c_int,
82 pub top: ::std::os::raw::c_int,
83 pub right: ::std::os::raw::c_int,
84 pub bottom: ::std::os::raw::c_int,
85 #[doc = "< buffer stride, in Pixels"]
86 pub stride: ::std::os::raw::c_int,
87 #[doc = "< surface width, in Pixels"]
88 pub width: ::std::os::raw::c_int,
89 #[doc = "< surface height, in Pixels"]
90 pub height: ::std::os::raw::c_int,
91 #[doc = "< alpha blending parameters"]
92 pub blendfunc: g2d_blend_func,
93 #[doc = "< value is 0 ~ 255"]
94 pub global_alpha: ::std::os::raw::c_int,
95 pub clrcolor: ::std::os::raw::c_int,
96 pub rot: g2d_rotation,
97}
98#[allow(clippy::unnecessary_operation, clippy::identity_op)]
99const _: () = {
100 ["Size of g2d_surface"][::std::mem::size_of::<g2d_surface>() - 60usize];
101 ["Alignment of g2d_surface"][::std::mem::align_of::<g2d_surface>() - 4usize];
102 ["Offset of field: g2d_surface::format"][::std::mem::offset_of!(g2d_surface, format) - 0usize];
103 ["Offset of field: g2d_surface::planes"][::std::mem::offset_of!(g2d_surface, planes) - 4usize];
104 ["Offset of field: g2d_surface::left"][::std::mem::offset_of!(g2d_surface, left) - 16usize];
105 ["Offset of field: g2d_surface::top"][::std::mem::offset_of!(g2d_surface, top) - 20usize];
106 ["Offset of field: g2d_surface::right"][::std::mem::offset_of!(g2d_surface, right) - 24usize];
107 ["Offset of field: g2d_surface::bottom"][::std::mem::offset_of!(g2d_surface, bottom) - 28usize];
108 ["Offset of field: g2d_surface::stride"][::std::mem::offset_of!(g2d_surface, stride) - 32usize];
109 ["Offset of field: g2d_surface::width"][::std::mem::offset_of!(g2d_surface, width) - 36usize];
110 ["Offset of field: g2d_surface::height"][::std::mem::offset_of!(g2d_surface, height) - 40usize];
111 ["Offset of field: g2d_surface::blendfunc"]
112 [::std::mem::offset_of!(g2d_surface, blendfunc) - 44usize];
113 ["Offset of field: g2d_surface::global_alpha"]
114 [::std::mem::offset_of!(g2d_surface, global_alpha) - 48usize];
115 ["Offset of field: g2d_surface::clrcolor"]
116 [::std::mem::offset_of!(g2d_surface, clrcolor) - 52usize];
117 ["Offset of field: g2d_surface::rot"][::std::mem::offset_of!(g2d_surface, rot) - 56usize];
118};
119#[repr(C)]
120#[derive(Debug, Copy, Clone)]
121pub struct g2d_surface_pair {
122 pub s: g2d_surface,
123 pub d: g2d_surface,
124}
125#[allow(clippy::unnecessary_operation, clippy::identity_op)]
126const _: () = {
127 ["Size of g2d_surface_pair"][::std::mem::size_of::<g2d_surface_pair>() - 120usize];
128 ["Alignment of g2d_surface_pair"][::std::mem::align_of::<g2d_surface_pair>() - 4usize];
129 ["Offset of field: g2d_surface_pair::s"][::std::mem::offset_of!(g2d_surface_pair, s) - 0usize];
130 ["Offset of field: g2d_surface_pair::d"][::std::mem::offset_of!(g2d_surface_pair, d) - 60usize];
131};
132#[repr(C)]
133#[derive(Debug, Copy, Clone)]
134pub struct g2d_buf {
135 pub buf_handle: *mut ::std::os::raw::c_void,
136 pub buf_vaddr: *mut ::std::os::raw::c_void,
137 pub buf_paddr: ::std::os::raw::c_int,
138 pub buf_size: ::std::os::raw::c_int,
139}
140#[allow(clippy::unnecessary_operation, clippy::identity_op)]
141const _: () = {
142 ["Size of g2d_buf"][::std::mem::size_of::<g2d_buf>() - 24usize];
143 ["Alignment of g2d_buf"][::std::mem::align_of::<g2d_buf>() - 8usize];
144 ["Offset of field: g2d_buf::buf_handle"][::std::mem::offset_of!(g2d_buf, buf_handle) - 0usize];
145 ["Offset of field: g2d_buf::buf_vaddr"][::std::mem::offset_of!(g2d_buf, buf_vaddr) - 8usize];
146 ["Offset of field: g2d_buf::buf_paddr"][::std::mem::offset_of!(g2d_buf, buf_paddr) - 16usize];
147 ["Offset of field: g2d_buf::buf_size"][::std::mem::offset_of!(g2d_buf, buf_size) - 20usize];
148};
149
150#[derive(Debug)]
151pub struct g2d {
152 __library: ::libloading::Library,
153 pub g2d_open: Result<
154 unsafe extern "C" fn(handle: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
155 ::libloading::Error,
156 >,
157 pub g2d_close: Result<
158 unsafe extern "C" fn(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
159 ::libloading::Error,
160 >,
161 pub g2d_make_current: Result<
162 unsafe extern "C" fn(
163 handle: *mut ::std::os::raw::c_void,
164 type_: g2d_hardware_type,
165 ) -> ::std::os::raw::c_int,
166 ::libloading::Error,
167 >,
168 pub g2d_clear: Result<
169 unsafe extern "C" fn(
170 handle: *mut ::std::os::raw::c_void,
171 area: *mut g2d_surface,
172 ) -> ::std::os::raw::c_int,
173 ::libloading::Error,
174 >,
175 pub g2d_blit: Result<
176 unsafe extern "C" fn(
177 handle: *mut ::std::os::raw::c_void,
178 src: *mut g2d_surface,
179 dst: *mut g2d_surface,
180 ) -> ::std::os::raw::c_int,
181 ::libloading::Error,
182 >,
183 pub g2d_copy: Result<
184 unsafe extern "C" fn(
185 handle: *mut ::std::os::raw::c_void,
186 d: *mut g2d_buf,
187 s: *mut g2d_buf,
188 size: ::std::os::raw::c_int,
189 ) -> ::std::os::raw::c_int,
190 ::libloading::Error,
191 >,
192 pub g2d_multi_blit: Result<
193 unsafe extern "C" fn(
194 handle: *mut ::std::os::raw::c_void,
195 sp: *mut *mut g2d_surface_pair,
196 layers: ::std::os::raw::c_int,
197 ) -> ::std::os::raw::c_int,
198 ::libloading::Error,
199 >,
200 pub g2d_query_hardware: Result<
201 unsafe extern "C" fn(
202 handle: *mut ::std::os::raw::c_void,
203 type_: g2d_hardware_type,
204 available: *mut ::std::os::raw::c_int,
205 ) -> ::std::os::raw::c_int,
206 ::libloading::Error,
207 >,
208 pub g2d_query_feature: Result<
209 unsafe extern "C" fn(
210 handle: *mut ::std::os::raw::c_void,
211 feature: g2d_feature,
212 available: *mut ::std::os::raw::c_int,
213 ) -> ::std::os::raw::c_int,
214 ::libloading::Error,
215 >,
216 pub g2d_query_cap: Result<
217 unsafe extern "C" fn(
218 handle: *mut ::std::os::raw::c_void,
219 cap: g2d_cap_mode,
220 enable: *mut ::std::os::raw::c_int,
221 ) -> ::std::os::raw::c_int,
222 ::libloading::Error,
223 >,
224 pub g2d_enable: Result<
225 unsafe extern "C" fn(
226 handle: *mut ::std::os::raw::c_void,
227 cap: g2d_cap_mode,
228 ) -> ::std::os::raw::c_int,
229 ::libloading::Error,
230 >,
231 pub g2d_disable: Result<
232 unsafe extern "C" fn(
233 handle: *mut ::std::os::raw::c_void,
234 cap: g2d_cap_mode,
235 ) -> ::std::os::raw::c_int,
236 ::libloading::Error,
237 >,
238 pub g2d_cache_op: Result<
239 unsafe extern "C" fn(buf: *mut g2d_buf, op: g2d_cache_mode) -> ::std::os::raw::c_int,
240 ::libloading::Error,
241 >,
242 pub g2d_alloc: Result<
243 unsafe extern "C" fn(
244 size: ::std::os::raw::c_int,
245 cacheable: ::std::os::raw::c_int,
246 ) -> *mut g2d_buf,
247 ::libloading::Error,
248 >,
249 pub g2d_buf_from_fd: Result<
250 unsafe extern "C" fn(fd: ::std::os::raw::c_int) -> *mut g2d_buf,
251 ::libloading::Error,
252 >,
253 pub g2d_buf_export_fd: Result<
254 unsafe extern "C" fn(arg1: *mut g2d_buf) -> ::std::os::raw::c_int,
255 ::libloading::Error,
256 >,
257 pub g2d_buf_from_virt_addr: Result<
258 unsafe extern "C" fn(
259 vaddr: *mut ::std::os::raw::c_void,
260 size: ::std::os::raw::c_int,
261 ) -> *mut g2d_buf,
262 ::libloading::Error,
263 >,
264 pub g2d_free: Result<
265 unsafe extern "C" fn(buf: *mut g2d_buf) -> ::std::os::raw::c_int,
266 ::libloading::Error,
267 >,
268 pub g2d_flush: Result<
269 unsafe extern "C" fn(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
270 ::libloading::Error,
271 >,
272 pub g2d_finish: Result<
273 unsafe extern "C" fn(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
274 ::libloading::Error,
275 >,
276}
277impl g2d {
278 pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
279 where
280 P: AsRef<::std::ffi::OsStr>,
281 {
282 unsafe {
283 let library = ::libloading::Library::new(path)?;
284 Self::from_library(library)
285 }
286 }
287
288 pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
289 where
290 L: Into<::libloading::Library>,
291 {
292 unsafe {
293 let __library = library.into();
294 let g2d_open = __library.get(b"g2d_open\0").map(|sym| *sym);
295 let g2d_close = __library.get(b"g2d_close\0").map(|sym| *sym);
296 let g2d_make_current = __library.get(b"g2d_make_current\0").map(|sym| *sym);
297 let g2d_clear = __library.get(b"g2d_clear\0").map(|sym| *sym);
298 let g2d_blit = __library.get(b"g2d_blit\0").map(|sym| *sym);
299 let g2d_copy = __library.get(b"g2d_copy\0").map(|sym| *sym);
300 let g2d_multi_blit = __library.get(b"g2d_multi_blit\0").map(|sym| *sym);
301 let g2d_query_hardware = __library.get(b"g2d_query_hardware\0").map(|sym| *sym);
302 let g2d_query_feature = __library.get(b"g2d_query_feature\0").map(|sym| *sym);
303 let g2d_query_cap = __library.get(b"g2d_query_cap\0").map(|sym| *sym);
304 let g2d_enable = __library.get(b"g2d_enable\0").map(|sym| *sym);
305 let g2d_disable = __library.get(b"g2d_disable\0").map(|sym| *sym);
306 let g2d_cache_op = __library.get(b"g2d_cache_op\0").map(|sym| *sym);
307 let g2d_alloc = __library.get(b"g2d_alloc\0").map(|sym| *sym);
308 let g2d_buf_from_fd = __library.get(b"g2d_buf_from_fd\0").map(|sym| *sym);
309 let g2d_buf_export_fd = __library.get(b"g2d_buf_export_fd\0").map(|sym| *sym);
310 let g2d_buf_from_virt_addr = __library.get(b"g2d_buf_from_virt_addr\0").map(|sym| *sym);
311 let g2d_free = __library.get(b"g2d_free\0").map(|sym| *sym);
312 let g2d_flush = __library.get(b"g2d_flush\0").map(|sym| *sym);
313 let g2d_finish = __library.get(b"g2d_finish\0").map(|sym| *sym);
314 Ok(g2d {
315 __library,
316 g2d_open,
317 g2d_close,
318 g2d_make_current,
319 g2d_clear,
320 g2d_blit,
321 g2d_copy,
322 g2d_multi_blit,
323 g2d_query_hardware,
324 g2d_query_feature,
325 g2d_query_cap,
326 g2d_enable,
327 g2d_disable,
328 g2d_cache_op,
329 g2d_alloc,
330 g2d_buf_from_fd,
331 g2d_buf_export_fd,
332 g2d_buf_from_virt_addr,
333 g2d_free,
334 g2d_flush,
335 g2d_finish,
336 })
337 }
338 }
339
340 pub unsafe fn g2d_open(
341 &self,
342 handle: *mut *mut ::std::os::raw::c_void,
343 ) -> ::std::os::raw::c_int {
344 unsafe {
345 (self
346 .g2d_open
347 .as_ref()
348 .expect("Expected function, got error."))(handle)
349 }
350 }
351
352 pub unsafe fn g2d_close(&self, handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int {
353 unsafe {
354 (self
355 .g2d_close
356 .as_ref()
357 .expect("Expected function, got error."))(handle)
358 }
359 }
360
361 pub unsafe fn g2d_make_current(
362 &self,
363 handle: *mut ::std::os::raw::c_void,
364 type_: g2d_hardware_type,
365 ) -> ::std::os::raw::c_int {
366 unsafe {
367 (self
368 .g2d_make_current
369 .as_ref()
370 .expect("Expected function, got error."))(handle, type_)
371 }
372 }
373
374 pub unsafe fn g2d_clear(
375 &self,
376 handle: *mut ::std::os::raw::c_void,
377 area: *mut g2d_surface,
378 ) -> ::std::os::raw::c_int {
379 unsafe {
380 (self
381 .g2d_clear
382 .as_ref()
383 .expect("Expected function, got error."))(handle, area)
384 }
385 }
386
387 pub unsafe fn g2d_blit(
388 &self,
389 handle: *mut ::std::os::raw::c_void,
390 src: *mut g2d_surface,
391 dst: *mut g2d_surface,
392 ) -> ::std::os::raw::c_int {
393 unsafe {
394 (self
395 .g2d_blit
396 .as_ref()
397 .expect("Expected function, got error."))(handle, src, dst)
398 }
399 }
400
401 pub unsafe fn g2d_copy(
402 &self,
403 handle: *mut ::std::os::raw::c_void,
404 d: *mut g2d_buf,
405 s: *mut g2d_buf,
406 size: ::std::os::raw::c_int,
407 ) -> ::std::os::raw::c_int {
408 unsafe {
409 (self
410 .g2d_copy
411 .as_ref()
412 .expect("Expected function, got error."))(handle, d, s, size)
413 }
414 }
415
416 pub unsafe fn g2d_multi_blit(
417 &self,
418 handle: *mut ::std::os::raw::c_void,
419 sp: *mut *mut g2d_surface_pair,
420 layers: ::std::os::raw::c_int,
421 ) -> ::std::os::raw::c_int {
422 unsafe {
423 (self
424 .g2d_multi_blit
425 .as_ref()
426 .expect("Expected function, got error."))(handle, sp, layers)
427 }
428 }
429
430 pub unsafe fn g2d_query_hardware(
431 &self,
432 handle: *mut ::std::os::raw::c_void,
433 type_: g2d_hardware_type,
434 available: *mut ::std::os::raw::c_int,
435 ) -> ::std::os::raw::c_int {
436 unsafe {
437 (self
438 .g2d_query_hardware
439 .as_ref()
440 .expect("Expected function, got error."))(handle, type_, available)
441 }
442 }
443
444 pub unsafe fn g2d_query_feature(
445 &self,
446 handle: *mut ::std::os::raw::c_void,
447 feature: g2d_feature,
448 available: *mut ::std::os::raw::c_int,
449 ) -> ::std::os::raw::c_int {
450 unsafe {
451 (self
452 .g2d_query_feature
453 .as_ref()
454 .expect("Expected function, got error."))(handle, feature, available)
455 }
456 }
457
458 pub unsafe fn g2d_query_cap(
459 &self,
460 handle: *mut ::std::os::raw::c_void,
461 cap: g2d_cap_mode,
462 enable: *mut ::std::os::raw::c_int,
463 ) -> ::std::os::raw::c_int {
464 unsafe {
465 (self
466 .g2d_query_cap
467 .as_ref()
468 .expect("Expected function, got error."))(handle, cap, enable)
469 }
470 }
471
472 pub unsafe fn g2d_enable(
473 &self,
474 handle: *mut ::std::os::raw::c_void,
475 cap: g2d_cap_mode,
476 ) -> ::std::os::raw::c_int {
477 unsafe {
478 (self
479 .g2d_enable
480 .as_ref()
481 .expect("Expected function, got error."))(handle, cap)
482 }
483 }
484
485 pub unsafe fn g2d_disable(
486 &self,
487 handle: *mut ::std::os::raw::c_void,
488 cap: g2d_cap_mode,
489 ) -> ::std::os::raw::c_int {
490 unsafe {
491 (self
492 .g2d_disable
493 .as_ref()
494 .expect("Expected function, got error."))(handle, cap)
495 }
496 }
497
498 pub unsafe fn g2d_cache_op(
499 &self,
500 buf: *mut g2d_buf,
501 op: g2d_cache_mode,
502 ) -> ::std::os::raw::c_int {
503 unsafe {
504 (self
505 .g2d_cache_op
506 .as_ref()
507 .expect("Expected function, got error."))(buf, op)
508 }
509 }
510
511 pub unsafe fn g2d_alloc(
512 &self,
513 size: ::std::os::raw::c_int,
514 cacheable: ::std::os::raw::c_int,
515 ) -> *mut g2d_buf {
516 unsafe {
517 (self
518 .g2d_alloc
519 .as_ref()
520 .expect("Expected function, got error."))(size, cacheable)
521 }
522 }
523
524 pub unsafe fn g2d_buf_from_fd(&self, fd: ::std::os::raw::c_int) -> *mut g2d_buf {
525 unsafe {
526 (self
527 .g2d_buf_from_fd
528 .as_ref()
529 .expect("Expected function, got error."))(fd)
530 }
531 }
532
533 pub unsafe fn g2d_buf_export_fd(&self, arg1: *mut g2d_buf) -> ::std::os::raw::c_int {
534 unsafe {
535 (self
536 .g2d_buf_export_fd
537 .as_ref()
538 .expect("Expected function, got error."))(arg1)
539 }
540 }
541
542 pub unsafe fn g2d_buf_from_virt_addr(
543 &self,
544 vaddr: *mut ::std::os::raw::c_void,
545 size: ::std::os::raw::c_int,
546 ) -> *mut g2d_buf {
547 unsafe {
548 (self
549 .g2d_buf_from_virt_addr
550 .as_ref()
551 .expect("Expected function, got error."))(vaddr, size)
552 }
553 }
554
555 pub unsafe fn g2d_free(&self, buf: *mut g2d_buf) -> ::std::os::raw::c_int {
556 unsafe {
557 (self
558 .g2d_free
559 .as_ref()
560 .expect("Expected function, got error."))(buf)
561 }
562 }
563
564 pub unsafe fn g2d_flush(&self, handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int {
565 unsafe {
566 (self
567 .g2d_flush
568 .as_ref()
569 .expect("Expected function, got error."))(handle)
570 }
571 }
572
573 pub unsafe fn g2d_finish(&self, handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int {
574 unsafe {
575 (self
576 .g2d_finish
577 .as_ref()
578 .expect("Expected function, got error."))(handle)
579 }
580 }
581}