Add -gpu <mode> option to force GPU emulation
By default, GPU emulation is still disabled. You can
still try to force it with '-gpu on' for experimentation
purpose (alternatively, you can define hw.gpu.enabled to
'true' in your AVD config.ini)
Change-Id: I87efdf45337a80aeadd94b3922312b3f564c1608
diff --git a/android/main.c b/android/main.c
index 8fb9485..0b1d64c 100644
--- a/android/main.c
+++ b/android/main.c
@@ -1070,6 +1070,21 @@
args[n++] = opts->memcheck;
}
+ if (opts->gpu) {
+ const char* gpu = opts->gpu;
+ if (!strcmp(gpu,"on") || !strcmp(gpu,"enabled")) {
+ hw->hw_gpu_enabled = 1;
+ } else if (!strcmp(gpu,"off") || !strcmp(gpu,"disabled")) {
+ hw->hw_gpu_enabled = 0;
+ } else if (!strcmp(gpu,"auto")) {
+ /* Nothing to do */
+ } else {
+ derror("Invalid value for -gpu <mode> parameter: %s\n", gpu);
+ derror("Valid values are: on, off or auto\n");
+ exit(1);
+ }
+ }
+
/* physical memory is now in hw->hw_ramSize */
hw->avd_name = ASTRDUP(avdInfo_getName(avd));