mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
gpu_renderer: update bindings
Use virglrenderer to get the metadata associated with a buffer. We must do this before we allocate the guest kernel pages, so they agree with host requirements. This implements the rough API outlined here: https://gitlab.freedesktop.org/virgl/virglrenderer/issues/119 Probably we want this in virv-renderer eventually, but that may take some time, so for prototyping just use non-upstreamed virglrenderer functions. BUG=chromium:924405 TEST=compile Change-Id: If78f274c813c2131b297144172019848806e3a0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1790831 Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This commit is contained in:
parent
c554fff206
commit
f585543065
1 changed files with 28 additions and 0 deletions
|
@ -116,6 +116,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
pub const VIRGL_RENDERER_STRUCTURE_TYPE_NONE: virgl_renderer_structure_type_v0 = 0;
|
pub const VIRGL_RENDERER_STRUCTURE_TYPE_NONE: virgl_renderer_structure_type_v0 = 0;
|
||||||
pub const VIRGL_RENDERER_STRUCTURE_TYPE_EXPORT_QUERY: virgl_renderer_structure_type_v0 = 1;
|
pub const VIRGL_RENDERER_STRUCTURE_TYPE_EXPORT_QUERY: virgl_renderer_structure_type_v0 = 1;
|
||||||
|
pub const VIRGL_RENDERER_STRUCTURE_TYPE_SUPPORTED_STRUCTURES: virgl_renderer_structure_type_v0 = 2;
|
||||||
pub type virgl_renderer_structure_type_v0 = u32;
|
pub type virgl_renderer_structure_type_v0 = u32;
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Default, Copy, Clone)]
|
#[derive(Debug, Default, Copy, Clone)]
|
||||||
|
@ -153,6 +154,13 @@ pub struct virgl_renderer_export_query {
|
||||||
pub out_offsets: [u32; 4usize],
|
pub out_offsets: [u32; 4usize],
|
||||||
pub out_modifier: u64,
|
pub out_modifier: u64,
|
||||||
}
|
}
|
||||||
|
#[repr(C)]
|
||||||
|
#[derive(Debug, Default, Copy, Clone)]
|
||||||
|
pub struct virgl_renderer_supported_structures {
|
||||||
|
pub hdr: virgl_renderer_hdr,
|
||||||
|
pub in_stype_version: u32,
|
||||||
|
pub out_supported_structures_mask: u32,
|
||||||
|
}
|
||||||
pub type virgl_debug_callback_type = ::std::option::Option<
|
pub type virgl_debug_callback_type = ::std::option::Option<
|
||||||
unsafe extern "C" fn(fmt: *const ::std::os::raw::c_char, ap: *mut __va_list_tag),
|
unsafe extern "C" fn(fmt: *const ::std::os::raw::c_char, ap: *mut __va_list_tag),
|
||||||
>;
|
>;
|
||||||
|
@ -299,6 +307,26 @@ extern "C" {
|
||||||
execute_size: u32,
|
execute_size: u32,
|
||||||
) -> ::std::os::raw::c_int;
|
) -> ::std::os::raw::c_int;
|
||||||
}
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn virgl_renderer_allocation_metadata(
|
||||||
|
request: *const ::std::os::raw::c_void,
|
||||||
|
response: *mut ::std::os::raw::c_void,
|
||||||
|
request_size: u32,
|
||||||
|
response_size: u32,
|
||||||
|
) -> ::std::os::raw::c_int;
|
||||||
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn virgl_renderer_resource_create_v2(
|
||||||
|
resource_id: u32,
|
||||||
|
guest_memory_type: u32,
|
||||||
|
guest_caching_type: u32,
|
||||||
|
size: u64,
|
||||||
|
iovec: *const iovec,
|
||||||
|
num_iovs: u32,
|
||||||
|
args: *const ::std::os::raw::c_void,
|
||||||
|
args_size: u32,
|
||||||
|
) -> ::std::os::raw::c_int;
|
||||||
|
}
|
||||||
pub type __builtin_va_list = [__va_list_tag; 1usize];
|
pub type __builtin_va_list = [__va_list_tag; 1usize];
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
|
|
Loading…
Reference in a new issue