aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2011-09-12 21:27:56 +0200
committerDavid 'Digit' Turner <digit@google.com>2011-09-13 13:02:27 +0200
commit9da935dd0c616cfd9072d11080a622320497dc9e (patch)
treeb28c8dd45ec543090c6be340d1d211cee94c0f99 /android
parent9ff69721d24f81317183ddb2e9e352bb34650752 (diff)
downloadexternal_qemu-9da935dd0c616cfd9072d11080a622320497dc9e.zip
external_qemu-9da935dd0c616cfd9072d11080a622320497dc9e.tar.gz
external_qemu-9da935dd0c616cfd9072d11080a622320497dc9e.tar.bz2
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
Diffstat (limited to 'android')
-rw-r--r--android/cmdline-options.h2
-rw-r--r--android/help.c27
-rw-r--r--android/main.c15
3 files changed, 44 insertions, 0 deletions
diff --git a/android/cmdline-options.h b/android/cmdline-options.h
index b7d7bfa..de97516 100644
--- a/android/cmdline-options.h
+++ b/android/cmdline-options.h
@@ -154,6 +154,8 @@ OPT_PARAM( list_cores, "<host>", "list running core process" )
OPT_PARAM( attach_core, "<console socket>", "attach to a running core process" )
#endif // CONFIG_STANDALONE_UI
+OPT_PARAM( gpu, "<mode>", "set hardware OpenGLES emulation mode" )
+
#undef CFG_FLAG
#undef CFG_PARAM
#undef OPT_FLAG
diff --git a/android/help.c b/android/help.c
index cd5a3a6..63d7ca2 100644
--- a/android/help.c
+++ b/android/help.c
@@ -1428,6 +1428,33 @@ help_shared_net_id(stralloc_t* out)
);
}
+static void
+help_gpu(stralloc_t* out)
+{
+ PRINTF(
+ " Use -gpu <mode> to force the mode of hardware OpenGLES emulation.\n"
+ " Valid values for <mode> are:\n\n"
+
+ " on -> enable GPU emulation\n"
+ " off -> disable GPU emulation\n"
+ " auto -> automatic detection\n"
+ " enabled -> same as 'on'\n"
+ " disabled -> same as 'off'\n\n"
+
+ " Note that enabling GPU emulation if the system image does not support it\n"
+ " will prevent the proper display of the emulated framebuffer.\n\n"
+
+ " You can always disable GPU emulation (i.e. '-gpu off'), and this will\n"
+ " force the virtual device to use the slow software renderer instead.\n"
+ " Note that OpenGLES 2.0 is _not_ supported by it.\n\n"
+
+ " The 'auto' mode is the default. It will only enable GPU emulation if the\n"
+ " virtual device supports it, and the host-side OpenGLES emulation library\n"
+ " could be properly initialized (this can fail when you run the emulator\n"
+ " under certain restricted environments where the program can't access the\n"
+ " graphics sub-system (e.g. head-less servers).\n"
+ );
+}
#define help_no_skin NULL
#define help_netspeed help_shaper
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 @@ int main(int argc, char **argv)
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));