[Title] should enable gl before check the capability
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 30 Aug 2012 12:43:14 +0000 (21:43 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 30 Aug 2012 12:43:14 +0000 (21:43 +0900)
[Type] bugfix
[Module] Emulator / gl
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

vl.c

diff --git a/vl.c b/vl.c
index dee71d2a710cab830aaf6d81574df8a945e0be42..e07e583f739783ddf982e67d8accf6626cdd3378 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3238,27 +3238,30 @@ fprintf(stdout, "kernel command : %s\n", kernel_cmdline);
     loc_set_none();
 
 #if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN))
-    capability_check_gl = gl_acceleration_capability_check();
-    if (enable_gl && (capability_check_gl != 0)) {
-        enable_gl = 0;
-        fprintf (stderr, "Warn: GL acceleration was disabled due to the fail of GL check!\n");
-    }
-
-       // To check host gl driver capability and notify to guest.
-       gchar *tmp = kernel_cmdline;
-       kernel_cmdline = g_strdup_printf("%s gles=%d", tmp, enable_gl);
-       fprintf(stdout, "kernel command : %s\n", kernel_cmdline);
-       g_free(tmp);
-
-       if (enable_gl) {
-               device_opt_finding_t devp = {VIRTIOGL_DEV_NAME, 0};
-               qemu_opts_foreach(qemu_find_opts("device"), find_device_opt, &devp, 0);
-               if (devp.found == 0) {
-                       if (!qemu_opts_parse(qemu_find_opts("device"), VIRTIOGL_DEV_NAME, "driver")) {
-                               exit(1);
-                       }
-               }
-       }
+    if (enable_gl) {
+        capability_check_gl = gl_acceleration_capability_check();
+
+        if (capability_check_gl != 0) {
+            enable_gl = 0;
+            fprintf (stderr, "Warn: GL acceleration was disabled due to the fail of GL check!\n");
+        }
+
+        // To check host gl driver capability and notify to guest.
+           gchar *tmp = kernel_cmdline;
+        kernel_cmdline = g_strdup_printf("%s gles=%d", tmp, enable_gl);
+           fprintf(stdout, "kernel command : %s\n", kernel_cmdline);
+        g_free(tmp);
+
+        if (enable_gl) {
+            device_opt_finding_t devp = {VIRTIOGL_DEV_NAME, 0};
+            qemu_opts_foreach(qemu_find_opts("device"), find_device_opt, &devp, 0);
+            if (devp.found == 0) {
+                if (!qemu_opts_parse(qemu_find_opts("device"), VIRTIOGL_DEV_NAME, "driver")) {
+                    exit(1);
+                }
+            }
+        }
+    }
 #endif
 
 #if defined(CONFIG_MARU)