From 32de150930e62d3428e6a829b39e5ab17ef11a15 Mon Sep 17 00:00:00 2001 From: "giwoong.kim" Date: Thu, 30 Aug 2012 21:43:14 +0900 Subject: [PATCH] [Title] should enable gl before check the capability [Type] bugfix [Module] Emulator / gl [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- vl.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/vl.c b/vl.c index dee71d2a71..e07e583f73 100644 --- 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) -- 2.34.1