2017-10-06 22:26:46 +00:00
|
|
|
[package]
|
|
|
|
name = "devices"
|
|
|
|
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:26:46 +00:00
|
|
|
|
2018-04-23 01:42:09 +00:00
|
|
|
[features]
|
2022-09-26 21:45:39 +00:00
|
|
|
arc_quota = ["dbus", "protobuf", "system_api"]
|
2020-03-18 18:00:47 +00:00
|
|
|
audio = []
|
2021-06-23 18:34:31 +00:00
|
|
|
audio_cras = ["libcras"]
|
2022-07-25 23:54:13 +00:00
|
|
|
balloon = []
|
2022-09-29 17:46:42 +00:00
|
|
|
gpu = ["gpu_display"]
|
2022-10-12 22:33:38 +00:00
|
|
|
gunyah = []
|
2022-10-12 03:18:50 +00:00
|
|
|
libvda-stub = ["libvda/libvda-stub"]
|
2023-08-29 19:50:40 +00:00
|
|
|
net = []
|
2023-02-13 04:57:30 +00:00
|
|
|
geniezone = []
|
2021-05-21 20:55:10 +00:00
|
|
|
usb = []
|
2023-04-28 02:24:39 +00:00
|
|
|
vaapi = ["cros-codecs/vaapi", "downcast-rs", "crc32fast"]
|
2021-07-11 14:06:30 +00:00
|
|
|
video-decoder = []
|
|
|
|
video-encoder = []
|
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
|
|
|
minigbm = ["rutabaga_gfx/minigbm"]
|
2022-03-22 04:36:27 +00:00
|
|
|
x = ["gpu_display/x", "rutabaga_gfx/x"]
|
2020-12-14 23:20:45 +00:00
|
|
|
virgl_renderer = ["gpu", "rutabaga_gfx/virgl_renderer"]
|
2022-09-14 19:42:41 +00:00
|
|
|
virgl_renderer_next = ["gpu", "rutabaga_gfx/virgl_renderer_next"]
|
2022-09-28 17:32:52 +00:00
|
|
|
vtpm = ["system_api", "protobuf", "dbus"]
|
rutabaga_gfx: an electrifying possibility
rutabaga_gfx is a cross platform, Rust-based, Wayland and
Vulkan-centric Virtual Graphics Interface (VGI).
Apologies for the mega-change, but it was hard to do this piece
by piece.
The rationale for this change is:
1) Android graphics virtualization experts have been proposing
for a VGI for many months (years?). Their goal is to boot
Android anywhere, everywhere.
2) For the {wayland, cross-domain} context type prototype,
it's desirable to create a {wayland, camera} connection at the
appropriate time. Details can be found in the code, though the
RutabagaChannels have yet to be hooked up.
There's a high chance neither effort will work. As such,
rutabaga is just a prototype.
However, even (1) and (2) don't end up working, this
refactor/cleanup by itself makes a ton of sense.
Here's a summary of revelant changes:
* Removed auto-generated {p_defines, p_format, virgl_protocol}.
These files were added for tests when bringing up crosvm-gpu,
and AFAICT these tests are not run. There's actually now a
commit queue for virglrenderer changes and container boot tests
that provides excellent coverage.
* Removed command_buffer.rs. Used only for the previously
mentioned tests. It's quite nice, but couldn't determine the right
place to put it. Maybe data_model? But removed it in the interim.
* Removed {write_from_guest_memory, read_to_volatile}. The same
basic functionality has been moved into {transfer_write,
transfer_read} in Rutabaga.
* Removed VirtioResource, Virtio3DResource, Virtio2DResource,
and VirtioGfxStreamResource in favor of VirtioGpuResource and
RutabagaResource. This leads to less duplication and clearer
separation between external library functions and VMM functions.
* Moved display and hypervisor memory management functions to
virtio_gpu.rs. This is because external components do not interface
with this functionality, and there was a lot of duplication (for example
map/unmap blob).
* Added context management between gfxstream and virglrenderer.
* Added separate gfxstream and virglrenderer flags.
* Clearer naming.
* Added simple implementations for context init and multiple timelines.
These changes have no effect since all Google kernels don't pass the
revelant flags, but are useful for theoretical {wayland, cross-domain}
prototype.
* Unify RESOURCE_CREATE_3D and RESOURCE_CREATE_2D handling.
* Better error handling.
BUG=b:146066070, b:173630595, b:150239451
TEST=launch virtual machine with 2D mode
TEST=launch virtual machine with 3D mode
TEST=boot ARCVM
Change-Id: I240b0c134a3b562cbc65981837a41f6db7767c92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2522452
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2020-10-20 01:31:13 +00:00
|
|
|
gfxstream = ["gpu", "rutabaga_gfx/gfxstream"]
|
2023-05-10 19:10:52 +00:00
|
|
|
registered_events = []
|
2022-11-08 16:18:43 +00:00
|
|
|
slirp = ["net_util/slirp"]
|
2022-07-13 01:02:32 +00:00
|
|
|
stats = []
|
2023-02-23 23:21:55 +00:00
|
|
|
seccomp_trace = []
|
2023-04-28 06:09:25 +00:00
|
|
|
swap = ["swap/enable"]
|
2022-06-21 19:47:16 +00:00
|
|
|
whpx = []
|
2023-06-13 10:48:29 +00:00
|
|
|
pci-hotplug = []
|
2018-04-23 01:42:09 +00:00
|
|
|
|
2017-10-06 22:26:46 +00:00
|
|
|
[dependencies]
|
2021-12-13 23:41:47 +00:00
|
|
|
argh = "0.1.7"
|
2021-03-22 08:49:57 +00:00
|
|
|
async-task = "4"
|
2020-04-27 08:32:13 +00:00
|
|
|
acpi_tables = {path = "../acpi_tables" }
|
2021-08-16 08:02:52 +00:00
|
|
|
anyhow = "*"
|
2022-11-09 00:44:17 +00:00
|
|
|
async-trait = "0.1.36"
|
2018-12-06 19:47:18 +00:00
|
|
|
audio_streams = "*"
|
2023-03-02 03:06:55 +00:00
|
|
|
audio_util = { path = "../audio_util" }
|
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" }
|
2018-07-18 20:26:44 +00:00
|
|
|
bit_field = { path = "../bit_field" }
|
2022-03-16 02:33:27 +00:00
|
|
|
cfg-if = "1.0.0"
|
2023-08-11 18:30:20 +00:00
|
|
|
chrono = { version = "0.4.19", features = [ "serde" ] }
|
2022-03-09 13:08:56 +00:00
|
|
|
crc32fast = { version = "1.2.1", optional = true }
|
2022-03-17 18:26:01 +00:00
|
|
|
cros_async = { path = "../cros_async" }
|
2023-06-29 03:23:44 +00:00
|
|
|
cros-codecs = { version = "0.0.4", optional = true }
|
2022-10-17 20:47:21 +00:00
|
|
|
crosvm_cli = { path = "../crosvm_cli" }
|
2021-10-27 18:04:03 +00:00
|
|
|
data_model = { path = "../common/data_model" }
|
2021-06-21 11:59:04 +00:00
|
|
|
dbus = { version = "0.9", optional = true }
|
2019-07-02 23:54:05 +00:00
|
|
|
disk = { path = "../disk" }
|
2022-03-09 13:08:56 +00:00
|
|
|
downcast-rs = { version = "1.2.0", optional = true }
|
2021-11-05 23:07:59 +00:00
|
|
|
enumn = "0.1.0"
|
2022-06-02 02:18:48 +00:00
|
|
|
ffmpeg = { path = "../media/ffmpeg", optional = true }
|
2022-10-07 06:35:27 +00:00
|
|
|
gpu_display = { path = "../gpu_display", optional = true }
|
2022-09-29 17:46:42 +00:00
|
|
|
rutabaga_gfx = { path = "../rutabaga_gfx" }
|
2020-04-30 22:48:47 +00:00
|
|
|
hypervisor = { path = "../hypervisor" }
|
2019-04-23 09:14:43 +00:00
|
|
|
kvm_sys = { path = "../kvm_sys" }
|
2017-10-06 22:26:46 +00:00
|
|
|
libc = "*"
|
2022-04-01 07:03:40 +00:00
|
|
|
libvda = { path = "../media/libvda", optional = true }
|
2019-12-17 18:07:11 +00:00
|
|
|
linux_input_sys = { path = "../linux_input_sys" }
|
2022-02-09 16:29:29 +00:00
|
|
|
memoffset = { version = "0.6" }
|
2017-10-06 22:26:46 +00:00
|
|
|
net_sys = { path = "../net_sys" }
|
2022-12-05 23:47:57 +00:00
|
|
|
net_util = { path = "../net_util" }
|
2022-05-31 22:32:25 +00:00
|
|
|
num-traits = "0.2"
|
2021-07-26 06:49:03 +00:00
|
|
|
once_cell = "1.7.2"
|
2022-12-22 20:20:41 +00:00
|
|
|
power_monitor = { path = "../power_monitor" }
|
2023-04-06 19:45:32 +00:00
|
|
|
protobuf = { version = "3.2", optional = true }
|
2019-04-05 18:56:44 +00:00
|
|
|
protos = { path = "../protos", optional = true }
|
2022-06-23 17:56:04 +00:00
|
|
|
rand = "0.8"
|
2019-03-11 19:36:30 +00:00
|
|
|
remain = "*"
|
2018-06-07 22:42:41 +00:00
|
|
|
resources = { path = "../resources" }
|
2021-01-07 16:30:28 +00:00
|
|
|
serde = { version = "1", features = [ "derive" ] }
|
2021-06-25 09:30:34 +00:00
|
|
|
serde_json = "1"
|
2022-06-01 19:31:29 +00:00
|
|
|
serde_keyvalue = { path = "../serde_keyvalue", features = ["argh_derive"] }
|
2021-02-10 08:50:57 +00:00
|
|
|
smallvec = "1.6.1"
|
2021-10-27 18:04:03 +00:00
|
|
|
sync = { path = "../common/sync" }
|
2022-09-26 21:20:48 +00:00
|
|
|
system_api = { path = "../system_api", optional = true }
|
2020-12-03 02:25:53 +00:00
|
|
|
thiserror = "1.0.20"
|
2022-10-14 22:14:39 +00:00
|
|
|
cros_tracing = { path = "../cros_tracing" }
|
2023-04-28 06:09:25 +00:00
|
|
|
swap = { path = "../swap" }
|
2023-07-10 21:38:23 +00:00
|
|
|
vmm_vhost = { path = "../third_party/vmm_vhost", features = ["vmm", "device"] }
|
2017-10-06 22:26:46 +00:00
|
|
|
virtio_sys = { path = "../virtio_sys" }
|
|
|
|
vm_control = { path = "../vm_control" }
|
2020-07-21 03:21:11 +00:00
|
|
|
vm_memory = { path = "../vm_memory" }
|
2023-09-20 19:11:35 +00:00
|
|
|
zerocopy = { version = "0.7", features = ["derive"] }
|
2019-04-18 04:09:41 +00:00
|
|
|
|
2022-06-10 06:05:46 +00:00
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
|
|
fuse = {path = "../fuse" }
|
|
|
|
libcras = { version = "*", optional = true }
|
|
|
|
minijail = "*"
|
|
|
|
p9 = "*"
|
|
|
|
usb_util = { path = "../usb_util" }
|
|
|
|
vfio_sys = { path = "../vfio_sys" }
|
2023-04-17 21:26:46 +00:00
|
|
|
vhost = { path = "../vhost" }
|
2022-06-10 06:05:46 +00:00
|
|
|
|
2022-06-24 21:57:01 +00:00
|
|
|
[target.'cfg(windows)'.dependencies]
|
2022-06-24 22:28:57 +00:00
|
|
|
broker_ipc = { path = "../broker_ipc" }
|
2022-07-22 02:38:15 +00:00
|
|
|
metrics = { path = "../metrics" }
|
2022-06-24 21:57:01 +00:00
|
|
|
tube_transporter = { path = "../tube_transporter" }
|
2022-10-17 21:24:42 +00:00
|
|
|
win_audio = { path = "../win_audio"}
|
2022-07-22 02:38:15 +00:00
|
|
|
win_util = { path = "../win_util"}
|
2022-06-24 22:28:57 +00:00
|
|
|
winapi = "*"
|
2022-06-24 21:57:01 +00:00
|
|
|
|
2020-01-09 07:14:08 +00:00
|
|
|
[dependencies.futures]
|
|
|
|
version = "*"
|
2021-12-06 13:42:14 +00:00
|
|
|
features = ["async-await", "std"]
|
2020-01-09 07:14:08 +00:00
|
|
|
default-features = false
|
|
|
|
|
2019-04-18 04:09:41 +00:00
|
|
|
[dev-dependencies]
|
2022-04-12 22:51:26 +00:00
|
|
|
bytes = "1.1.0"
|
2022-06-02 02:18:48 +00:00
|
|
|
crc32fast = "1"
|
2023-03-24 06:46:46 +00:00
|
|
|
libtest-mimic = "0.6"
|
2023-04-06 11:21:31 +00:00
|
|
|
named-lock = "0.3"
|
2023-03-24 06:46:46 +00:00
|
|
|
tempfile = "3"
|