mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
gfxstream: fix renderer callbacks definitions
Test: launch_cvd --gpu_mode=gfxstream Change-Id: I1cbfdd6107101e966763e6a2c70cdf66cefe216a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3567644 Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Kaiyi Li <kaiyili@google.com>
This commit is contained in:
parent
5ab8b89846
commit
bb24159038
1 changed files with 32 additions and 4 deletions
|
@ -29,12 +29,35 @@ use crate::rutabaga_utils::*;
|
||||||
|
|
||||||
use data_model::VolatileSlice;
|
use data_model::VolatileSlice;
|
||||||
|
|
||||||
|
#[repr(C)]
|
||||||
|
pub struct VirglRendererGlCtxParam {
|
||||||
|
pub version: c_int,
|
||||||
|
pub shared: bool,
|
||||||
|
pub major_ver: c_int,
|
||||||
|
pub minor_ver: c_int,
|
||||||
|
}
|
||||||
|
|
||||||
// In gfxstream, only write_fence is used (for synchronization of commands delivered)
|
// In gfxstream, only write_fence is used (for synchronization of commands delivered)
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct GfxstreamRendererCallbacks {
|
pub struct VirglRendererCallbacks {
|
||||||
pub version: c_int,
|
pub version: c_int,
|
||||||
pub write_fence: unsafe extern "C" fn(cookie: *mut c_void, fence: u32),
|
pub write_fence: unsafe extern "C" fn(cookie: *mut c_void, fence: u32),
|
||||||
|
pub create_gl_context: Option<
|
||||||
|
unsafe extern "C" fn(
|
||||||
|
cookie: *mut c_void,
|
||||||
|
scanout_idx: c_int,
|
||||||
|
param: *mut VirglRendererGlCtxParam,
|
||||||
|
) -> *mut c_void,
|
||||||
|
>,
|
||||||
|
pub destroy_gl_context: Option<unsafe extern "C" fn(cookie: *mut c_void, ctx: *mut c_void)>,
|
||||||
|
pub make_current: Option<
|
||||||
|
unsafe extern "C" fn(cookie: *mut c_void, scanout_idx: c_int, ctx: *mut c_void) -> c_int,
|
||||||
|
>,
|
||||||
|
|
||||||
|
pub get_drm_fd: Option<unsafe extern "C" fn(cookie: *mut c_void) -> c_int>,
|
||||||
|
pub write_context_fence:
|
||||||
|
Option<unsafe extern "C" fn(cookie: *mut c_void, fence: u64, ctx_idx: u32, ring_idx: u8)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -58,7 +81,7 @@ extern "C" {
|
||||||
display_type: u32,
|
display_type: u32,
|
||||||
renderer_cookie: *mut c_void,
|
renderer_cookie: *mut c_void,
|
||||||
renderer_flags: i32,
|
renderer_flags: i32,
|
||||||
renderer_callbacks: *mut GfxstreamRendererCallbacks,
|
renderer_callbacks: *mut VirglRendererCallbacks,
|
||||||
gfxstream_callbacks: *mut c_void,
|
gfxstream_callbacks: *mut c_void,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -200,9 +223,14 @@ impl Drop for GfxstreamContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const GFXSTREAM_RENDERER_CALLBACKS: &GfxstreamRendererCallbacks = &GfxstreamRendererCallbacks {
|
const GFXSTREAM_RENDERER_CALLBACKS: &VirglRendererCallbacks = &VirglRendererCallbacks {
|
||||||
version: 1,
|
version: 3,
|
||||||
write_fence,
|
write_fence,
|
||||||
|
create_gl_context: None,
|
||||||
|
destroy_gl_context: None,
|
||||||
|
make_current: None,
|
||||||
|
get_drm_fd: None,
|
||||||
|
write_context_fence: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn map_func(resource_id: u32) -> ExternalMappingResult<(u64, usize)> {
|
fn map_func(resource_id: u32) -> ExternalMappingResult<(u64, usize)> {
|
||||||
|
|
Loading…
Reference in a new issue