return virtio_exit_pci(pci_dev);
}
-#ifndef _WIN32\r
+//#ifndef _WIN32
extern VirtIODevice *virtio_gl_init(DeviceState *dev);
static int virtio_gl_init_pci(PCIDevice *pci_dev)
{
virtio_init_pci(proxy, vdev);
return 0;
}
-#endif\r
+//#endif
static PCIDeviceInfo virtio_info[] = {
{
},
.qdev.reset = virtio_pci_reset,
},{
-#ifndef _WIN32\r
+//#ifndef _WIN32
.qdev.name = "virtio-gl-pci",
.qdev.alias = "virtio-gl",
.qdev.size = sizeof(VirtIOPCIProxy),
},
.qdev.reset = virtio_pci_reset,
},{
-#endif\r
+//#endif
/* end of list */
}
};
Package: emulator
-Version:1.2.107
+Version:1.2.108
OS: linux
Build-host-os: linux
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
Description: Tizen Emulator
Package: emulator
-Version:1.2.107
+Version:1.2.108
OS: windows
Build-host-os: windows
Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
CFLAGS += -g -O2
ifdef CONFIG_WIN32
-LIBS += -lavformat -lavcodec -lavutil -lm
+LIBS += -lavformat -lavcodec -lavutil -lm -lopengl32 -lglu32 -lgdi32
else
LIBS += -lavformat -lavcodec -lavutil -lm -lGL
endif
GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing
endif
-ifndef CONFIG_WIN32
+#ifndef CONFIG_WIN32
###########################################################
## Build openGL
# i386
endif #($(TARGET_ARCH), i386)
###########################################################
-endif #CONFIG_WIN32
+#endif #CONFIG_WIN32
# maru loader
obj-y += emulator.o emul_state.o option.o maru_err_table.o
# guest server
obj-i386-y += guest_server.o
-ifndef CONFIG_WIN32
+#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
###########################################################
-endif
+#endif
int bufferFlags = glo_flags_get_from_glx(bufferAttributes, 0);
int bpp = glo_flags_get_bytes_per_pixel(bufferFlags);
int glFormat, glType;
-
+/*
if (glo_sanity_test () != 0) {
// test failed.
return 1;
}
-
+*/
memset(datain_flip, 0, TX*TY*4);
memset(datain, 0, TX*TY*4);
p = datain;
glo_inited = 1;
- return 0
+ return 0;
}
/* Uninitialise gloffscreen */
opengl_exec), so all we need to do is return a nunzero value...
But we also have to check for 'standard' GL function names
- too as wgl doesn't return those either! */
+ too as wgl doesn't return those either! */
+ /* Caller in opengl_exec.c may query some base GL API, then call them
+ * directly. On windows, wglGetProcAddress usually return NULL in such
+ * case, then we return 1, which casue segfault when accessing (void*)1. We
+ * should call base GL API directly instead of GET_EXT_PTR + ptr_func_*.
+ * TODO: add LoadLibrary + GetProcAddress as call back.
+ */
if (procAddr==0) {
const char *p = STANDARD_GL_FUNCTIONS;
while (*p) {
r_buffer[0] = 0; // In case high bits are set.
ret = do_function_call(process, func_number, args, r_buffer);
-
+ switch(signature->ret_type) {
+ case TYPE_INT:
+ case TYPE_UNSIGNED_INT:
+ memcpy(r_buffer, &ret, sizeof(int));
+ break;
+ case TYPE_CHAR:
+ case TYPE_UNSIGNED_CHAR:
+ *r_buffer = ret & 0xff;
+ break;
+ case TYPE_CONST_CHAR:
+ case TYPE_NONE:
+ break;
+ default:
+ DEBUGF("Unsupported GL API return type %i!\n", signature->ret_type);
+ exit (-1);
+ }
} // endwhile
-
+/*
switch(signature->ret_type) {
case TYPE_INT:
case TYPE_UNSIGNED_INT:
DEBUGF("Unsupported GL API return type %i!\n", signature->ret_type);
exit (-1);
}
-
+*/
return 1;
}
#define GL_PASSINGTHROUGH_ABI 1
case glGenTextures_fake_func:
{
- GET_EXT_PTR(void, glGenTextures, (GLsizei n, GLuint *textures));
+ //GET_EXT_PTR(void, glGenTextures, (GLsizei n, GLuint *textures));
int i;
int n = args[0];
unsigned int *clientTabTextures = g_malloc(n * sizeof(int));
alloc_range(process->current_state->textureAllocator, n,
clientTabTextures);
- ptr_func_glGenTextures(n, serverTabTextures);
+ //ptr_func_glGenTextures(n, serverTabTextures);
+ glGenTextures(n, serverTabTextures);
for (i = 0; i < n; i++) {
process->current_state->tabTextures[clientTabTextures[i]] =
serverTabTextures[i];
case glDeleteTextures_func:
{
- GET_EXT_PTR(void, glDeleteTextures,
- (GLsizei n, const GLuint *textures));
+ //GET_EXT_PTR(void, glDeleteTextures,
+ // (GLsizei n, const GLuint *textures));
int i;
int n = args[0];
unsigned int *clientTabTextures = (unsigned int *) args[1];
serverTabTextures[i] =
get_server_texture(process, clientTabTextures[i]);
}
- ptr_func_glDeleteTextures(n, serverTabTextures);
+ //ptr_func_glDeleteTextures(n, serverTabTextures);
+ glDeleteTextures(n, serverTabTextures);
for (i = 0; i < n; i++) {
process->current_state->tabTextures[clientTabTextures[i]] = 0;
}
case glIsTexture_func:
case glIsTextureEXT_func:
{
- GET_EXT_PTR(GLboolean, glIsTexture, (GLuint texture));
+ //GET_EXT_PTR(GLboolean, glIsTexture, (GLuint texture));
unsigned int client_texture = args[0];
unsigned int server_texture =
get_server_texture(process, client_texture);
if (server_texture)
- ret.c = ptr_func_glIsTexture(server_texture);
+ // ret.c = ptr_func_glIsTexture(server_texture);
+ ret.c = glIsTexture(server_texture);
else
ret.c = 0;
break;
uint8_t qemu_extra_params_fw[2];
//virtio-gl
-#ifndef _WIN32
+//#ifndef _WIN32
extern int gl_acceleration_capability_check (void);
int enable_gl = 0;
-#endif
+//#endif
typedef struct FWBootEntry FWBootEntry;
{
DeviceState *dev;
-#ifndef _WIN32
+//#ifndef _WIN32
// virtio-gl pci device
if (!enable_gl) {
// ignore virtio-gl-pci device, even if users set it in option.
return 0;
}
}
-#endif
+//#endif
dev = qdev_device_add(opts);
if (!dev)
qemu_opts_parse(olist, "accel=kvm", 0);
break;
case QEMU_OPTION_enable_gl:
-#ifndef _WIN32
+//#ifndef _WIN32
enable_gl = 1;
-#endif
+//#endif
break;
case QEMU_OPTION_machine:
olist = qemu_find_opts("machine");
}
loc_set_none();
-#ifndef _WIN32
+//#ifndef _WIN32
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");
}
}
}
-#endif
+//#endif
/* Open the logfile at this point, if necessary. We can't open the logfile