[Title] renamed maruskin_sdl
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 9 Mar 2012 02:32:13 +0000 (11:32 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 9 Mar 2012 02:32:13 +0000 (11:32 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/Makefile.tizen
tizen/src/hw/maru_brightness.c
tizen/src/hw/maru_pm.c
tizen/src/hw/maru_touchscreen.c
tizen/src/maru_sdl.c [new file with mode: 0644]
tizen/src/maru_sdl.h [new file with mode: 0644]
tizen/src/skin/maruskin_operation.c [changed mode: 0755->0644]
tizen/src/skin/maruskin_sdl.c [deleted file]
tizen/src/skin/maruskin_sdl.h [deleted file]
tizen/src/skin/maruskin_server.c
vl.c

index 8166b5ffa14f36e752c0eeb581a9dbdfc504dd0b..a93e9e7c39b197e655124b190f55b07a2b6dfdf6 100644 (file)
@@ -11,7 +11,7 @@ QEMU_CFLAGS += -L$(SRC_PATH)/tizen/distrib/ffmpeg/lib
 LIBS += -lavformat -lavcodec -lavutil -lm -lGL
 
 # maru loader
-obj-y += emulator.o emulsignal.o
+obj-y += emulator.o emulsignal.o maru_sdl.o
 
 # sdb
 obj-y += sdb.o
@@ -29,7 +29,7 @@ obj-i386-y += maru_brightness.o
 obj-i386-y += maru_touchscreen.o
 
 # maru skin
-obj-i386-y += maruskin_sdl.o maruskin_client.o maruskin_server.o maruskin_operation.o
+obj-i386-y += maruskin_client.o maruskin_server.o maruskin_operation.o
 
 
 ##########################################################
index 9d9ffef953f6fc8529989182173344c15b3b3860..1cb95c16fa96e1d73127a082bc9428e925100e3d 100644 (file)
@@ -41,7 +41,7 @@
 #include "pci.h"
 #include "maru_pci_ids.h"
 #include "maru_brightness.h"
-#include "../debug_ch.h"
+#include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, maru_brightness);
 
index fe1275d2020c30a0a72f95b9d9eb891e4f31f84e..b46461f009ca6a7ef0bee5ce0b3d65d1462a6a49 100644 (file)
@@ -38,7 +38,7 @@
 #include "sysemu.h"
 #include "range.h"
 #include "ioport.h"
-#include "../debug_ch.h"
+#include "debug_ch.h"
 
 //#define DEBUG
 
index 0b60571b18f29d03435936252c7898f6ca3d70b4..26c49a6a29544ed79494a2b71bfa1a311893f391 100644 (file)
@@ -33,7 +33,7 @@
 #include "console.h"
 #include "usb.h"
 #include "usb-desc.h"
-#include "../debug_ch.h"
+#include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, touchscreen);
 
diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c
new file mode 100644 (file)
index 0000000..1f8a8a4
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * MARU SDL display driver
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJun Son <hj79.son@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+#include <pthread.h>
+#include "maru_sdl.h"
+#include "debug_ch.h"
+
+MULTI_DEBUG_CHANNEL(tizen, maru_sdl);
+
+
+// TODO : organize
+SDL_Surface *surface_screen;
+SDL_Surface *surface_qemu;
+DisplayState *qemu_ds;
+
+#define SDL_THREAD
+
+#ifdef SDL_THREAD
+static pthread_mutex_t sdl_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t sdl_cond = PTHREAD_COND_INITIALIZER;
+static int sdl_thread_initialized = 0;
+#endif
+
+static void qemu_update(void)
+{
+    SDL_Surface *surface = NULL;
+
+    if (!qemu_ds) {
+        return;
+    }
+
+#ifndef SDL_THREAD
+    pthread_mutex_lock(&sdl_mutex);
+#endif
+
+    surface = SDL_GetVideoSurface();
+    SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
+    SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
+
+#ifndef SDL_THREAD
+    pthread_mutex_unlock(&sdl_mutex);
+#endif
+}
+
+
+#ifdef SDL_THREAD
+static void* run_qemu_update(void* arg)
+{
+    while(1) { 
+        pthread_mutex_lock(&sdl_mutex);     
+
+        pthread_cond_wait(&sdl_cond, &sdl_mutex); 
+
+        qemu_update();
+
+        pthread_mutex_unlock(&sdl_mutex);    
+    } 
+
+    return NULL;
+}
+#endif
+
+static void qemu_ds_update(DisplayState *ds, int x, int y, int w, int h)
+{
+    /* call sdl update */
+#ifdef SDL_THREAD
+    pthread_mutex_lock(&sdl_mutex);
+
+    pthread_cond_signal(&sdl_cond);
+
+    pthread_mutex_unlock(&sdl_mutex);
+#else
+    qemu_update();
+#endif
+}
+
+static void qemu_ds_resize(DisplayState *ds)
+{
+    TRACE("%d, %d\n", ds_get_width(qemu_ds), ds_get_height(qemu_ds));
+
+    /*if (ds_get_width(qemu_ds) == 720 && ds_get_height(qemu_ds) == 400) {
+        TRACE( "blanking BIOS\n");
+        surface_qemu = NULL;
+        return;
+    }*/
+
+#ifdef SDL_THREAD
+    pthread_mutex_lock(&sdl_mutex);
+#endif
+
+    /* create surface_qemu */
+    surface_qemu = SDL_CreateRGBSurfaceFrom(ds_get_data(qemu_ds),
+            ds_get_width(qemu_ds),
+            ds_get_height(qemu_ds),
+            ds_get_bits_per_pixel(qemu_ds),
+            ds_get_linesize(qemu_ds),
+            qemu_ds->surface->pf.rmask,
+            qemu_ds->surface->pf.gmask,
+            qemu_ds->surface->pf.bmask,
+            qemu_ds->surface->pf.amask);
+
+#ifdef SDL_THREAD
+    pthread_mutex_unlock(&sdl_mutex);
+#endif
+
+    if (!surface_qemu) {
+        ERR( "Unable to set the RGBSurface: %s", SDL_GetError() );
+        return;
+    }
+
+}
+
+static void qemu_ds_refresh(DisplayState *ds)
+{
+    vga_hw_update();
+}
+
+
+void maruskin_display_init(DisplayState *ds)
+{
+    INFO( "qemu_display_init\n");
+    /*  graphics context information */
+    DisplayChangeListener *dcl;
+
+    qemu_ds = ds;
+
+    dcl = g_malloc0(sizeof(DisplayChangeListener));
+    dcl->dpy_update = qemu_ds_update;
+    dcl->dpy_resize = qemu_ds_resize;
+    dcl->dpy_refresh = qemu_ds_refresh;
+
+    register_displaychangelistener(qemu_ds, dcl);
+
+#ifdef SDL_THREAD
+    if (sdl_thread_initialized == 0 ) {
+        sdl_thread_initialized = 1;
+        pthread_t thread_id;
+        INFO( "sdl update thread create\n");
+        if (pthread_create(&thread_id, NULL, run_qemu_update, NULL) != 0) {
+            ERR( "pthread_create fail\n");
+            return;
+        }
+    }
+#endif
+}
+
+
+void maruskin_sdl_init(int swt_handle)
+{
+    gchar SDL_windowhack[32];
+    SDL_SysWMinfo info;
+    long window_id = swt_handle;
+
+    sprintf(SDL_windowhack, "%ld", window_id);
+    g_setenv("SDL_WINDOWID", SDL_windowhack, 1);
+    INFO("register SDL environment variable. (SDL_WINDOWID = %s)\n", SDL_windowhack);
+
+    if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+        ERR( "unable to init SDL: %s", SDL_GetError() );
+        exit(1);
+    }
+
+    surface_screen = SDL_SetVideoMode(480, 800, 0,
+            SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME);
+
+#ifndef _WIN32
+    SDL_VERSION(&info.version);
+    SDL_GetWMInfo(&info);
+    //  opengl_exec_set_parent_window(info.info.x11.display, info.info.x11.window);
+#endif
+}
diff --git a/tizen/src/maru_sdl.h b/tizen/src/maru_sdl.h
new file mode 100644 (file)
index 0000000..33a3dd7
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * MARU SDL display driver
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJun Son <hj79.son@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+#ifndef MARU_SDL_H_
+#define MARU_SDL_H_
+
+#include "console.h"
+#ifndef _WIN32
+#include <SDL/SDL.h>
+#include <SDL/SDL_image.h>
+#include <SDL/SDL_syswm.h>
+#else
+#include <windows.h>
+#include <winbase.h>
+#include <SDL.h>
+#include <SDL_image.h>
+#include <SDL_syswm.h>
+#include <SDL_getenv.h>
+#endif
+
+void maruskin_display_init(DisplayState *ds);
+void maruskin_sdl_init(int swt_handle);
+
+#endif /* MARU_SDL_H_ */
old mode 100755 (executable)
new mode 100644 (file)
index 34cee1d..5b09e17
 #include <unistd.h>
 #include <stdio.h>
 #include "maruskin_operation.h"
-#include "maruskin_sdl.h"
-#include "../debug_ch.h"
+#include "maru_sdl.h"
+#include "debug_ch.h"
 #include "console.h"
 //FIXME uncomment
 //#include "maru_pm.h"
 
-MULTI_DEBUG_CHANNEL(qemu, maruskin_operation);
+MULTI_DEBUG_CHANNEL(qemu, skin_operation);
 
 
 enum {
diff --git a/tizen/src/skin/maruskin_sdl.c b/tizen/src/skin/maruskin_sdl.c
deleted file mode 100644 (file)
index bd7f850..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * sdl display
- *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * HyunJun Son <hj79.son@samsung.com>
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-#include <pthread.h>
-#include "maruskin_sdl.h"
-#include "../debug_ch.h"
-
-MULTI_DEBUG_CHANNEL(tizen, maruskin_sdl);
-
-
-// TODO : organize
-SDL_Surface *surface_screen;
-SDL_Surface *surface_qemu;
-DisplayState *qemu_ds;
-
-#define SDL_THREAD
-
-#ifdef SDL_THREAD
-static pthread_mutex_t sdl_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t sdl_cond = PTHREAD_COND_INITIALIZER;
-static int sdl_thread_initialized = 0;
-#endif
-
-static void qemu_update(void)
-{
-    SDL_Surface *surface = NULL;
-
-    if (!qemu_ds) {
-        return;
-    }
-
-#ifndef SDL_THREAD
-    pthread_mutex_lock(&sdl_mutex);
-#endif
-
-    surface = SDL_GetVideoSurface();
-    SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL);
-    SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
-
-#ifndef SDL_THREAD
-    pthread_mutex_unlock(&sdl_mutex);
-#endif
-}
-
-
-#ifdef SDL_THREAD
-static void* run_qemu_update(void* arg)
-{
-    while(1) { 
-        pthread_mutex_lock(&sdl_mutex);     
-
-        pthread_cond_wait(&sdl_cond, &sdl_mutex); 
-
-        qemu_update();
-
-        pthread_mutex_unlock(&sdl_mutex);    
-    } 
-
-    return NULL;
-}
-#endif
-
-static void qemu_ds_update(DisplayState *ds, int x, int y, int w, int h)
-{
-    /* call sdl update */
-#ifdef SDL_THREAD
-    pthread_mutex_lock(&sdl_mutex);
-
-    pthread_cond_signal(&sdl_cond);
-
-    pthread_mutex_unlock(&sdl_mutex);
-#else
-    qemu_update();
-#endif
-}
-
-static void qemu_ds_resize(DisplayState *ds)
-{
-    TRACE("%d, %d\n", ds_get_width(qemu_ds), ds_get_height(qemu_ds));
-
-    /*if (ds_get_width(qemu_ds) == 720 && ds_get_height(qemu_ds) == 400) {
-        TRACE( "blanking BIOS\n");
-        surface_qemu = NULL;
-        return;
-    }*/
-
-#ifdef SDL_THREAD
-    pthread_mutex_lock(&sdl_mutex);
-#endif
-
-    /* create surface_qemu */
-    surface_qemu = SDL_CreateRGBSurfaceFrom(ds_get_data(qemu_ds),
-            ds_get_width(qemu_ds),
-            ds_get_height(qemu_ds),
-            ds_get_bits_per_pixel(qemu_ds),
-            ds_get_linesize(qemu_ds),
-            qemu_ds->surface->pf.rmask,
-            qemu_ds->surface->pf.gmask,
-            qemu_ds->surface->pf.bmask,
-            qemu_ds->surface->pf.amask);
-
-#ifdef SDL_THREAD
-    pthread_mutex_unlock(&sdl_mutex);
-#endif
-
-    if (!surface_qemu) {
-        ERR( "Unable to set the RGBSurface: %s", SDL_GetError() );
-        return;
-    }
-
-}
-
-static void qemu_ds_refresh(DisplayState *ds)
-{
-    vga_hw_update();
-}
-
-
-void maruskin_display_init(DisplayState *ds)
-{
-    INFO( "qemu_display_init\n");
-    /*  graphics context information */
-    DisplayChangeListener *dcl;
-
-    qemu_ds = ds;
-
-    dcl = g_malloc0(sizeof(DisplayChangeListener));
-    dcl->dpy_update = qemu_ds_update;
-    dcl->dpy_resize = qemu_ds_resize;
-    dcl->dpy_refresh = qemu_ds_refresh;
-
-    register_displaychangelistener(qemu_ds, dcl);
-
-#ifdef SDL_THREAD
-    if (sdl_thread_initialized == 0 ) {
-        sdl_thread_initialized = 1;
-        pthread_t thread_id;
-        INFO( "sdl update thread create\n");
-        if (pthread_create(&thread_id, NULL, run_qemu_update, NULL) != 0) {
-            ERR( "pthread_create fail\n");
-            return;
-        }
-    }
-#endif
-}
-
-
-void maruskin_sdl_init(int swt_handle)
-{
-    gchar SDL_windowhack[32];
-    SDL_SysWMinfo info;
-    long window_id = swt_handle;
-
-    sprintf(SDL_windowhack, "%ld", window_id);
-    g_setenv("SDL_WINDOWID", SDL_windowhack, 1);
-    INFO("register SDL environment variable. (SDL_WINDOWID = %s)\n", SDL_windowhack);
-
-    if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
-        ERR( "unable to init SDL: %s", SDL_GetError() );
-        exit(1);
-    }
-
-    surface_screen = SDL_SetVideoMode(480, 800, 0,
-            SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME);
-
-#ifndef _WIN32
-    SDL_VERSION(&info.version);
-    SDL_GetWMInfo(&info);
-    //  opengl_exec_set_parent_window(info.info.x11.display, info.info.x11.window);
-#endif
-}
diff --git a/tizen/src/skin/maruskin_sdl.h b/tizen/src/skin/maruskin_sdl.h
deleted file mode 100644 (file)
index 33ff1f8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * sdl display
- *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * HyunJun Son <hj79.son@samsung.com>
- * GiWoong Kim <giwoong.kim@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-#ifndef MARUSKIN_SDL_H_
-#define MARUSKIN_SDL_H_
-
-#include "console.h"
-#ifndef _WIN32
-#include <SDL/SDL.h>
-#include <SDL/SDL_image.h>
-#include <SDL/SDL_syswm.h>
-#else
-#include <windows.h>
-#include <winbase.h>
-#include <SDL.h>
-#include <SDL_image.h>
-#include <SDL_syswm.h>
-#include <SDL_getenv.h>
-#endif
-
-void maruskin_display_init(DisplayState *ds);
-void maruskin_sdl_init(int swt_handle);
-
-#endif /* MARUSKIN_SDL_H_ */
index 0e2f81abc1d3740d390f019d8b9041e42c1bd860..1e533782322297c587a797f6226c78271b893dbb 100644 (file)
@@ -39,7 +39,7 @@
 #include <pthread.h>
 #include "maruskin_server.h"
 #include "maruskin_operation.h"
-#include "../debug_ch.h"
+#include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, maruskin_server);
 
diff --git a/vl.c b/vl.c
index 7eb25afa1dfbc6ddf495e3c484e88bc8e663ac35..044a08c0383b40990c5eb6716f33f3a1820ac3aa 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -177,7 +177,7 @@ int qemu_main(int argc, char **argv, char **envp);
 
 #ifdef CONFIG_MARU
 #include "tizen/src/sdb.h"
-#include "tizen/src/skin/maruskin_sdl.h"
+#include "tizen/src/maru_sdl.h"
 #endif
 
 //#define DEBUG_NET