@@ -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+
434438std::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
0 commit comments