Snap for 6280079 from 8862eaca07cc0607180110e8df179d968897d4fa to r-keystone-qcom-release
Change-Id: I854929a36e5b9df3cf5cddbf2bad1793fceb83a8
diff --git a/internal/lib/cvd_compute_client_multi_stage.py b/internal/lib/cvd_compute_client_multi_stage.py
index e833ad9..2c31b25 100644
--- a/internal/lib/cvd_compute_client_multi_stage.py
+++ b/internal/lib/cvd_compute_client_multi_stage.py
@@ -55,6 +55,7 @@
logger = logging.getLogger(__name__)
_DECOMPRESS_KERNEL_ARG = "-decompress_kernel=true"
+_GPU_ARG = "-gpu_mode=drm_virgl"
_DEFAULT_BRANCH = "aosp-master"
_FETCHER_BUILD_TARGET = "aosp_cf_x86_phone-userdebug"
_FETCHER_NAME = "fetch_cvd"
@@ -290,6 +291,9 @@
if decompress_kernel:
launch_cvd_args.append(_DECOMPRESS_KERNEL_ARG)
+ if self._gpu:
+ launch_cvd_args.append(_GPU_ARG)
+
return launch_cvd_args
@staticmethod
diff --git a/internal/lib/cvd_compute_client_multi_stage_test.py b/internal/lib/cvd_compute_client_multi_stage_test.py
index b83bafb..98ce7e4 100644
--- a/internal/lib/cvd_compute_client_multi_stage_test.py
+++ b/internal/lib/cvd_compute_client_multi_stage_test.py
@@ -109,13 +109,14 @@
# test GetLaunchCvdArgs with avd_spec
fake_avd_spec = avd_spec.AVDSpec(self.args)
expeted_args = ['-x_res=1080', '-y_res=1920', '-dpi=240', '-cpus=2',
- '-memory_mb=4096', '--setupwizard_mode=REQUIRED']
+ '-memory_mb=4096', '--setupwizard_mode=REQUIRED',
+ '-gpu_mode=drm_virgl']
launch_cvd_args = self.cvd_compute_client_multi_stage._GetLaunchCvdArgs(fake_avd_spec)
self.assertEqual(launch_cvd_args, expeted_args)
# test GetLaunchCvdArgs without avd_spec
expeted_args = ['-x_res=720', '-y_res=1280', '-dpi=160',
- '--setupwizard_mode=REQUIRED']
+ '--setupwizard_mode=REQUIRED', '-gpu_mode=drm_virgl']
launch_cvd_args = self.cvd_compute_client_multi_stage._GetLaunchCvdArgs(
avd_spec=None)
self.assertEqual(launch_cvd_args, expeted_args)