New option, --size-only, speeds up using build_test for getting release
binary size by skipping everything else. The lto flag is also added for
release builds to get a more realistic comparison.
The list of crates to test is built up automatically instead of
hard coded. To modify what gets included, empty .build_test_* files are
checked for existance. This is better than hard coding the list of
packages because it was frequently out of date.
For certain crate tests, a dynamic library that only exists in a sysroot
is required. This change includes a fix that adds the sysroot's lib
directory to the LD_LIBRARY_PATH env variable, similar to how
PKG_CONFIG_LIBDIR is modified.
TEST=build_test
BUG=None
Change-Id: I626cbcccf40035a0d29001cef7989a091848e4c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2444273
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zach Reizner <zachr@chromium.org>
GAVDA checks if the client sends any buffer between 2
AssignPictureBuffers() call. To guarantee crosvm always passes buffers
after AssignPictureBuffers() call, this CL moves the call just before
passing the first buffer to VDA session.
BUG=b:168557465
TEST=run android.media.cts.AdaptivePlaybackTest#testVP8_adaptiveDrcEarlyEos
and not see GAVDA's error log mentioned at commit message
Change-Id: I777ff914688ea589a4cf8921fc05ad59d3161b5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2463052
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
AsyncCmdTag::Clear tag contains the queue type information. This CL
checks if the queue type matches the target when cancelling the
command.
BUG=b:168557465
TEST=android.media.cts.AdaptivePlaybackTest#testVP8_flushConfigureDrc
Change-Id: I8960ebaebc48c4fffbc8aaa326edeab449284c09
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2437685
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Semantically, MsgSocket is !Sync: multiple threads reading/writing to
the same end of the socket will result in U.B.. This CL brings the
syntactic definition of MsgSocket in line with its semantic meaning by
marking it as !Sync. While earlier work caught one of the other
consumers that was using a socket end in a Sync manner, this CL has
found another: the usb crate.
The fixes proposed for the usb crate are mostly for compilation's sake,
and should have little material effect on the operation of crosvm. Note
that they will assure correctness, since the send/recv for the socket
end involved are in the same critical section.
BUG=None
TEST=builds
Change-Id: I38469d9ed3228a43457b7d43879a6b4fff97b9a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2466960
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
There are no *at variants for the xattr syscalls so we were using the
path-based variants by reading the /proc/self/fd symlink. While this
symlink can track renames it cannot track if the user hard links the
file to some other location and then unlinks the original location. In
this case the symlink simply shows that the path was deleted even though
the fd is still valid.
To deal with this, stop using the path-based method. For regular files
and directories, we can simply open them and then make the appropriate
f{get,set,list,remove}xattr syscall. For non-regular files and
directories we can emulate an *at syscall by changing the CWD to /proc
and then making the path-based syscall via the self/fd path. Even
though the symlink is no longer valid, manipulating the fd via this path
still works.
BUG=b:168689429
TEST=Create a file, set an xattr, hard link it to a new location,
unlink the original, and then verify that {get,set}fattr still
works on the new link
Change-Id: Ic291f432b96f18e3e7ccbcf27737d5f8fd240a65
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2437684
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
The block, qcow, and zimage fuzzers all created a SharedMemory and then
converted it into a file; with the new base API changes, this is no
longer supported. Replace the SharedMemory uses with tempfile to fix
the build (this also simplifies the code).
BUG=chromium:1136895
TEST=`FEATURES=test USE='asan fuzz' emerge-amd64-generic crosvm`
Change-Id: I50d4e8c57ed41419c79a3fac440654224696f80c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2463895
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
When set, VCPUs aren't presented to the guest as hyperthreads,
on Intel.
Instead, present them as different, non-hyperthreaded cores on
the same package. Presenting them as hyperthreads might make the
guest scheduler migrate tasks between VCPUs more aggressively,
which can be expensive in a VM.
AMD will need a different CL.
BUG=b:169828263
TEST="cat /proc/sys/kernel/sched_domain/cpu0/domain0/name" in
the guest returns "MC" instead of "SMT" when starting crosvm
with --no-smt.
Change-Id: Ifdb4d54a3d7d83c5620fa768ce88ba1a0d85ee50
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2460534
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Suleiman Souhlal <suleiman@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Suleiman Souhlal <suleiman@chromium.org>
Enables VRA mode to support different sample rates for playback.
With the change, the resampling can be reduced in the GuestOS.
BUG=b:168082107
TEST=`sox -n -t s16 -c2 -r${RATE} synth sine 440 vol 0.1\
| aplay -D hw:0,0 -r${RATE} -f S16_LE -c2` works
correctly in the GuestOS.
Cq-Depend: chromium:2434114
Change-Id: I7d254173d41ac6b4688894113808785de9162b50
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2399167
Tested-by: Judy Hsiao <judyhsiao@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Judy Hsiao <judyhsiao@chromium.org>
Auto-Submit: Judy Hsiao <judyhsiao@chromium.org>
The queue_type field was removed in crrev.com/c/2408597 as
decoder is no longer using it, but it will be used by the encoder.
BUG=b:140082257
TEST=USE=test emerge-$BOARD crosvm
Change-Id: Iae552cc05b82eea67a7cff854ba350fb579a8f5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2456226
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Alex Lau <alexlau@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
Commit-Queue: Alex Lau <alexlau@chromium.org>
A recently introduced workaround for a VDA limitation caused clearing
the output queue to be handled synchronously instead of going through
the Async path used when clearing the input queue. This change makes
sure that we still cancel any pending resources on the output queue.
BUG=b:170053625
TEST=arc.VideoDecodeAccelPerf.vp9_2160p_60fps_vm 20 times w/o warnings
Change-Id: Ib24bdc3053c40ffb6f953021f29ef7a31ea216a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2452313
Tested-by: David Stevens <stevensd@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
As these are PCI devices, the guest can handle and dynamically discover
more of these devices.
Test: create a Cuttlefish device with 18 serial ports, check the device IDs
Bug: b/170149708
Change-Id: Ia2ad73b3a05ee885ce222917c72a53b423fde7c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2450455
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Note the CL size is large entirely due to the rename,
the changes are mostly negligible.
Also making a few small additional changes in sys_util
areas that don't need much attention in base. This includes
typedefing and adding specific imports for areas that don't
require significant interface changes.
BUG=b:162363783
TEST=./build_test
Change-Id: I4a2c9c4cdce7565806ed338e241c6b8c82c855c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2415180
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Michael Hoyle <mikehoyle@google.com>
This removes RunnableVcpu as an associated type on Vcpu traits, instead
using the new VcpuRunHandle type to enforce the same guarantees. This
simplifies implementations of Vcpu becuase only one impl is needed with
all the methods provided.
The other advantage to removing RunnableVcpu was that a Vcpu could be
try_cloned, defeating the purpose of consuming the Vcpu in the first
place with to_runnable. The type system and ownership model gave a false
sense of compile time safety. The usage of VcpuRunHandle is more
consistent with the fact that it is a runtime check that the programmer
is doing the safe thing. It's also consistent with all hypervisor impls.
BUG=None
TEST=./build_test
Change-Id: I14bbc5d939744cb92fb9cb3152edb82603cadd11
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2442096
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Zach Reizner <zachr@chromium.org>
Previously DataInit did not specify that any implementor `T` must not
contain implicit padding, though implementors of DataInit often include
a safety statement mentioning that they have no implicit padding. This
CL updates DataInit to clarify that any implementor must certify it has
no implicit padding to be safe / free of undefined behavior.
BUG=none
TEST=none (comment only change)
Change-Id: Ieddce51949bfa65de65a891deae071a744b0a4ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2439301
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
This is mostly a place holder that will be replaced if and when we
determine a complete plan for consuming crates from rust-vmm.
Change-Id: I8eec6313f40822a887b34d51b462268de5d01fd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2429813
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Originally we clear all the fields about both input and output
resource when either input or output queue gets ResourceDestroyAll
command.
In this CL, we handle this command for the input or output queue
separately.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_adaptiveDrc
Change-Id: Ib7873a8192e9e0d01d6ea869eb8ea8661b6d1060
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2417793
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
At crrev.com/c/2416067 we split OutputResources out of Context struct.
Similiarly, this CL splits the fields that related to the input
resource to a dedicated struct `InputResources`.
Note that the field `res_id_to_res_handle` was shared by both input
and output resources. This CL split this field into both InputResources
and OutputResources struct.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_adaptiveDrc
Change-Id: I664815078e08f1e78ec9de2f6674dbdedd7fd482
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2428486
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
At crrev.com/c/2416067 we split the fields that are related to output
resource from Context struct out to OutputResources struct. Also, we
move the methods that only interact with these fields to the
OutputResources's implementation. However, these methods are designed
from the aspect of Context struct, not OutputResources.
In this CL, we re-design the method of OutputResources to make the
interaction between Context and OutputResources more clear.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_adaptiveDrc
Change-Id: Ib9a3fad8e0d71159c07ce5345b067a2c9924a119
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2417791
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Some fields of the `Context` struct are related to the output
resources. These fields should be cleared together. This CL
consolidates these fields to another struct to make the code clear.
Note that we add `keep_resources` and `set_output_buffer_count` fields
into OutputResources struct. Originally these two fields are not
cleared with other fields together. So this CL is not just a refactor
CL, it changes the reset logic.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_adaptiveDrc
Change-Id: I6843e835b6c488e74623704618ee54a5273eb7ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2416067
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Previously, the VFIO code was using a single IRQ VM control socket
within an Arc<> container for both MSI and MSI-X; however, MsgSocket is
not technically Sync. In order to remove the Sync trait from MsgSocket,
split the MSI and MSI-X uses into two separate sockets and remove the
Arc wrapper.
BUG=None
TEST=./build_test
Change-Id: Ib620521be3d02bc9b66c1cc771c34feb8622993c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2436399
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This will ensure that pinned VCPU threads get the per-core CPUID
information from the correct host CPU; previously, the host CPUID
instruction was executed on whatever host core the thread happened to be
running on.
BUG=b:167714813
TEST=Boot crosvm with --cpu-affinity and check core id in /proc/cpuinfo
Change-Id: If06155acb86c4b68d7fb1f8190836c5611e4d32f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2436955
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Very little of substance is added here, just the base boilerplate
BUG=b:162363783
TEST=./build_test
Change-Id: I2e3b3b45cf1d7234784d769b4dced31f10a8774d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2366110
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Michael Hoyle <mikehoyle@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
This is very largely boilerplate, but changes some interfaces
to accept different parameters, esp using Descriptor.
BUG=b:162363783
TEST=./build_test
Change-Id: I81b513c0de9448c2de505fe5d3a61a29f4eccb78
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2342591
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Michael Hoyle <mikehoyle@google.com>
Change the inner helper methods to take an &InodeData instead of an
Inode. This removes the need to fetch the data from the map, which can
reduce unnecessary lookups when the calling method already has the data
on hand.
BUG=none
TEST=cargo test
Change-Id: Ia57a543e68d7aa63544f187bdefefe5a4d20c6a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2437683
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Now that readdirplus is handled by the server there's no need to have a
separate do_readdir method. Just merge it into the readdir method.
BUG=none
TEST=cargo test
Change-Id: I77475a64a13316bfbcd97a91610c6aa2ec0a9aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2437682
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Add helper functions for common operations so that we don't have to
copy-paste the same thing everywhere.
BUG=none
TEST=cargo test
Change-Id: Ia9dd132336470cdaa5ecef72945f23f6d1dd4401
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2437681
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
This leaf is used to identify the APIC ID on Intel systems.
Fixes guest kernel warnings of this type:
[Firmware Bug]: CPU1: APIC id mismatch. Firmware: 1 APIC: 11
BUG=b:167714813
TEST=Boot Linux guest kernel; check dmesg
Change-Id: Icc3d32f5a382704c28ecc174b98c982c574bd2b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2402154
Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
When requested with the --gpu=cache-path=/path arg, crosvm
will pass it to Mesa via env var MESA_GLSL_CACHE_DIR. In
addition, the cache-size will also be passed along if
provided.
BUG=b:168540438
TEST=run with --gpu=cache-path=/tmp,cache-size=50M and
confirm that files are created in /tmp/mesa_shader_cache.
Change-Id: I2525597749d654a65373a723cefeab6cf2be62d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2415509
Tested-by: John Bates <jbates@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Riley <davidriley@chromium.org>
The existing mem_below_4g/mem_above_4g calculations did not match the
actual layout used when populating guest memory. Rather than
duplicating the logic in setup_io_bus to calculate the values reported
in CMOS, just reuse the arch_memory_regions function and count the bytes
in the regions below and above the 4G boundary.
BUG=b:168740534
BUG=b:168628037
TEST=Verify u-boot reports 4 GiB with crosvm --mem=4096
Change-Id: I32a70f19848595eaefd2e31c9f31a260d6ce4453
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2422129
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
When the RAM size is specified to be exactly 3328 MiB (4096 - 768),
there is no memory after the gap; however, the arch_memory_regions code
was adding a zero-sized region to the list of guest memory areas to be
mapped.
This would result in a mmap syscall failure at startup:
[ERROR:src/main.rs:1590] The architecture failed to build the vm:
failed to set up guest memory: failed to map guest memory: mmap system
call failed: Invalid argument (os error 22)
Fix the off-by-one error when checking whether the address of the end of
guest memory is within 4 GB so that the > 4GB branch is not taken with
mem=3328.
BUG=chromium:1129547
TEST=crosvm run --mem=3328 vm_kernel
TEST=cargo test -p x86_64
Change-Id: I66cd66c98d690b42b2e1d97312528bb0d4830e76
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2417004
Reviewed-by: Ram Muthiah <rammuthiah@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The --serial option does not support args that have the '=' character
(or the ',' character for that matter, but we dont mind so much there).
This became a problem after crreev.com/c/2386885 made all encoded VM
names include padding, as the padding charcter '=' caused serial paths
like "foo=.log" to be interpreted as "foo".
This was not noticed because:
- Logging is not covered in automated testing.
- My vm name was "brl" in manual testing, which does not require
padding when b64 encoded.
BUG=b:168859379
TEST=vmc start termina; grep maitred /run/daemon.../log/dGVybWluYQ==.log
Change-Id: I07ffd1c76abab1866a8fb54763605c0ef8733776
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2417797
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: Nic Hollingum <hollingum@google.com>
Reviewed-by: Nicholas Verne <nverne@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Fergus Dall <sidereal@google.com>
Originally crosvm calls VDA::reset() when either QueueClear the input
or output queue. However, VDA::reset() only drops input buffers,
not guarantee if drop output buffers.
This CL removes the VDA::reset() call when QueueClear output queue.
Instead, we only clear the records of all the queued output buffers.
Note that it's still a workaround. The correct solution is to expose
VDA::DismissPictureBuffer() to libvda, and then clear the record of
the dismissed output buffer.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_eosFlushSeek
with related CLs
Change-Id: Ic88b8b9bb14e4b29f7859bf06bd2231cecc85776
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2408597
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
When ProvidePictureBuffers() is called, it means the VDA already drops
the previous set of output buffers. This CL clears the variables that
are related to the output resource in ProvidePictureBuffers().
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_eosFlushSeek
with related CLs
Change-Id: I0e562fd216c6f2b91e4cbbe3ad174bca99003a0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2404511
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
When VDA requests crosvm to allocate N output buffers, crosvm will
request the userspace to allocate N+1 output buffers. Then crosvm
keeps one output buffer for notifying EOS.
Originally, after the preserved buffer is dequeued to notify EOS,
crosvm might keep another output buffer for next EOS. If so, then
crosvm will register all the N+1 buffers to VDA.
This CL changes to fix the preserved buffer until VDA requests another
set of output buffers. Also, it introduces another variable to track
the resource ids of queued buffers.
BUG=b:168557465
TEST=pass android.media.cts.AdaptivePlaybackTest#testVP8_eosFlushSeek
with related CLs
Change-Id: I8a6018f9e889dc6a2b6ef67d4915d6202858a42a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2404512
Tested-by: Chih-Yu Huang <akahuang@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
The Wayland context was being destroyed before the surfaces
were destroyed. This is because the drop order for fields
inside a struct is the order in which they are declared
[Rust RFC 1857].
BUG=b:168735942
TEST=boot Cuttlefish and then `adb reboot`
Change-Id: I3581375a0694871ad50945f5c3ce432bb1f65653
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2415511
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
1. Captures with the AC97 dedicated MIC will have the AEC effect enabled.
2. Removes the "capture_effect" option in --ac97.
BUG=b:167946783
TEST=Record in the VM by `arecord -D hw:0,1 -f S16_LE -r 48000 -c 2\
/tmp/a.out` and verify the opened stream has effect = 0x01 by
`cras_test_client --dump_a`.
TEST=`cat /proc/asound/I82801AAICH/codec97#0/ac97#0-0 | grep \
Capabilities` in the VM and verify "dedicated MIC PCM IN
channel" is supported.
TEST=`amixer controls` and verify that 'Mic Capture Switch'
and 'Mic Capture Volume' mixer controls show up.
TEST=Unit test.
Cq-Depend: chromium:2395855
Change-Id: I67bff9528175528e284f409fac1f51ecaaa89427
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2394983
Tested-by: Judy Hsiao <judyhsiao@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Auto-Submit: Judy Hsiao <judyhsiao@chromium.org>
It doesn't make sense to have 2 versions of this crate as we end up
missing bug fixes like chromium:2324089. Use the version from platform2
as that's updated more regularly.
BUG=b:167166153
TEST=Start a vm with a virtio-9p device and verify that it still works
Cq-Depend: chromium:2404987
Change-Id: I54abd88f64d599b68974c09a393c18ec830ecd76
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2404516
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
Use the filter iterator method instead of a specific in-block check to
filter out tags we want to keep.
BUG=None
TEST=Video plays in Youtube.
Change-Id: I8c34fadb548c26762e077a3ba6dde822b2fb864a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2409491
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This makes the code a bit clearer.
BUG=None
TEST=Video plays in Youtube.
Change-Id: Ia904e693b692d70949afd529218dfc0aed7ec1b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2409490
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>