Virtio GL support now is separated into host and target parts, therefore making it
possible to configure QEMU for miltiple targets even if one target doesn't
have a virtio GL support.
Drop #ifdef _WIN32 around #ifdef CONFIG_GL in source and makefile files, check
this in configure script instead.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
echo "CONFIG_MARU=y" >> $config_host_mak
fi
#
-
+if test "$gl" = "yes" ; then
+ if test "$mingw32" = "yes" ; then
+ echo "ERROR: Virtio GL not supported for Windows"
+ gl="no"
+ else
+ echo "CONFIG_VIRTIO_GL=y" >> $config_host_mak
+ fi
+fi
# use default implementation for tracing backend-specific routines
trace_default=yes
echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
else
echo "CONFIG_NO_XEN=y" >> $config_target_mak
fi
- if test "$gl" = "yes" ; then
- echo "CONFIG_GL=y" >> $config_target_mak
- fi
;;
*)
echo "CONFIG_NO_XEN=y" >> $config_target_mak
echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak
fi
fi
+if test "$gl" = "yes" ; then
+ case "$target_arch2" in
+ i386|x86_64)
+ echo "CONFIG_GL=y" >> $config_target_mak
+ if test "$mingw32" = "yes" ; then
+ echo "LIBS+=-lopengl32 -lglu32" >> $config_target_mak
+ else
+ echo "LIBS+=-lGL -lGLU -lXcomposite -lXext -ldl" >> $config_target_mak
+ fi
+ ;;
+ *)
+ echo "CONFIG_NO_GL=y" >> $config_target_mak
+ ;;
+ esac
+fi
if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
echo "CONFIG_PSERIES=y" >> $config_target_mak
fi
;;
i386|mips|ppc)
cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
- if test "$gl" = "yes" ; then
- echo "CONFIG_GL=y" >> $config_host_mak
- if test "$mingw32" = "yes" ; then
- echo "LIBS+=-lopengl32 -lglu32" >> $config_host_mak
- else
- echo "LIBS+=-lGL -lGLU -lXcomposite -lXext -ldl" >> $config_host_mak
- fi
- fi
;;
esac
fi
return virtio_exit_pci(pci_dev);
}
-#ifndef _WIN32
-#ifdef CONFIG_GL
-extern VirtIODevice *virtio_gl_init(DeviceState *dev);
+#ifdef CONFIG_VIRTIO_GL
static int virtio_gl_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
return 0;
}
#endif
-#endif
static Property virtio_blk_properties[] = {
DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
};
-#ifndef _WIN32
-#ifdef CONFIG_GL
+#ifdef CONFIG_VIRTIO_GL
static void virtio_gl_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
.class_init = virtio_gl_class_init,
};
#endif
-#endif
static void virtio_pci_register_types(void)
{
type_register_static(&virtio_serial_info);
type_register_static(&virtio_balloon_info);
type_register_static(&virtio_scsi_info);
-#ifndef _WIN32
-#ifdef CONFIG_GL
+#ifdef CONFIG_VIRTIO_GL
type_register_static(&virtio_gl_info);
#endif
-#endif
-
}
type_init(virtio_pci_register_types)
#ifdef CONFIG_LINUX
VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf);
#endif
-
+#ifdef CONFIG_VIRTIO_GL
+VirtIODevice *virtio_gl_init(DeviceState *dev);
+#endif
void virtio_net_exit(VirtIODevice *vdev);
void virtio_blk_exit(VirtIODevice *vdev);
GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
endif
-ifndef CONFIG_WIN32
###########################################################
## Build openGL
# i386
-ifeq ($(TARGET_ARCH), i386)
+ifdef CONFIG_GL
GL_CUR_PATH = $(SRC_PATH)/tizen/src/hw
opengl_exec.o : opengl_exec.c server_stub.c opengl_func.h gl_beginend.h opengl_process.h mesa_mipmap.o
$(CC) $(GL_CFLAGS) $(DEFINES) $(GL_LDFLAGS) -c -o $@ $<
-endif #($(TARGET_ARCH), i386)
+endif #CONFIG_GL
###########################################################
-endif #CONFIG_WIN32
# maru loader
obj-y += emulator.o emul_state.o option.o maru_err_table.o
ifndef CONFIG_WIN32
###########################################################
## opengl library for i386
-obj-i386-y += virtio-gl.o helper_opengl.o opengl_exec.o mesa_mipmap.o gloffscreen_common.o gloffscreen_xcomposite.o gloffscreen_wgl.o gloffscreen_test.o
+obj-$(CONFIG_GL) += virtio-gl.o
+obj-$(CONFIG_GL) += helper_opengl.o opengl_exec.o mesa_mipmap.o gloffscreen_common.o
+obj-$(CONFIG_GL) += gloffscreen_test.o gloffscreen_xcomposite.o gloffscreen_wgl.o
+obj-$(CONFIG_NO_GL) += virtio-gl-stub.o
###########################################################
endif
--- /dev/null
+/*
+ * Virtio GL stub functions
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "virtio.h"
+int gl_acceleration_capability_check(void);
+
+VirtIODevice *virtio_gl_init(DeviceState *dev)
+{
+ return NULL;
+}
+
+int gl_acceleration_capability_check (void)
+{
+ return 1;
+}
#define MAX_VIRTIO_CONSOLES 1
#ifdef CONFIG_MARU
-#define VIRTIOGL_DEV_NAME "virtio-gl-pci"
extern int tizen_base_port;
int skin_disabled = 0;
#endif
uint8_t qemu_extra_params_fw[2];
//virtio-gl
-#ifndef _WIN32
-extern int gl_acceleration_capability_check (void);
+#ifdef CONFIG_VIRTIO_GL
+#define VIRTIOGL_DEV_NAME "virtio-gl-pci"
+int gl_acceleration_capability_check(void);
int enable_gl = 1;
#endif
{
DeviceState *dev;
-#ifndef _WIN32
+#ifdef CONFIG_VIRTIO_GL
// virtio-gl pci device
if (!enable_gl) {
// ignore virtio-gl-pci device, even if users set it in option.
qemu_opts_parse(olist, "accel=kvm", 0);
break;
case QEMU_OPTION_enable_gl:
-#ifndef _WIN32
+#ifdef CONFIG_VIRTIO_GL
enable_gl = 1;
#endif
break;
exit(0);
}
-#ifndef _WIN32
-#ifdef CONFIG_GL
+#ifdef CONFIG_VIRTIO_GL
if (enable_gl && (gl_acceleration_capability_check () != 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 = tmp_cmdline;
tmp_cmdline = g_strdup_printf("%s gles=%d", tmp, enable_gl);
- qemu_opts_set(qemu_find_opts("machine"), 0, "append",
- tmp_cmdline);
+ qemu_opts_set(qemu_find_opts("machine"), 0, "append", tmp_cmdline);
fprintf(stdout, "kernel command : %s\n", tmp_cmdline);
g_free(tmp);
}
}
#endif
-#endif
/* Open the logfile at this point, if necessary. We can't open the logfile
* when encountering either of the logging options (-d or -D) because the