mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 20:19:07 +00:00
devices: rename gfxstream_support_vulkan to use_vulkan
BUG=b:178104043 TEST=cargo build Change-Id: Iefb316c41b8e485af3243e54b66ac7cd46ee7733 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2823011 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chia-I Wu <olv@google.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Commit-Queue: Chia-I Wu <olv@google.com>
This commit is contained in:
parent
2a5e5794dd
commit
0beb246d8e
3 changed files with 10 additions and 10 deletions
|
@ -70,7 +70,7 @@ pub struct GpuParameters {
|
|||
pub renderer_use_surfaceless: bool,
|
||||
pub gfxstream_use_guest_angle: bool,
|
||||
pub gfxstream_use_syncfd: bool,
|
||||
pub gfxstream_support_vulkan: bool,
|
||||
pub use_vulkan: bool,
|
||||
pub udmabuf: bool,
|
||||
pub mode: GpuMode,
|
||||
pub cache_path: Option<String>,
|
||||
|
@ -97,7 +97,7 @@ impl Default for GpuParameters {
|
|||
renderer_use_surfaceless: true,
|
||||
gfxstream_use_guest_angle: false,
|
||||
gfxstream_use_syncfd: true,
|
||||
gfxstream_support_vulkan: true,
|
||||
use_vulkan: true,
|
||||
mode: GpuMode::Mode3D,
|
||||
cache_path: None,
|
||||
cache_size: None,
|
||||
|
@ -917,7 +917,7 @@ impl Gpu {
|
|||
.use_surfaceless(gpu_parameters.renderer_use_surfaceless)
|
||||
.use_guest_angle(gpu_parameters.gfxstream_use_guest_angle)
|
||||
.use_syncfd(gpu_parameters.gfxstream_use_syncfd)
|
||||
.support_vulkan(gpu_parameters.gfxstream_support_vulkan);
|
||||
.use_vulkan(gpu_parameters.use_vulkan);
|
||||
|
||||
let mut rutabaga_channels: Vec<RutabagaChannel> = Vec::new();
|
||||
for (channel_name, path) in &channels {
|
||||
|
|
|
@ -400,7 +400,7 @@ impl GfxstreamFlags {
|
|||
}
|
||||
|
||||
/// Support using Vulkan.
|
||||
pub fn support_vulkan(self, v: bool) -> GfxstreamFlags {
|
||||
pub fn use_vulkan(self, v: bool) -> GfxstreamFlags {
|
||||
self.set_flag(GFXSTREAM_RENDERER_FLAGS_NO_VK_BIT, !v)
|
||||
}
|
||||
|
||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -305,10 +305,10 @@ fn parse_gpu_options(s: Option<&str>) -> argument::Result<GpuParameters> {
|
|||
vulkan_specified = true;
|
||||
match v {
|
||||
"true" | "" => {
|
||||
gpu_params.gfxstream_support_vulkan = true;
|
||||
gpu_params.use_vulkan = true;
|
||||
}
|
||||
"false" => {
|
||||
gpu_params.gfxstream_support_vulkan = false;
|
||||
gpu_params.use_vulkan = false;
|
||||
}
|
||||
_ => {
|
||||
return Err(argument::Error::InvalidValue {
|
||||
|
@ -2802,22 +2802,22 @@ mod tests {
|
|||
assert!(
|
||||
parse_gpu_options(Some("backend=gfxstream,vulkan=true"))
|
||||
.unwrap()
|
||||
.gfxstream_support_vulkan
|
||||
.use_vulkan
|
||||
);
|
||||
assert!(
|
||||
parse_gpu_options(Some("vulkan=true,backend=gfxstream"))
|
||||
.unwrap()
|
||||
.gfxstream_support_vulkan
|
||||
.use_vulkan
|
||||
);
|
||||
assert!(
|
||||
!parse_gpu_options(Some("backend=gfxstream,vulkan=false"))
|
||||
.unwrap()
|
||||
.gfxstream_support_vulkan
|
||||
.use_vulkan
|
||||
);
|
||||
assert!(
|
||||
!parse_gpu_options(Some("vulkan=false,backend=gfxstream"))
|
||||
.unwrap()
|
||||
.gfxstream_support_vulkan
|
||||
.use_vulkan
|
||||
);
|
||||
assert!(parse_gpu_options(Some("backend=gfxstream,vulkan=invalid_value")).is_err());
|
||||
assert!(parse_gpu_options(Some("vulkan=invalid_value,backend=gfxstream")).is_err());
|
||||
|
|
Loading…
Reference in a new issue