1 // Copyright 2019 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 /* automatically generated by rust-bindgen */ 6 7 #[link(name = "virglrenderer")] 8 extern "C" {} 9 10 pub const VIRGL_RENDERER_CALLBACKS_VERSION: u32 = 2; 11 pub const VIRGL_RENDERER_USE_EGL: u32 = 1; 12 pub const VIRGL_RENDERER_THREAD_SYNC: u32 = 2; 13 pub const VIRGL_RENDERER_USE_GLX: u32 = 4; 14 pub const VIRGL_RENDERER_USE_SURFACELESS: u32 = 8; 15 pub const VIRGL_RENDERER_USE_GLES: u32 = 16; 16 pub const VIRGL_RES_BIND_DEPTH_STENCIL: u32 = 1; 17 pub const VIRGL_RES_BIND_RENDER_TARGET: u32 = 2; 18 pub const VIRGL_RES_BIND_SAMPLER_VIEW: u32 = 8; 19 pub const VIRGL_RES_BIND_VERTEX_BUFFER: u32 = 16; 20 pub const VIRGL_RES_BIND_INDEX_BUFFER: u32 = 32; 21 pub const VIRGL_RES_BIND_CONSTANT_BUFFER: u32 = 64; 22 pub const VIRGL_RES_BIND_STREAM_OUTPUT: u32 = 2048; 23 pub const VIRGL_RES_BIND_CURSOR: u32 = 65536; 24 pub const VIRGL_RES_BIND_CUSTOM: u32 = 131072; 25 pub const VIRGL_RES_BIND_SCANOUT: u32 = 262144; 26 pub type __uint32_t = ::std::os::raw::c_uint; 27 pub type __uint64_t = ::std::os::raw::c_ulong; 28 pub type va_list = __builtin_va_list; 29 #[repr(C)] 30 #[derive(Debug, Copy, Clone)] 31 pub struct virgl_box { 32 _unused: [u8; 0], 33 } 34 #[repr(C)] 35 #[derive(Debug, Copy, Clone)] 36 pub struct iovec { 37 _unused: [u8; 0], 38 } 39 pub type virgl_renderer_gl_context = *mut ::std::os::raw::c_void; 40 #[repr(C)] 41 #[derive(Debug, Copy, Clone)] 42 pub struct virgl_renderer_gl_ctx_param { 43 pub version: ::std::os::raw::c_int, 44 pub shared: bool, 45 pub major_ver: ::std::os::raw::c_int, 46 pub minor_ver: ::std::os::raw::c_int, 47 } 48 #[repr(C)] 49 #[derive(Debug, Copy, Clone)] 50 pub struct virgl_renderer_callbacks { 51 pub version: ::std::os::raw::c_int, 52 pub write_fence: ::std::option::Option< 53 unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void, fence: u32), 54 >, 55 pub create_gl_context: ::std::option::Option< 56 unsafe extern "C" fn( 57 cookie: *mut ::std::os::raw::c_void, 58 scanout_idx: ::std::os::raw::c_int, 59 param: *mut virgl_renderer_gl_ctx_param, 60 ) -> virgl_renderer_gl_context, 61 >, 62 pub destroy_gl_context: ::std::option::Option< 63 unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void, ctx: virgl_renderer_gl_context), 64 >, 65 pub make_current: ::std::option::Option< 66 unsafe extern "C" fn( 67 cookie: *mut ::std::os::raw::c_void, 68 scanout_idx: ::std::os::raw::c_int, 69 ctx: virgl_renderer_gl_context, 70 ) -> ::std::os::raw::c_int, 71 >, 72 pub get_drm_fd: ::std::option::Option< 73 unsafe extern "C" fn(cookie: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, 74 >, 75 } 76 extern "C" { virgl_renderer_init( cookie: *mut ::std::os::raw::c_void, flags: ::std::os::raw::c_int, cb: *mut virgl_renderer_callbacks, ) -> ::std::os::raw::c_int77 pub fn virgl_renderer_init( 78 cookie: *mut ::std::os::raw::c_void, 79 flags: ::std::os::raw::c_int, 80 cb: *mut virgl_renderer_callbacks, 81 ) -> ::std::os::raw::c_int; 82 } 83 extern "C" { virgl_renderer_poll()84 pub fn virgl_renderer_poll(); 85 } 86 extern "C" { virgl_renderer_get_cursor_data( resource_id: u32, width: *mut u32, height: *mut u32, ) -> *mut ::std::os::raw::c_void87 pub fn virgl_renderer_get_cursor_data( 88 resource_id: u32, 89 width: *mut u32, 90 height: *mut u32, 91 ) -> *mut ::std::os::raw::c_void; 92 } 93 extern "C" { virgl_renderer_get_rect( resource_id: ::std::os::raw::c_int, iov: *mut iovec, num_iovs: ::std::os::raw::c_uint, offset: u32, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int, width: ::std::os::raw::c_int, height: ::std::os::raw::c_int, )94 pub fn virgl_renderer_get_rect( 95 resource_id: ::std::os::raw::c_int, 96 iov: *mut iovec, 97 num_iovs: ::std::os::raw::c_uint, 98 offset: u32, 99 x: ::std::os::raw::c_int, 100 y: ::std::os::raw::c_int, 101 width: ::std::os::raw::c_int, 102 height: ::std::os::raw::c_int, 103 ); 104 } 105 extern "C" { virgl_renderer_get_fd_for_texture( tex_id: u32, fd: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int106 pub fn virgl_renderer_get_fd_for_texture( 107 tex_id: u32, 108 fd: *mut ::std::os::raw::c_int, 109 ) -> ::std::os::raw::c_int; 110 } 111 extern "C" { virgl_renderer_get_fd_for_texture2( tex_id: u32, fd: *mut ::std::os::raw::c_int, stride: *mut ::std::os::raw::c_int, offset: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int112 pub fn virgl_renderer_get_fd_for_texture2( 113 tex_id: u32, 114 fd: *mut ::std::os::raw::c_int, 115 stride: *mut ::std::os::raw::c_int, 116 offset: *mut ::std::os::raw::c_int, 117 ) -> ::std::os::raw::c_int; 118 } 119 #[repr(C)] 120 #[derive(Debug, Copy, Clone)] 121 pub struct virgl_renderer_resource_create_args { 122 pub handle: u32, 123 pub target: u32, 124 pub format: u32, 125 pub bind: u32, 126 pub width: u32, 127 pub height: u32, 128 pub depth: u32, 129 pub array_size: u32, 130 pub last_level: u32, 131 pub nr_samples: u32, 132 pub flags: u32, 133 } 134 pub type virgl_debug_callback_type = ::std::option::Option< 135 unsafe extern "C" fn(fmt: *const ::std::os::raw::c_char, ap: *mut __va_list_tag), 136 >; 137 extern "C" { virgl_renderer_resource_create( args: *mut virgl_renderer_resource_create_args, iov: *mut iovec, num_iovs: u32, ) -> ::std::os::raw::c_int138 pub fn virgl_renderer_resource_create( 139 args: *mut virgl_renderer_resource_create_args, 140 iov: *mut iovec, 141 num_iovs: u32, 142 ) -> ::std::os::raw::c_int; 143 } 144 extern "C" { virgl_renderer_resource_import_eglimage( args: *mut virgl_renderer_resource_create_args, image: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int145 pub fn virgl_renderer_resource_import_eglimage( 146 args: *mut virgl_renderer_resource_create_args, 147 image: *mut ::std::os::raw::c_void, 148 ) -> ::std::os::raw::c_int; 149 } 150 extern "C" { virgl_renderer_resource_unref(res_handle: u32)151 pub fn virgl_renderer_resource_unref(res_handle: u32); 152 } 153 extern "C" { virgl_renderer_resource_set_priv(res_handle: u32, priv_: *mut ::std::os::raw::c_void)154 pub fn virgl_renderer_resource_set_priv(res_handle: u32, priv_: *mut ::std::os::raw::c_void); 155 } 156 extern "C" { virgl_renderer_resource_get_priv(res_handle: u32) -> *mut ::std::os::raw::c_void157 pub fn virgl_renderer_resource_get_priv(res_handle: u32) -> *mut ::std::os::raw::c_void; 158 } 159 extern "C" { virgl_renderer_context_create( handle: u32, nlen: u32, name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int160 pub fn virgl_renderer_context_create( 161 handle: u32, 162 nlen: u32, 163 name: *const ::std::os::raw::c_char, 164 ) -> ::std::os::raw::c_int; 165 } 166 extern "C" { virgl_renderer_context_destroy(handle: u32)167 pub fn virgl_renderer_context_destroy(handle: u32); 168 } 169 extern "C" { virgl_renderer_submit_cmd( buffer: *mut ::std::os::raw::c_void, ctx_id: ::std::os::raw::c_int, ndw: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int170 pub fn virgl_renderer_submit_cmd( 171 buffer: *mut ::std::os::raw::c_void, 172 ctx_id: ::std::os::raw::c_int, 173 ndw: ::std::os::raw::c_int, 174 ) -> ::std::os::raw::c_int; 175 } 176 extern "C" { virgl_renderer_transfer_read_iov( handle: u32, ctx_id: u32, level: u32, stride: u32, layer_stride: u32, box_: *mut virgl_box, offset: u64, iov: *mut iovec, iovec_cnt: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int177 pub fn virgl_renderer_transfer_read_iov( 178 handle: u32, 179 ctx_id: u32, 180 level: u32, 181 stride: u32, 182 layer_stride: u32, 183 box_: *mut virgl_box, 184 offset: u64, 185 iov: *mut iovec, 186 iovec_cnt: ::std::os::raw::c_int, 187 ) -> ::std::os::raw::c_int; 188 } 189 extern "C" { virgl_renderer_transfer_write_iov( handle: u32, ctx_id: u32, level: ::std::os::raw::c_int, stride: u32, layer_stride: u32, box_: *mut virgl_box, offset: u64, iovec: *mut iovec, iovec_cnt: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int190 pub fn virgl_renderer_transfer_write_iov( 191 handle: u32, 192 ctx_id: u32, 193 level: ::std::os::raw::c_int, 194 stride: u32, 195 layer_stride: u32, 196 box_: *mut virgl_box, 197 offset: u64, 198 iovec: *mut iovec, 199 iovec_cnt: ::std::os::raw::c_uint, 200 ) -> ::std::os::raw::c_int; 201 } 202 extern "C" { virgl_renderer_get_cap_set(set: u32, max_ver: *mut u32, max_size: *mut u32)203 pub fn virgl_renderer_get_cap_set(set: u32, max_ver: *mut u32, max_size: *mut u32); 204 } 205 extern "C" { virgl_renderer_fill_caps(set: u32, version: u32, caps: *mut ::std::os::raw::c_void)206 pub fn virgl_renderer_fill_caps(set: u32, version: u32, caps: *mut ::std::os::raw::c_void); 207 } 208 extern "C" { virgl_renderer_resource_attach_iov( res_handle: ::std::os::raw::c_int, iov: *mut iovec, num_iovs: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int209 pub fn virgl_renderer_resource_attach_iov( 210 res_handle: ::std::os::raw::c_int, 211 iov: *mut iovec, 212 num_iovs: ::std::os::raw::c_int, 213 ) -> ::std::os::raw::c_int; 214 } 215 extern "C" { virgl_renderer_resource_detach_iov( res_handle: ::std::os::raw::c_int, iov: *mut *mut iovec, num_iovs: *mut ::std::os::raw::c_int, )216 pub fn virgl_renderer_resource_detach_iov( 217 res_handle: ::std::os::raw::c_int, 218 iov: *mut *mut iovec, 219 num_iovs: *mut ::std::os::raw::c_int, 220 ); 221 } 222 extern "C" { virgl_renderer_create_fence( client_fence_id: ::std::os::raw::c_int, ctx_id: u32, ) -> ::std::os::raw::c_int223 pub fn virgl_renderer_create_fence( 224 client_fence_id: ::std::os::raw::c_int, 225 ctx_id: u32, 226 ) -> ::std::os::raw::c_int; 227 } 228 extern "C" { virgl_renderer_force_ctx_0()229 pub fn virgl_renderer_force_ctx_0(); 230 } 231 extern "C" { virgl_renderer_ctx_attach_resource( ctx_id: ::std::os::raw::c_int, res_handle: ::std::os::raw::c_int, )232 pub fn virgl_renderer_ctx_attach_resource( 233 ctx_id: ::std::os::raw::c_int, 234 res_handle: ::std::os::raw::c_int, 235 ); 236 } 237 extern "C" { virgl_renderer_ctx_detach_resource( ctx_id: ::std::os::raw::c_int, res_handle: ::std::os::raw::c_int, )238 pub fn virgl_renderer_ctx_detach_resource( 239 ctx_id: ::std::os::raw::c_int, 240 res_handle: ::std::os::raw::c_int, 241 ); 242 } 243 extern "C" { virgl_set_debug_callback(cb: virgl_debug_callback_type) -> virgl_debug_callback_type244 pub fn virgl_set_debug_callback(cb: virgl_debug_callback_type) -> virgl_debug_callback_type; 245 } 246 #[repr(C)] 247 #[derive(Default, Debug, Copy, Clone)] 248 pub struct virgl_renderer_resource_info { 249 pub handle: u32, 250 pub virgl_format: u32, 251 pub width: u32, 252 pub height: u32, 253 pub depth: u32, 254 pub flags: u32, 255 pub tex_id: u32, 256 pub stride: u32, 257 pub drm_fourcc: ::std::os::raw::c_int, 258 } 259 extern "C" { virgl_renderer_resource_get_info( res_handle: ::std::os::raw::c_int, info: *mut virgl_renderer_resource_info, ) -> ::std::os::raw::c_int260 pub fn virgl_renderer_resource_get_info( 261 res_handle: ::std::os::raw::c_int, 262 info: *mut virgl_renderer_resource_info, 263 ) -> ::std::os::raw::c_int; 264 } 265 extern "C" { virgl_renderer_cleanup(cookie: *mut ::std::os::raw::c_void)266 pub fn virgl_renderer_cleanup(cookie: *mut ::std::os::raw::c_void); 267 } 268 extern "C" { virgl_renderer_reset()269 pub fn virgl_renderer_reset(); 270 } 271 extern "C" { virgl_renderer_get_poll_fd() -> ::std::os::raw::c_int272 pub fn virgl_renderer_get_poll_fd() -> ::std::os::raw::c_int; 273 } 274 pub type __builtin_va_list = [__va_list_tag; 1usize]; 275 #[repr(C)] 276 #[derive(Debug, Copy, Clone)] 277 pub struct __va_list_tag { 278 pub gp_offset: ::std::os::raw::c_uint, 279 pub fp_offset: ::std::os::raw::c_uint, 280 pub overflow_arg_area: *mut ::std::os::raw::c_void, 281 pub reg_save_area: *mut ::std::os::raw::c_void, 282 } 283