aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-02-22 03:20:22 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-02-22 03:20:22 +0000
commit1f49b8ec64aa6197a663d43f8fe22e80a018b45f (patch)
treee6ea91b422f3d076dbb678f16c1c16c8e76e0c10
parent6ca6f2ef27ac19f5cea747b24b321bd927b4bb57 (diff)
parent24d4a06dd195458321c206fbacd8333e129d1af7 (diff)
downloadacloud-android11-d1-s1-release.tar.gz
Change-Id: Ia94c6b9fb82a9dbb2980dd8f441f5ddf353cbdb4
-rw-r--r--internal/lib/cvd_compute_client_multi_stage.py4
-rw-r--r--internal/lib/cvd_compute_client_multi_stage_test.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/lib/cvd_compute_client_multi_stage.py b/internal/lib/cvd_compute_client_multi_stage.py
index e833ad9b..2c31b25c 100644
--- a/internal/lib/cvd_compute_client_multi_stage.py
+++ b/internal/lib/cvd_compute_client_multi_stage.py
@@ -55,6 +55,7 @@ from acloud.pull import pull
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 @@ class CvdComputeClient(android_compute_client.AndroidComputeClient):
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 b83bafb5..98ce7e43 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 @@ class CvdComputeClientTest(driver_test_lib.BaseDriverTest):
# 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)