Skip to content

Commit f7044e7

Browse files
committed
Move the new gpu mode opt-in behind a stubbed guard
Bug: b/517195732
1 parent b8d9225 commit f7044e7

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ GetNeededVhostUserGpuHostRendererFeatures(
431431
}
432432

433433
#ifndef __APPLE__
434+
435+
// TODO(b/503397840): remove after default updated.
436+
bool EnableHostRenderingByDefault() { return false; }
437+
434438
std::vector<GpuMode> GetGpuModeCandidates(const GuestConfig& guest_config) {
435439
if (!guest_config.gpu_mode_candidates.empty()) {
436440
VLOG(0) << "GPU mode candidates provided by guest.";
@@ -445,13 +449,22 @@ std::vector<GpuMode> GetGpuModeCandidates(const GuestConfig& guest_config) {
445449
gpu_mode_candidates.push_back(GpuMode::DrmVirgl);
446450
}
447451

448-
gpu_mode_candidates.push_back(GpuMode::Gfxstream);
449-
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngle);
450-
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostSwiftshader);
451-
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostLavapipe);
452-
gpu_mode_candidates.push_back(GpuMode::GuestSwiftshader);
452+
if (EnableHostRenderingByDefault()) {
453+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngle);
454+
gpu_mode_candidates.push_back(GpuMode::Gfxstream);
455+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostSwiftshader);
456+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostLavapipe);
457+
gpu_mode_candidates.push_back(GpuMode::GuestSwiftshader);
458+
} else {
459+
gpu_mode_candidates.push_back(GpuMode::GuestSwiftshader);
460+
gpu_mode_candidates.push_back(GpuMode::Gfxstream);
461+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngle);
462+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostSwiftshader);
463+
gpu_mode_candidates.push_back(GpuMode::GfxstreamGuestAngleHostLavapipe);
464+
}
453465

454466
gpu_mode_candidates.push_back(GpuMode::None);
467+
455468
return gpu_mode_candidates;
456469
}
457470

e2etests/cvd/graphics_detector_tests/main_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ func TestLaunchingWithAutoEnablesGfxstream(t *testing.T) {
4444
if err != nil {
4545
t.Fatalf("failed to get EGL sysprop: %w", err)
4646
}
47-
if gl_driver != "emulation" {
48-
t.Errorf(`"ro.hardware.egl" was "%s"; expected "emulation"`, gl_driver)
47+
if gl_driver != "angle" {
48+
t.Errorf(`"ro.hardware.egl" was "%s"; expected "angle"`, gl_driver)
4949
}
5050

5151
vk_driver, err := c.GetSyspropString("ro.hardware.vulkan")
5252
if err != nil {
5353
t.Fatalf("failed to get Vulkan sysprop: %w", err)
5454
}
55-
if vk_driver != "ranchu" {
56-
t.Errorf(`"ro.hardware.vulkan" was "%s"; expected "ranchu"`, vk_driver)
55+
if vk_driver != "pastel" {
56+
t.Errorf(`"ro.hardware.vulkan" was "%s"; expected "pastel"`, vk_driver)
5757
}
5858
}

0 commit comments

Comments
 (0)