Commit graph

21 commits

Author SHA1 Message Date
Daniel Verkamp
324877dbd8 media: ffmpeg: generate bindings in build.rs
Generate bindings for the installed version of the ffmpeg libraries at
build time instead of checking in a static version of the bindings.

BUG=b:309563850
TEST=cargo build --features=ffmpeg

Change-Id: I38d922dd7332c4385ae6a0ae93e893538c3b1cce
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5027711
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-12-08 20:58:57 +00:00
Alexandre Courbot
82ce97e6ac media: remove local libva and cros-codecs crates
Now that we have switched to the external versions of these crates,
remove our old local copies.

BUG=b:262824148
TEST=presubmit

Change-Id: I993e56831e0f5e895c036c8b40e8181f4577ae27
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518094
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-05-17 00:54:25 +00:00
Daniel Verkamp
ac0fc378a3 Fix remaining Chrome/Chromium OS instances
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>
2023-01-03 22:14:30 +00:00
Dennis Kempin
1dab58a2cf Update all copyright headers to match new style
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>
2022-09-13 18:41:29 +00:00
Daniel Almeida
9dbb169557 Reland "Add a VAAPI wrapper crate"
This is a reland of commit 213f9fe8a7.

In light of the upcoming VAAPI video decoder backend, add a VAAPI
wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
code. This crate will be called from the VAAPI video decoder backend in
order to decode frames.

BUG=b:214478588
TEST=cargo build --features "video-decoder,vaapi"
TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
device with Intel GPU and libva installed.

Change-Id: I586a160e477e466985c5cfa65a527542ddc03226
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3752274
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-13 06:51:27 +00:00
Alexandre Courbot
7f9050662f Revert "Add a VAAPI wrapper crate"
This reverts commit 213f9fe8a7.

Reason for revert: breaks the ChromeOS builder.

Original change's description:
> Add a VAAPI wrapper crate
>
> In light of the upcoming VAAPI video decoder backend, add a VAAPI
> wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
> code. This crate will be called from the VAAPI video decoder backend in
> order to decode frames.
>
> BUG=b:214478588
> TEST=cargo build --features "video-decoder,vaapi"
> TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
> device with Intel GPU and libva installed.
>
> Change-Id: I4afa96c49d045251827b97bd78faeba57575aedc

Bug: b:214478588
Change-Id: Ib5a88cd4c5fdd2df2e69fd3a0896ee789585840d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3752267
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-07-11 04:32:15 +00:00
Daniel Almeida
213f9fe8a7 Add a VAAPI wrapper crate
In light of the upcoming VAAPI video decoder backend, add a VAAPI
wrapper crate that exposes a safe Rust API for a subset of the VAAPI C
code. This crate will be called from the VAAPI video decoder backend in
order to decode frames.

BUG=b:214478588
TEST=cargo build --features "video-decoder,vaapi"
TEST=`cargo test -- --include-ignored` in `media/libva` passes on a
device with Intel GPU and libva installed.

Change-Id: I4afa96c49d045251827b97bd78faeba57575aedc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3422779
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-11 02:16:00 +00:00
David Stevens
3b6c7295e3 vm_memory: move udmabuf support to vm_memory
Refactor udmabuf support out from virtio_gpu into the shared vm_memory
target, so that can be used for vvu.

BUG=b:201745804
TEST=compiles
TEST=./tools/bindgen-all-the-things

Change-Id: I2944f0cb8c75e4320400bfb9f7026dc1efe0c12b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716339
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-01 05:29:23 +00:00
Alexandre Courbot
fc891cea82 virtio: video: decoder: add ffmpeg-based software decoder backend
The virtio video decoder device is currently only available under very
drastic conditions: a build linked against libvda (a ChromeOS-only
library that needs the cros chroot to be built and linked against), and
a ChromeOS-flavored Chrome instance running alongside crosvm, so the
browser can provide the video decoding service through Mojo.

This makes the decoder device very difficult to develop on for
non-Chromies, and also for Chromies actually since they will always need
a DUT to test it on.

This patch introduces an alternative decoder backend based on
ffmpeg's libraries that performs decoding on the host's CPU. It supports both
guest pages and virtio objects as target, and can be considered a
reliable and predictable way to test the decoder in any environment.

