aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-05-03 08:29:40 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-03 08:29:41 -0700
commit1efe36f95c788400c8b504b9055173bc8f9a4d15 (patch)
tree052a61fb72b7160ee5849bdbd43ac2f8149210e4 /vl-android.c
parent7f661af7cfca4b7857d30d598923dd2095f78ff0 (diff)
parent733fffaac9ccebfc424fccf9467b22475f71a2f8 (diff)
downloadexternal_qemu-1efe36f95c788400c8b504b9055173bc8f9a4d15.zip
external_qemu-1efe36f95c788400c8b504b9055173bc8f9a4d15.tar.gz
external_qemu-1efe36f95c788400c8b504b9055173bc8f9a4d15.tar.bz2
Merge "Provide GL strings from renderer to ddms ping"
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 74a2dc4..1513541 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");