Useful for falling back to older methods of rendering when
needed.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: Ic5b99e68f09f59c08bf29a2d42848c5451e4bbd8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4409070
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
It's more traditional to install headers this way.
BUG=b:273555494
TEST=compile
Change-Id: I9cbcee18adf488fe54a0630ab9229ae231b16692
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4409071
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
- Use spaces instead of tabs
- Use Clang format in Chromium build tools (also same one used
by gfxstream), i.e:
~/buildtools/linux64/clang-format -i rutabaga_gfx_ffi.h
BUG=b:273555494
TEST=rutabaga_test
Change-Id: I1aa4d87f1d694fe3200281dada33dcc915a0afd7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4409068
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
The base crate has some nifty abstractions but also
pulls in things like minijail, audio_streams and
various random items.
This prevents true cross-platform interoperatibility,
which requires the ability to upload to crates.io
with relative ease.
This change removes the base crate. The replacement
strategy is two fold:
- For things like SafeDescriptor which don't have
adequate solutions on crates.io, just copy it
internally. I think SafeDescriptor in particular --
since it works on bot Windows/Linux should probably
be made into a separate crate long-term since it is
generically valuable. Similarly for the Event and
WaitContext APIs. For now, live with the duplication.
- Otherwise, the nix crate does most of the Linux
specific items.
The cross-domain context type has a lot of dependencies
on Linux sockets / epoll. This is refactored to look more
like the Fuchsia solution, which uses std::sync::mspc
channels to connect to an utility Wayland FIDL library.
The rest of Rutabaga mostly relies just on SafeDescriptor
and the ability to clone it. rutabaga_gralloc allows
provides shared memory used via virtwl.
Another thing to call out is zerocopy is now strongly
versioned to the latest stable release on crates.io
I also got rid of #[cfg(feature = "virgl_renderer_next")]
on the renderer server fd, since it was complicating the
refactoring. SafeDescriptor works everywhere and adding
the #ifdef should be reserved for the lowest-levels of
platform specific code when possible.
Overall, this makes compiling on Fuchsia hosts much
simpler.
BUG=b:273555494
TEST= - run cross_domain context type, see Wayland apps
- note there is a previous bug in cross domain
when resizing windows, it occurs before this CL.
The reason seems to be raciness and can likely be fixed
gfxstream-like seqno.
- run gfxstream + virgl on Linux, verify everything works.
Change-Id: I7519f2b8ed0cd57c47980d4e76403057498cf064
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353700
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This tracks librust-log-dev, which is at version 0.4.17-3 in the
Debian package tracker.
It may be possible to use another version too.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: Ib0aaca5800f22960dad89b4e138a0dd5fefcb9c2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353699
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
It doesn't work quite out of the box, even if you've built
gfxstream. The problem is 'sudo make install` in gfxstream
doesn't install anything, including pkg-config files. Those
interested in the FFI/gfxstream should just modify the
"GFXSTREAM_PATH" environment variable in build.rs until
b/246990929 is fixed.
BUG=b:273555494, b:246990929
TEST=build and run with gfxstream feature
Change-Id: I53af69ae39f12d15a1d8307ea7ae3c2b6cec1114
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4370739
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
SafeDescriptor works everywhere and adding the #ifdef should be
reserved for the lowest-levels of platform specific code when
possible.
BUG=b:273555494
TEST=compile
Change-Id: I6ea898679df49d13ad9dc6bac6956546fcd4097e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4357099
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Don't hard code it when we can actually ask rutabaga.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: I3072e8a797af1bd822e1bea664fa5bfcbb40d621
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353698
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
iovecs are not defined on Windows.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: I7aa8949ed105a129ea070a5bcbf46f6f5470783d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353697
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
We should install headers in include dir.
BUG=b:273555494
TEST=rutabaga_test
Change-Id: I6ccaa886d6537f69157a7cd81383a4b46f788a18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353696
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
- the concept of a ComponentType should be internal to Rutabaga,
use context_mask instead
- Versioning matching both FFI lib and Rust lib
BUG=b:273555494
TEST=rutabaga_test
Change-Id: I5806247a591f598ccbbd0d5b8e935480b636244b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4353694
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
This creates a makefile for rutabaga_gfx. Most package managers
seem to still use Cargo to compile, but not packagement. We need
to install headers and the library.
I looked into to cargo-c, but it was just easier to open code it.
BUG=b:173630595
TEST=sudo make install
export LD_LIBRARY_PATH=/usr/local/lib
make and run rutabaga_test
Change-Id: Ibd68ecd0c6215cc36bc104d843847ee47d02123e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4335238
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
These should be written as ChromeOS and ChromiumOS (without the space)
to match the updated branding. The copyright headers were already
migrated to the new style (https://crrev.com/c/3894243), but there were
some more instances left over.
BUG=None
TEST=tools/cargo-doc
Change-Id: I8c76aea2eb33b2e370ab71ee9b5cc0a4cfd00585
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4129934
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Only when virgl_renderer_next is enabled, get_server_fd() is used,
and RutabagaBuilder::new() takes the second argument.
BUG=b:213151426
TEST=presubmit
Change-Id: Ieb275f481d9eea1e845e2356ebc1aa3c4334c114
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4032189
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Commit-Queue: Pujun Lun <lunpujun@google.com>
Some types have a typo on them. For the FFI case we don't currently use
the definition so it should be safe to rename.
BUG=b:244622199
TEST=presubmit
Change-Id: I9e3c29755f0c4479b54bef206f9173ab22030ab9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3913992
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Idan Raiter <idanr@google.com>
While we are tweaking all of the copyright headers, let's take the
opportunity to ensure there is always a blank line after the copyright
header for consistency. (Almost all files already follow this style.)
This includes a slightly ugly regex to allow the end of a C-style
comment block after the end of the copyright:
/*
* Example comment block
*/ <-- this line
Change-Id: Idfd0855861e5ecb3d33afae942fdba908af0dcff
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3892521
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.
This fulfills the request from legal and unifies our notices.
./tools/health-check has been updated to only accept this style.
BUG=b:246579983
TEST=./tools/health-check
Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
crosvm is switching the import style to use one import per line.
While more verbose, this will greatly reduce the occurence of merge
conflicts going forward.
Note: This is using a nightly feature of rustfmt. So it's a one-off
re-format only. We are considering adding a nightly toolchain to
enable the feature permanently.
BUG=b:239937122
TEST=CQ
Change-Id: Id2dd4dbdc0adfc4f8f3dd1d09da1daafa2a39992
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784345
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Nobody ever toggles this flag, implying this flag can be removed.
By default, the gfxstream assumes ANDROID_EMU_virtio_gpu_native_sync
is present, which is the desired behavior.
BUG=b:239639751
TEST=compile gfxstream
Change-Id: I64d19c5fc2c0ac59a87ee25fbd1e7b6ed9522410
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3778078
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
A lot of these flags can be deprecated over time. For example,
specifying the context type and "use_vulkan" is a bit redundant.
Things like "use_syncfd" and "use_guest_angle" can also be removed.
BUG=b:173630595
TEST=compile
Change-Id: I77bff7f02ebfd3b0e65145d144bfc15afa50f386
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3655286
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Commit-Queue: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
A way to control exposed capsets.
BUG=b:230100768
TEST=gfxbench, android games in arcvm
Change-Id: I91616405b695be73d6cc872aa5ae2a9dcecd0fb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3636799
Commit-Queue: Rob Clark <robdclark@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Rob Clark <robdclark@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Follow-up to commit 13108989b1 to fix
broken rutabaga ffi after introducing the new context_name parameter
to create_context().
BUG=b:230678191
BUG=b:230788302
TEST=emerge crosvm
Change-Id: If1165662e66dd349ef4c52bece26fe724a861b78
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3621210
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Run tests for sys_util_core, poll_token_derive and balloon_control on
windows.
Using dotfiles to disable/serialize test runs of a subset of crates does
not work well with third party crates as it forces us to commit the dot
file to the crate.
The patch modifies and uses the script that runs linux tests.
This patch also allows us to
- build/test child crate even if parent crate has disabled build/test.
- avoid building crosvm if it is not explicitly specified.
RIP short lived .windows_build_test_skip. You allowed us to run noop
kokoro tests.
Test: py .\tools\impl\test_runner.py --arch x86_64
Bug: b:215610772
Change-Id: Icc6d04ffd7c0c33d4f60aeac16fc7d23881c387d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3459809
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
The crate requires special compilation flags that conflict with the
workspace flags.
We may want to consider moving it to common/ so the test runner can
compile it in a separate workspace.
This brings us one step closer to be able to run
`cargo build --workspace` with no excludes.
BUG=b:206689789
TEST=./tools/presubmit
Change-Id: Ice747ced00f81db0a8e05ff2bc43d4d0e323e456
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3453050
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Windows HANDLE is defined as void* which is incompatible with current
os_handle type i32. Change that to i64.
TEST=launch_cvd --gpu_mode=gfxstream
BUG=b:217977329
Change-Id: I78c6c4c0d7573773ed530d8987b932438222144f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3445529
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>
The patch also adds files to skip building and testing crates on
windows. When we run
```
tools/windows/build_test.py --skip_file_name .windows_build_test_skip
```
the build/test succeeds without actually doing anything as build/test
for all crates is skipped by creating '.windows_build_test_skip'.
Bug: 213170957
Test: Ran script on downstream repo
Change-Id: Iebd2cea463ee722be4feaed88229e1fb5e9fd6c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3417918
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
When the flag is set, virglrenderer can use the get_server_fd callback
to get the socket to the render server.
BUG=b:177267762
TEST=run vk and gl apps on volteer
Change-Id: I692b5068a04e841b0a0ed2344a77908e720e19eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3283506
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
virglrenderer can return an fd of type VIRGL_RENDERER_BLOB_FD_TYPE_SHM.
BUG=b:177267762
TEST=run vk and gl apps on volteer
Change-Id: Ie8def22f3dc6dc13a4972955aadabb91be838493
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3283505
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Chia-I Wu <olv@google.com>
As before, some are automatically fixed by clippy, some manually
fixed.
BUG=b:192373803
TEST=./tools/presubmit
Change-Id: Ifcab4cf60775ee6bb7d4530af6406a74958432ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3283683
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>