enable yagl/vigs support independently of enabling maru 91/29091/2
authorEwan Le Bideau-Canévet <ewan.lebideau-canevet@open.eurogiciel.org>
Tue, 21 Oct 2014 08:28:54 +0000 (10:28 +0200)
committerVasiliy Ulyanov <v.ulyanov@samsung.com>
Thu, 23 Oct 2014 08:43:51 +0000 (12:43 +0400)
Change-Id: I44ff9220c1627be8fcbae9f7b71177832db3339d
Signed-off-by: Ewan Le Bideau-Canévet <ewan.lebideau-canevet@open.eurogiciel.org>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
tizen/src/emulator.c
vl.c

index f101f649e528bdc490185334c19a3d6847ca3577..0c2d3179646c67aba008b34cee98f1319f82bf65 100644 (file)
@@ -66,7 +66,10 @@ char maru_kernel_cmdline[LEN_MARU_KERNEL_CMDLINE];
 char tizen_target_path[PATH_MAX];
 char tizen_target_img_path[PATH_MAX];
 
-int enable_yagl = 0;
+#ifdef CONFIG_YAGL
+extern bool yagl_enabled(void);
+#endif /* CONFIG_YAGL */
+
 int enable_spice = 0;
 
 int _skin_argc;
@@ -241,6 +244,7 @@ static void prepare_basic_features(gchar * const kernel_cmdline)
 static void prepare_opengl_acceleration(gchar * const kernel_cmdline)
 {
     int capability_check_gl = 0;
+    bool enable_yagl = yagl_enabled();
 
     if (enable_yagl) {
         capability_check_gl = check_gl();
diff --git a/vl.c b/vl.c
index 99b6614780bde2042d2067aabbf69d280f86857e..7095d729a8e52851311b41382c5e25e44d970608 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -143,13 +143,25 @@ int qemu_main(int argc, char **argv, char **envp);
 #define MAX_VIRTIO_CONSOLES 1
 #define MAX_SCLP_CONSOLES 1
 
-#ifdef CONFIG_MARU
-int skin_disabled = 0;
-extern int enable_yagl;
-extern int enable_spice;
+#ifdef CONFIG_YAGL
+static int enable_yagl = 0;
 static const char *yagl_backend = NULL;
+
+bool yagl_enabled(void); /* prototype to make gcc happy */
+bool yagl_enabled(void)
+{
+    return enable_yagl;
+}
+#endif /* CONFIG_YAGL */
+
+#ifdef CONFIG_VIGS
 static int enable_vigs = 0;
 static char *vigs_backend = NULL;
+#endif /* CONFIG_VIGS */
+
+#ifdef CONFIG_MARU
+int skin_disabled = 0;
+extern int enable_spice;
 #if defined(CONFIG_SPICE) && defined(CONFIG_LINUX)
 extern void websocket_init(void);
 extern void nodejs_init(void);
@@ -4564,7 +4576,7 @@ int main(int argc, char **argv, char **envp)
 #endif
 #ifdef CONFIG_YAGL
     // To support legacy YaGL options
-    if (enable_yagl) {
+    if (yagl_enabled()) {
         PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
         PCIDevice *pci_dev = pci_create(pci_bus, -1, "yagl");
         if (enable_vigs) {