mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
devices: disable vulkan by default
Because the default value for mode is GpuMode::ModeVirglRenderer, make the default value for use_vulkan false as well. Set use_vulkan to true when mode is set to GpuMode::ModeGfxstream for backward compatibility. BUG=b:178104043 TEST=cargo build Change-Id: Idf1417f04d23999cf5a03b0bf640973b69de93e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2823012 Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chia-I Wu <olv@google.com> Commit-Queue: Chia-I Wu <olv@google.com>
This commit is contained in:
parent
e25859becb
commit
91df656291
2 changed files with 20 additions and 1 deletions
|
@ -97,7 +97,7 @@ impl Default for GpuParameters {
|
|||
renderer_use_surfaceless: true,
|
||||
gfxstream_use_guest_angle: false,
|
||||
gfxstream_use_syncfd: true,
|
||||
use_vulkan: true,
|
||||
use_vulkan: false,
|
||||
mode: GpuMode::ModeVirglRenderer,
|
||||
cache_path: None,
|
||||
cache_size: None,
|
||||
|
|
19
src/main.rs
19
src/main.rs
|
@ -369,6 +369,10 @@ fn parse_gpu_options(s: Option<&str>) -> argument::Result<GpuParameters> {
|
|||
|
||||
#[cfg(feature = "gfxstream")]
|
||||
{
|
||||
if !vulkan_specified && gpu_params.mode == GpuMode::ModeGfxstream {
|
||||
gpu_params.use_vulkan = true;
|
||||
}
|
||||
|
||||
if vulkan_specified || syncfd_specified || angle_specified {
|
||||
match gpu_params.mode {
|
||||
GpuMode::ModeGfxstream => {}
|
||||
|
@ -2796,6 +2800,21 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "gpu", feature = "gfxstream"))]
|
||||
#[test]
|
||||
fn parse_gpu_options_default_vulkan_support() {
|
||||
assert!(
|
||||
!parse_gpu_options(Some("backend=virglrenderer"))
|
||||
.unwrap()
|
||||
.use_vulkan
|
||||
);
|
||||
assert!(
|
||||
parse_gpu_options(Some("backend=gfxstream"))
|
||||
.unwrap()
|
||||
.use_vulkan
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "gpu", feature = "gfxstream"))]
|
||||
#[test]
|
||||
fn parse_gpu_options_gfxstream_with_vulkan_specified() {
|
||||
|
|
Loading…
Reference in a new issue