MappableHandle was implemented on the backend handle, but doing so is
sub-optimal in the case of VAAPI which needs to re-create the VA Image
with each call to a method of MappableHandle, which is a costly
operation.
Fix this by implementing MappableHandle on the Image directly. That way
callers can request the mappable handler once to create the image, and
call all the methods on the same instance.
This also allows us to make MappableHandle::image_size return the size
instead of a Result.
BUG=b:214478588
TEST=cargo build --features `video-decoder,video-encoder,ffmpeg,vaapi`
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Iaa048c1f488021d49376f612ebde560e84a11dc4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006228
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The dummy BackendHandles used for tests are the same across all codecs,
so share them.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ic9bd84c24363f9fbb255480ab2817c7c16dcebdc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006227
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
GenericBackendHandle is created, accessed and modified by the various
decoders directly, but the access patterns could easily be fulfilled by
a few methods.
This also allows us to make GenericBackendHandleInner private, as its
name suggests it should be, and to simplify it a bit.
BUG=b:214478588
TEST=cargo build --features `video-decoder,video-encoder,ffmpeg,vaapi`
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I9ef2a58361db37b69315c91e9ad337fd0c99b8cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005493
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The concept of mapped resolution is only used in the context of copying
the frame to a CPU-mapped buffer in order to compute the size of said
buffer according to the underlying format.
This requires the caller to check the buffer format and perform the
computation themselves. It would be more efficient to just have a
function performing that computation in a single place and returning the
final buffer size.
Thus, replace MappedHandle's mapped_resolution() method with
image_size(), which returns the size of the buffer that should be passed
to read().
BUG=b:214478588
TEST=cargo build --features `video-decoder,video-encoder,ffmpeg,vaapi`
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Icff17aa5e2e08676edb450a53316e44897604958
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005492
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
This reverts commit d39e5811df.
Reason for revert: libcras still uses VolatileRef and needs to be fixed before we can remove it
Original change's description:
> data_model: remove VolatileRef
>
> All uses except in test code have been eliminated, so we can remove it
> now.
>
> This was an unsafe abstraction, and we have better alternatives (such as
> the read_obj()/write_obj() functions) that do not create a long-lived
> mutable reference that could easily alias other slices.
>
> BUG=None
> TEST=tools/presubmit --all
>
> Change-Id: I84f1e2487d6211ce24b8fc992fa7675765870132
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824000
> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
> Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Bug: None
Change-Id: I867cd1adff6c0c895791833432acd4a64aef0506
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4018409
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
All uses except in test code have been eliminated, so we can remove it
now.
This was an unsafe abstraction, and we have better alternatives (such as
the read_obj()/write_obj() functions) that do not create a long-lived
mutable reference that could easily alias other slices.
BUG=None
TEST=tools/presubmit --all
Change-Id: I84f1e2487d6211ce24b8fc992fa7675765870132
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824000
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Improve the --serial option's errors for file operations by including
the path that could not be opened or created in the message.
Also replace the FileError uses for socket errors with their own
specific error variants.
BUG=None
TEST=crosvm run --serial type=file,path==/does/not/exist ...
Change-Id: Ia5eb71629b824e67f828e6516bf7771b2dba4903
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4010942
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
This CL adds allow directives for needless return on functions that have
void returns and use the pattern of "error and then return early", and
happen to have a currently-needless return as the last statement. This
is to prevent future bugs if the functions are extended.
Each case is documented with a comment explaining why the exception is
allowed.
BUG=chromium:908640, b:157245930
TEST=cargo clippy with needless_return suppression removed
Change-Id: I44f978b0cd9aa0d574acc73cd2f0a34f1b181e84
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4018392
Auto-Submit: Clarissa Garvey <clarissagarvey@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The test needs to be run single threaded and is not suitable
to be a unit tests.
Integration tests are automatically run single threaded.
BUG=None
TEST=presubmit
Change-Id: Idd49af90c7c1858b28ba47a642a8a808319138c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4018113
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
These tests make use of the io_uring features of the linux kernel,
which may not be available in all test environments.
This passes locally, but won't be run in CI due to the lack of
io_uring support on our builders.
BUG=b:244623067
TEST=tools/run_tests
Change-Id: Iff017dc24708c7f607f3d4e05d019701e5672b97
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4018112
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Disallow code emitting warnings in run_tests instead of
.cargo/config.toml.
There are three places where we can specify "-Dwarnings":
(1). rustflags in .cargo/config.toml
(2). flags in health-check
(3). RUSTFLAGS environment variable used in run_tests
(1) was the place where we had -Dwarnings, but this affects downstream
projects that use cargo. So, it can cause an unexpected build error when
unsupported combinations of feature flags are used in the downstream
project. So, we want to force "-Dwarnings" only in the upstream CI.
(2) is a place we already have the flag. However, the health-check script
only runs on x86_64 platform in our CI.
So, we choose (3) in this CL so we can force "-Dwarnings" only for fixed
sets of features used in the upstream CI. Also, this can support all of
platforms in the upstream CI.
BUG=b:181763000
TEST=CQ
Change-Id: Iceededcc51e19d6781758e7fd7d5a2d7941d9ebc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014329
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
1. remove `--current-branch` as it shouldn't be used for crOS
checkout as crOS can have ebuilds sync to commit not part of main
2. allow unshallow to fail as sometimes repo sync results in a deep
checkout
TEST=led get-builder luci.crosvm.ci:chromeos_hatch | led edit-cr-cl https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015697 | led edit-recipe-bundle | led launch
BUG=b:240692674
Change-Id: I10335c07dc5f907b7b8989b6af53a24c803844d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015697
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
This config does not include the privileges of the usual devcontainer.
BUG=None
TEST=Open in github codespaces
Passes both:
cargo test --workspace --lib --bins --features=all-x86_64
tools/run_tests --unit-tests
Change-Id: Ia68b0b4f7baa2be109079909eb023ba4eda5e037
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015008
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Before this CL, there were several places with suppressed clippy
warnings about needless_return statements following the same pattern of
spawning a worker thread in a match statement. After this CL, those
places have had the work refactored out of the match statement such that
there is no needless_return triggered by the code, but it does the same
thing.
BUG=chromium:908640, b:157245930
TEST=cargo clippy with needless_return suppression removed
Change-Id: Idfa4a16597d973ef840a031990c01640c4a8252d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014833
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This extra file/mod was left over from before the base/sys_util refactor
and is unnecessary now. Everything has been moved into the
stream_channel mod.
BUG=b:256739711
TEST=presubmit
Change-Id: Ie77c54e3f27ff2173c26060a62258941f710206a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015561
Reviewed-by: Richard Zhang <rizhang@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
They were missing before and would prevent some tests from being run.
BUG=None
TEST=cargo test --workspace --bins --lib
Change-Id: Iec9db80a15d8ddc2f4c83e6b272eae8a99f138d0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015007
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The fuzz binary targets do not compile upstream.
This allows us to run all unit tests via cargo.
BUG=None
TEST=cargo test --workspace --lib --bins
Change-Id: I3923c79a8d622824956599b9b8552c7d1a610b70
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015006
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
These tests require access to kvm and cannot run in every context.
The tests do not pass on aarch64, so the DO_NOT_RUN_AARCH64
flag remains.
BUG=b:244623107
TEST=presubmit
Change-Id: I221e1055dfe2da7c2f0763f1f26acc211ced4400
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990013
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
This reduces the runtime of devices unit tests from ~5s to 1.7s.
BUG=None
TEST=None
Change-Id: I9801bba025db71ea3c69d26f8afcfce07db7d894
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004680
Reviewed-by: Vikram Auradkar <auradkar@google.com>
The test would take ~5s to run, cutting down the number of blocks
to write/read in the test will improve execution speed to .5s.
BUG=None
TEST=tools/run_tests -v disk\*
Change-Id: Ia877335bc662f4e7c5c91eff56c072bb1eb30e8d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004300
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
The tests are explicitly verifying the timeout behavior, which
by default is 5s. We can speed up the tests by using a smaller
timeout when running a test.
Reduces the time to run the test from 6s to 1s
BUG=None
TEST=tools/run_tests cros_async:cros_async -v
Change-Id: I6262b653878171c6746a1ca90139b00a099dd91e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004299
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
This CL contains a few fixes to needless_return which need approval from
someone familiar with the code. In two cases, the return was removed
from a function that returns a value, so it is considered safe because
if code is added later into the function, it will be clear that this is
removing an implicit return from the function. In the last case
(iommu.rs), the function has several error! macros that do not trigger
an early return, so it seems that it is okay to remove the last early
return.
BUG=b:157245930, chromium:908640
TEST=cargo clippy (no logical code changes)
Change-Id: I00685c9033499a92713eb591eadb5f90c29e761d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014835
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Reviewed-by: David Stevens <stevensd@chromium.org>
Currently, we ignore clippy::needless_return, with many violations in
the code base. This CL fixes trivial, safe-to-fix violations of
needless_return. These were found by removing the needless_return
suppression in .cargo/config.toml and then fixing needless returns.
These are not all needless returns in the code base; it is only the
trivial fixes. This CL is a part of a chain of CLs to fix the
needless_returns in the code base.
BUG=chromium:908640, b:157245930
TEST=cargo clippy + cargo build
Change-Id: I6f8f3a0bed25d774fba7ae4b6e4c021af439ec22
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014832
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Clarissa Garvey <clarissagarvey@chromium.org>
Don't cause compile error when the `gdb` feature is specified on
unsupported platform (e.g. armhf). Instead, do nothing
when it's specified.
Also, enable "gdb" feature in all-armhf feature so it's tested in CI.
Note that this change is a follow-up of
https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4011747/comment/973cd5d8_02e5a2f7/
BUG=none
TEST=run_tests --platform=armhf with "gdb" feature enabled
Change-Id: I06fc2e428c3595eb01c7172759945aa4a3159e8a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015999
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This is a reland of commit 77688e305d
Tests are ignored on some architectures due to the single thread test
issues b/258371694
Original change's description:
> base: unix: add fork_process
>
> The vmm-swap feature will fork a process to run monitoring userfaultfd.
>
> crosvm uses minijail to fork device processes `ProxyDevice::new()`.
>
> Minijail panics on fork if there are any other threads running. The test
> must be executed in a single thread.
>
> design document: go/tanooki-phase1-dd
>
> BUG=b:215093219
> TEST=cargo test -p base -- --test-threads=1
>
> Change-Id: I408dbfa4d606cbe7b2218096b414512710d60100
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3935683
> Reviewed-by: David Stevens <stevensd@chromium.org>
Bug: b:215093219
Change-Id: I94b912b04947cada3e3332861f18988873dfcf81
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015626
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Auto-Submit: Shin Kawamura <kawasin@google.com>
The vmm-swap feature will fork a process to run monitoring userfaultfd.
crosvm uses minijail to fork device processes `ProxyDevice::new()`.
Minijail panics on fork if there are any other threads running. The test
must be executed in a single thread.
design document: go/tanooki-phase1-dd
BUG=b:215093219
TEST=cargo test -p base -- --test-threads=1
Change-Id: I408dbfa4d606cbe7b2218096b414512710d60100
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3935683
Reviewed-by: David Stevens <stevensd@chromium.org>
ProcessesGuard stops all the crosvm processes except the caller process
using SIGSTOP signal because we must guarantee that no one changes the
guest memory contents while vmm-swap out.
This is a short term solution and will be replaced with device
suspension feature later.
See the "Write back atomicity" section in go/tanooki-phase1-dd
BUG=b:215093219
TEST=cargo build --features=swap
Change-Id: Ie62a0cf537a045128c0d298e7a73d222fea96ef0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3932497
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
SwapFile saves the active pages in the memory region to a file.
design document: go/tanooki-phase1-dd
BUG=b:215093219
TEST=cargo test -p swap
Change-Id: I4ce16eef36ace832d26622e44444f7549299c1e7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3930082
Reviewed-by: David Stevens <stevensd@chromium.org>
userfaultfd enables applications to handle page faults on designated
memory area.
vmm-swap feature uses userfaultfd to catch page fault event and swap
in the guest memory from the swap file.
design document: go/tanooki-phase1-dd
BUG=b:215093219
TEST=cargo build --features=swap
Change-Id: I13ae09cd97e4215b00e5d834d4f97eb6b507b892
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3895235
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
We never use this method, so remove it. Besides how to copy an image is
dependent of the format and handled by read(), so this should be the
prefered way of accessing frames.
This also allows us to remove the dummy mapped handles.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I4909a33f2ba3dbcc61e27493ed0ad3b8a75cd882
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005491
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Error descriptions should have no leading capital and do not end with a
dot.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I807e4874c862bc8e32dc4a394b1e5e46df60c8d0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005489
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
These types are only used in two places, and their actual definition is
more explicit about their purpose.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I90eec9751bc4aaccab33fe70d96a94a5875f6f6c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3995769
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The DynDecodedHandle traits defined for each codec are basically
identical, and can be simplified into a single one now that we also have
a common DecodedHandle struct.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I666d941dfea5b5e40ca46dab661e87aec60d65e4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998376
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The DecodedHandle structs defined for each codec are basically identical
and can be simplified into a single one by adding an associated type.
Doing so required the H.264 types to be constrained with non-trivial
where clauses due to the fact the H264 PictureData is itself generic,
but there is a plan to simplify this too.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: Idcb0717740e6e700ae83d758f99ba0035981dcca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998375
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
SurfaceContainer was implemented for each codec type, but it can be
simplified into a single generic implementation if move the RefCell out
of InnerHandle.
Since SurfaceContainer's purpose is just to convert one object into a
Surface, rename it into the more idiomatic IntoSurface that just
requires TryInto<Option<Surface>>.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I00a56132ceaeab5d305e144976a9ea597355bbf8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998374
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The Picture structs defined for each codec are now basically identical,
and can be simplified into a single one by adding one generic argument.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs:wq
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I48a79c615f7c53de5d39bcf37da0b64d05c65a09
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998373
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
The Picture structs defined for each codec are essentially identical,
with only the H.264 one having its codec-specific data inlined into the
struct instead of being part of another one. Move the H.264 data in
order to make the 3 structures similar. This will allow us to merge them
into one common struct in the next CL.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I3282fde1dbbc2ad303f2691e00c46aa8b6c0de41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998372
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
backend_handle_unchecked* were only used in tests, and the DynPicture
interface provides equivalent functions anyway, so use these ones and
drop the former.
Ideally these methods that can potentially panic should be replaced by
something else, but this will have to wait further cleanups.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I339f6893599c5ffc24e738f5ad11f35cbfcaab25
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998371
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Prior to this CL, clippy warnings needless_doctest_main and
blocks_in_if_conditions were suppressed. It turns out they have no
violations, as removing them and running cargo clippy produces no
warning. This CL removes those suppressions.
BUG=b:157245930, chromium:908640
Test=cargo clippy
Change-Id: I82f82bf2fdb7740f45e7187a9b2710fb7dc2ca04
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015559
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Clarissa Garvey <clarissagarvey@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The value of VIRTIO_GPU_RESP_OK_RESOURCE_PLANE_INFO (which is not
upstream) conflicts with upstream VIRTIO_GPU_RESP_OK_EDID. We assign
both VIRTIO_GPU_RESP_OK_EDID and VIRTIO_GPU_RESP_OK_RESOURCE_UUID to the
same value.
BUG=b:2050923
TEST=none (just comments)
Change-Id: I8fe2c3818e451cc456ae6c15b9b827c22cfbd6e9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993318
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Chad Versace <chadversary@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>