We introduce our own ffmpeg bindings after a quick state of the art
revealed that the existing ones were all unsuitable, either for
technical or licensing reasons. Doing so is also not a big effort and
does not add any new external crate dependency to crosvm.

BUG=b:169295147
TEST=cargo test --features "video-decoder,ffmpeg" -p devices ffmpeg
TEST=v4l2r's simple_decoder example decodes test-25fps.h264 properly with the
     following command:
     ./simple_decoder test-25fps.h264 /dev/video0 --input_format h264 --save test-25fps.nv12
TEST=ARCVM Android youtube plays videos correctly when the ffmpeg
     backend is used.

Change-Id: Ic9c586193f7939f2a3fe59d009c3666585a8bbc7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3026355
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-06-07 11:44:21 +00:00
Noah Gold
100aab600b tools: update bindgen docs.
BUG=none
TEST=n/a

Change-Id: I4853084af339516164bf5988742310a1a7c26c31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3617163
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2022-04-29 21:02:26 +00:00
Daniel Verkamp
f620437e8b virtio_sys: regenerate bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: I381dbc4d97e3a0a99dedd4416a347388daf4ccf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339853
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-04-11 21:14:01 +00:00
Daniel Verkamp
c30abefc07 vfio_sys: regenerate bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: Ia1dc0daeb8d642ca94336c671639691930a246f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339852
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-04-06 19:20:35 +00:00
Daniel Verkamp
ac0b33ad9f net_sys: regenerate bindgen bindings
This replaces the bindgen-based bindings with Rust libc crate types and
constants where possible, so our custom bindings are significantly
reduced.

BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: I7f20ecf5ccd651456f9a23ce7964fdbd0e8064ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339851
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-04-06 19:20:34 +00:00
Alexandre Courbot
c7cd0e0114 Move libvda to media/libvda
As we are going to introduce more media-related crates, reserve the
"media" folder as a placeholder for them, starting with the existing
libvda.

BUG=b:169295147
BUG=b:214478588
TEST=cargo build --features "video-decoder,video-encoder,libvda"

Change-Id: I1b2ec65cbba8b735db3d19845c504546fa1c64ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565623
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-04-06 01:19:07 +00:00
Dennis Kempin
00cbeb7d4c Refactoring script: Copy common/io_uring to io_uring
The crate is only used by cros_async, which has already been
copied to crosvm.
The old source location will eventually move to ChromeOS.

See go/future-of-sys-util for details

BUG=b:22320646
TEST=presubmit

Change-Id: Icf3522497cb4e8c04a4687403466b781f0d7a9ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3534501
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-03-21 19:52:56 +00:00
Daniel Verkamp
ce0d8c51e9 libvda: regenerate bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: I37112713dca5e8fef1299fcff72933cfcf06eafd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339810
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-17 22:26:56 +00:00
Daniel Verkamp
4da1409c03 kvm_sys: regenerate x86 and aarch64 bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: Iac652e043575f5c16acf4da5101dd89a15220f33
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339809
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-17 22:26:55 +00:00
Daniel Verkamp
f2df14802c kernel_loader: regenerate ELF bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: I6625b52691fc570e56005d4f59aeeea8d53e5eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339808
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-07 21:52:26 +00:00
Daniel Verkamp
fde6c3bb39 devices: virtio: gpu: regenerate udmabuf bindings
BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: If52944dc97bd61e62a0ee2e18df3bc976b95813d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339806
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-07 21:52:25 +00:00
Daniel Verkamp
90c1700c66 io_uring: regenerate bindgen bindings
The original io_uring bindings were hand edited to eliminate some of the
anonymous unions, so there are some changes in the helper functions.

BUG=b:218388029
TEST=tools/presubmit --quick

Change-Id: I8e049296020dd38ba7c97b096ca6cc346b0a20d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339805
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-07 21:52:24 +00:00
Daniel Verkamp
a6f8814c7b tools/bindgen-all-the-things: add script to regenerate bindings
Add a framework for bindgen scripts.

This will be filled in when each binding is added in upcoming separate
commits.

BUG=b:218388029
TEST=None

Change-Id: I62363b49d92ceb5b54700589c2329daace7181b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339804
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-03 23:47:03 +00:00