aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-04-26 11:07:32 -0700
committerJesse Hall <jessehall@google.com>2012-05-01 13:20:11 -0700
commit733fffaac9ccebfc424fccf9467b22475f71a2f8 (patch)
tree41aa456fa6f10b8e442bb35b48186664131e4964 /vl-android.c
parent5b658a4b19c685bcde26551e408bd3991a8d6618 (diff)
downloadexternal_qemu-733fffaac9ccebfc424fccf9467b22475f71a2f8.zip
external_qemu-733fffaac9ccebfc424fccf9467b22475f71a2f8.tar.gz
external_qemu-733fffaac9ccebfc424fccf9467b22475f71a2f8.tar.bz2
Provide GL strings from renderer to ddms ping
Change-Id: I59c9e58c568a70855783e57514fec80b711d6a64
Diffstat (limited to 'vl-android.c')
-rw-r--r--vl-android.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/vl-android.c b/vl-android.c
index b43f7fe..eee85e6 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -3867,29 +3867,40 @@ int main(int argc, char **argv, char **envp)
nand_add_dev(tmp);
}
- /* qemu.gles will be read by the OpenGLES emulation libraries.
- * If set to 0, the software GLES renderer will be used as a fallback.
- * If the parameter is undefined, this means the system image runs
- * inside an emulator that doesn't support GPU emulation at all.
- */
+ /* qemu.gles will be read by the OpenGL ES emulation libraries.
+ * If set to 0, the software GL ES renderer will be used as a fallback.
+ * If the parameter is undefined, this means the system image runs
+ * inside an emulator that doesn't support GPU emulation at all.
+ *
+ * We always start the GL ES renderer so we can gather stats on the
+ * underlying GL implementation. If GL ES acceleration is disabled,
+ * we just shut it down again once we have the strings. */
{
- int gles_emul = 0;
-
- if (android_hw->hw_gpu_enabled) {
- /* Set framebuffer change notification callback when starting
- * GLES emulation. Currently only multi-touch emulation is
- * interested in FB changes (to transmit them to the device), so
- * the callback is set within MT emulation.*/
- if (android_initOpenglesEmulation() == 0 &&
- android_startOpenglesRenderer(android_hw->hw_lcd_width,
- android_hw->hw_lcd_height,
- multitouch_opengles_fb_update, NULL) == 0) {
- gles_emul = 1;
+ int qemu_gles = 0;
+
+ /* Set framebuffer change notification callback when starting
+ * GLES emulation. Currently only multi-touch emulation is
+ * interested in FB changes (to transmit them to the device), so
+ * the callback is set within MT emulation. */
+ if (android_initOpenglesEmulation() == 0 &&
+ android_startOpenglesRenderer(android_hw->hw_lcd_width,
+ android_hw->hw_lcd_height,
+ multitouch_opengles_fb_update, NULL) == 0)
+ {
+ android_getOpenglesHardwareStrings(
+ android_gl_vendor, sizeof(android_gl_vendor),
+ android_gl_renderer, sizeof(android_gl_renderer),
+ android_gl_version, sizeof(android_gl_version));
+ if (android_hw->hw_gpu_enabled) {
+ qemu_gles = 1;
} else {
- dwarning("Could not initialize OpenglES emulation, using software renderer.");
+ android_stopOpenglesRenderer();
+ qemu_gles = 0;
}
+ } else {
+ dwarning("Could not initialize OpenglES emulation, using software renderer.");
}
- if (gles_emul) {
+ if (qemu_gles) {
stralloc_add_str(kernel_params, " qemu.gles=1");
} else {
stralloc_add_str(kernel_params, " qemu.gles=0");