2017-10-06 22:30:34 +00:00
|
|
|
[package]
|
|
|
|
name = "vm_control"
|
|
|
|
version = "0.1.0"
|
2022-12-29 21:24:33 +00:00
|
|
|
authors = ["The ChromiumOS Authors"]
|
2022-03-08 01:16:09 +00:00
|
|
|
edition = "2021"
|
2017-10-06 22:30:34 +00:00
|
|
|
|
2020-10-21 06:57:33 +00:00
|
|
|
[features]
|
2022-07-25 23:54:13 +00:00
|
|
|
balloon = []
|
2022-07-04 10:58:14 +00:00
|
|
|
gdb = ["gdbstub", "gdbstub_arch"]
|
2022-09-19 00:06:37 +00:00
|
|
|
gpu = []
|
2020-10-21 06:57:33 +00:00
|
|
|
|
2017-10-06 22:30:34 +00:00
|
|
|
[dependencies]
|
2022-06-09 21:22:51 +00:00
|
|
|
anyhow = "*"
|
2021-11-11 06:37:32 +00:00
|
|
|
balloon_control = { path = "../common/balloon_control" }
|
2022-03-16 19:16:04 +00:00
|
|
|
base = { path = "../base" }
|
2022-06-09 21:22:51 +00:00
|
|
|
cfg-if = "*"
|
2021-10-27 18:04:03 +00:00
|
|
|
data_model = { path = "../common/data_model" }
|
2022-07-25 12:28:01 +00:00
|
|
|
gdbstub = { version = "0.6.3", optional = true }
|
|
|
|
gdbstub_arch = { version = "0.2.4", optional = true }
|
2020-06-21 04:45:32 +00:00
|
|
|
hypervisor = { path = "../hypervisor" }
|
2017-10-06 22:30:34 +00:00
|
|
|
libc = "*"
|
2023-04-06 10:30:38 +00:00
|
|
|
once_cell = "1.7.2"
|
2021-08-18 21:25:27 +00:00
|
|
|
remain = "*"
|
2019-04-06 21:30:04 +00:00
|
|
|
resources = { path = "../resources" }
|
rutabaga_gfx: rutabaga_gralloc: a shimmering beacon of hope
rutabaga_gralloc is a cross-platform, Rust-based buffer
manager.
The rationale for this change is:
1) For the {cross-domain, wayland} context type, we need to
have a good story for the crucial "wl-dmabuf" feature. As
minigbm has been thoroughly tested on ChromeOS and currently
powers the "wl-dmabuf" feature, it only makes sense for us to
have a path to minigbm for the cross-domain prototype. This
will be used by Sommelier.
2) While minigbm allocation works well on Chromebooks, it is
not sufficient for cross-platform purposes. For their Virtual
Graphics Interface (VGI) initiative, Android graphics
virtualization experts have expressed their desire for a Vulkan
based allocator. This will to go alongside cros_gralloc in
minigbm, which is considered by many to be the ""world's
premiere gralloc implementation".
3) Android graphics virtualization experts have expressed their
desire for vkMapMemory(..) to be used when crosvm is in
multi-process mode. Currently, only dma-buf mmap() is supported
for zero-copy blobs in multi-process mode. dma-buf mmap() is not
guaranteed to work on Nvidia (a "must have" for Cuttlefish) or
any other driver for that matter (we *make* it work for ChromeOS).
Possibly only solution: vkMapMemory ;-)
With these goals in mind, here's a summary of the revelant changes:
* Renamed the {gpu_allocator.rs, GpuMemoryAllocator trait} to be
{gralloc.rs, Gralloc trait}.
* Moved all GPU allocation out of the resources crate and into
the rutabaga_gfx crate. This will allow the resources crate to
be focused on managing resources for virtual machines.
* Moved the gpu_buffer crate into the gralloc module in the
rutabaga_gfx crate. The same functionality is now under
"minigbm.rs", "minigbm_bindings.rs" and "rendernode.rs"
* Added an optional dependency on vulkano.rs. vulkano.rs is a safe
Rust wrapper around the Vulkan api [a]. It's emphasis on type
safety makes a good fit for crosvm, though there are other high
quality crates out there (gfx-rs, ash.rs). Though development
has slowed down, it should satisfy goals (2) and (3) quite easily.
* Added a system_gralloc implementation based on memfd. This can be
used when minigbm or Vulkano features are not used, to replicate the
highly useful "wl-shm" feature in Sommelier. Astute observers will
note this can also enable seamless Wayland windowing without GPU
features for Android too. Some minor changes to the base crate were
needed.
* Cut down on the amount of DrmFormats to the subset needed by
Sommelier and cros_gralloc.
* Moved checked arithmetic into it's own file.
* Internally renamed to "wl-dmabuf" feature to be the "minigbm"
feature. This is because "wl-dmabuf" has a dependency on minigbm.
* Small rutabaga_gfx cleanups
[a] https://github.com/vulkano-rs/vulkano/blob/master/DESIGN.md
BUG=b:146066070, b:173630595, b:150239451
TEST=launch virtual machine with 2D mode
TEST=launch virtual machine with 3D mode
TEST=run sommelier with "wl-dmabuf" and "wl-shm"
Change-Id: I693a39cef64cd98e56d843d3c60caa7983d4d6e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2626487
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
2020-12-09 18:44:13 +00:00
|
|
|
rutabaga_gfx = { path = "../rutabaga_gfx"}
|
2021-01-07 16:30:28 +00:00
|
|
|
serde = { version = "1", features = [ "derive" ] }
|
2021-05-24 08:13:45 +00:00
|
|
|
serde_json = "*"
|
2022-09-19 00:06:37 +00:00
|
|
|
serde_keyvalue = { path = "../serde_keyvalue", features = ["argh_derive"] }
|
2021-10-27 18:04:03 +00:00
|
|
|
sync = { path = "../common/sync" }
|
2021-08-18 21:25:27 +00:00
|
|
|
thiserror = "*"
|
2020-07-21 03:21:11 +00:00
|
|
|
vm_memory = { path = "../vm_memory" }
|
2022-10-07 06:35:27 +00:00
|
|
|
|
2022-09-02 15:49:50 +00:00
|
|
|
[target.'cfg(target_os="linux")'.dependencies]
|
|
|
|
swap = { path = "../swap", optional = true }
|
|
|
|
|
2022-10-07 06:35:27 +00:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
|
|
winapi = "*"
|