Skip to content

Commit bfe76ba

Browse files
committed
Propagate gpu_mode presence from cvd canonical configs
This uses the "unset" keyword to let the layer below decide what default to apply, which can be influenced by legacy config.json values. This is load-bearing for some tests in CI. Bug: b/408472915
1 parent 8dcb4ab commit bfe76ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/cf_graphics_configs.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,15 @@ bool RecordScreen(const Instance& instance) {
9191
}
9292

9393
std::string GpuMode(const Instance& instance) {
94-
if (instance.graphics().has_gpu_mode()) {
94+
if (instance.graphics().has_gpu_mode() &&
95+
instance.graphics().gpu_mode() != "") {
9596
return instance.graphics().gpu_mode();
97+
} else {
98+
// Use the instance default
99+
// https://github.com/google/android-cuttlefish/blob/c4f1643479f98bdc7310d281e81751188595233b/base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc#L948
100+
// See also b/406464352#comment7
101+
return "unset";
96102
}
97-
return CF_DEFAULTS_GPU_MODE;
98103
}
99104

100105
Result<std::vector<std::string>> GenerateGraphicsFlags(

0 commit comments

Comments
 (0)