emulator: added --enable-shm option of configure
authorgiwoong.kim <giwoong.kim@samsung.com>
Mon, 21 Jan 2013 13:12:52 +0000 (22:12 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Mon, 21 Jan 2013 13:12:52 +0000 (22:12 +0900)
added --enable-shm option of qemu configure

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
configure
tizen/emulator_configure.sh
tizen/src/hw/maru_vga.c
tizen/src/maru_display.c
tizen/src/skin/maruskin_operation.c
tizen/src/skin/maruskin_server.c [changed mode: 0755->0644]

index 2d8a7f5..cd7fb06 100755 (executable)
--- a/configure
+++ b/configure
@@ -227,6 +227,7 @@ gl="yes"
 
 # for TIZEN-maru 
 maru="no"
+shm="no"
 #
 
 # parse CC options first
@@ -901,6 +902,8 @@ for opt do
 # for TIZEN-maru
   --enable-maru) maru="yes"
   ;;
+  --enable-shm) shm="yes"
+  ;;
 #
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
@@ -1211,7 +1214,7 @@ echo ""
 # for TIZEN-maru
 echo "TIZEN-maru options:"
 echo "  --enable-maru            enable maru board"
-echo ""
+echo "  --enable-shm             enable shared memory for framebuffer"
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
 fi
@@ -3224,6 +3227,7 @@ echo "coroutine backend $coroutine_backend"
 
 # for TIZEN-maru
 echo "TIZEN-maru support $maru"
+echo "TIZEN-maru shared framebuffer support $shm"
 #
 
 if test "$sdl_too_old" = "yes"; then
@@ -3600,6 +3604,9 @@ esac
 if test "$maru" = "yes" ; then
   echo "CONFIG_MARU=y" >> $config_host_mak
 fi
+if test "$shm" = "yes" ; then
+  echo "CONFIG_USE_SHM=y" >> $config_host_mak
+fi
 if test "$gl" = "yes" ; then
   echo "CONFIG_GL_BACKEND=y" >> $config_host_mak
 fi
index 68442be..7db8433 100755 (executable)
@@ -241,6 +241,7 @@ echo "##### QEMU configure append:" $CONFIGURE_APPEND
  --enable-mixemu \
  --audio-card-list=ac97 \
  --enable-maru \
+ --enable-shm \
  --enable-hax \
  --disable-vnc \
  --disable-cocoa \
index a63da73..ebb996b 100644 (file)
 
 #include "maru_common.h"
 
-#ifdef CONFIG_DARWIN
-//shared memory
-#define USE_SHM
-#endif
-
 #include "hw.h"
 #include "vga.h"
 #include "console.h"
@@ -55,7 +50,7 @@
 #include "debug_ch.h"
 #include <pthread.h>
 
-#ifdef USE_SHM
+#ifdef CONFIG_USE_SHM
 #include "emulator.h"
 #include <sys/types.h>
 #include <sys/ipc.h>
@@ -63,7 +58,7 @@
 #include "maru_err_table.h"
 #endif
 
-#ifdef USE_SHM
+#ifdef CONFIG_USE_SHM
 void *shared_memory = (void*)0;
 #endif
 
@@ -1505,7 +1500,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
     }
     pthread_mutex_unlock(&mutex_screenshot);
 
-#ifdef USE_SHM
+#ifdef CONFIG_USE_SHM
     memcpy(shared_memory, s->ds->surface->data,
         s->ds->surface->linesize * s->ds->surface->height);
 #endif
@@ -1873,7 +1868,7 @@ void maru_vga_common_init(VGACommonState *s)
     }
     vga_dirty_log_start(s);
 
-#ifdef USE_SHM
+#ifdef CONFIG_USE_SHM
     int mykey;
     void *temp;
     int shmid;
index 74b9ec8..f04f7ea 100644 (file)
 
 
 #include "maru_common.h"
-
-#ifdef CONFIG_DARWIN
-//shared memory
-#define USE_SHM
-#endif
-
 #include "maru_display.h"
 #include "debug_ch.h"
 
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
 #include "maru_sdl.h"
 #else
 #include "maru_shm.h"
@@ -57,7 +51,7 @@ void maru_display_init(DisplayState *ds)
     DisplayChangeListener *dcl;
 
     dcl = g_malloc0(sizeof(DisplayChangeListener));
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     /* sdl library */
     dcl->dpy_update = qemu_ds_sdl_update;
     dcl->dpy_resize = qemu_ds_sdl_resize;
@@ -80,7 +74,7 @@ void maru_display_fini(void)
 {
     INFO("fini qemu display\n");
     g_free(maru_screenshot);
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     maruskin_sdl_quit();
 #else
     //TODO:
@@ -89,7 +83,7 @@ void maru_display_fini(void)
 
 void maruskin_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize)
 {
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     maruskin_sdl_init(swt_handle, lcd_size_width, lcd_size_height, is_resize);
 #else
     maruskin_shm_init(swt_handle, lcd_size_width, lcd_size_height, is_resize);
@@ -97,7 +91,7 @@ void maruskin_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, b
 }
 
 DisplaySurface* get_qemu_display_surface(void) {
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     return maruskin_sdl_get_display();
 #else
     //TODO:
index 5e66caa..16cee98 100644 (file)
 
 #include "maru_common.h"
 
-#ifdef CONFIG_DARWIN
-//shared memory
-#define USE_SHM
-#endif
-
 #include <unistd.h>
 #include <stdio.h>
 #include <pthread.h>
@@ -100,7 +95,7 @@ void do_mouse_event(int button_type, int event_type,
     TRACE("mouse_event button:%d, type:%d, host:(%d, %d), x:%d, y:%d, z:%d\n",
         button_type, event_type, origin_x, origin_y, x, y, z);
 
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     /* multi-touch */
     if (get_emul_multi_touch_state()->multitouch_enable == 1) {
         maru_finger_processing_1(event_type, origin_x, origin_y, x, y);
@@ -166,7 +161,7 @@ void do_key_event(int event_type, int keycode, int state_mask, int key_location)
     TRACE("key_event event_type:%d, keycode:%d, state_mask:%d, key_location:%d\n",
         event_type, keycode, state_mask, key_location);
 
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
     //is multi-touch mode ?
     if (get_emul_max_touch_point() > 1) {
         int state_mask_temp = state_mask & ~JAVA_KEYCODE_NO_FOCUS;
old mode 100755 (executable)
new mode 100644 (file)
index d6af1ca..66d1ce2
 
 #include "maru_common.h"
 
-#ifdef CONFIG_DARWIN
-//shared memory
-#define USE_SHM
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -50,7 +45,7 @@
 #include "emulator.h"
 #include "maru_err_table.h"
 
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
 #include "maru_sdl.h"
 #endif
 
@@ -852,7 +847,7 @@ static void* run_skin_server(void* args)
                         do_rotation_event( rotation_type );
                     }
 
-#ifndef USE_SHM
+#ifndef CONFIG_USE_SHM
                     maruskin_sdl_resize(); // send sdl event
 #endif
                     break;