communication: added DRAW_BLANK_GUIDE protocol
authorGiWoong Kim <giwoong.kim@samsung.com>
Fri, 23 Aug 2013 08:47:39 +0000 (17:47 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 26 Aug 2013 01:14:26 +0000 (10:14 +0900)
Change-Id: I93d4a0d3afc42fe2879c016aea8d8c044f040d61
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/maru_sdl.c
tizen/src/maru_shm.c
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java
tizen/src/skin/maruskin_server.c
tizen/src/skin/maruskin_server.h

index 3db320966bb77136da02aae57b222f6cab1e5a2e..1f366de7b117ca32e81c0f874830d5e0b91ed901 100644 (file)
@@ -571,7 +571,7 @@ static void qemu_ds_sdl_refresh(DisplayChangeListener *dcl)
     graphic_hw_update(NULL);
 
     /* Usually, continuously updated.
-       When the LCD is turned off,
+       When the display is turned off,
        ten more updates the screen for a black screen. */
     if (brightness_off) {
         if (++sdl_skip_count > 10) {
index 64293c8f97a20d8b01fac03759fe75cbcac794ee..176f494b59cede714fcbecb86bc287912d7d12a1 100644 (file)
@@ -48,6 +48,9 @@ static int skin_shmid;
 
 static int shm_skip_update;
 static int shm_skip_count;
+static int blank_cnt;
+#define MAX_BLANK_FRAME_CNT 100
+
 extern pthread_mutex_t mutex_draw_display;
 extern int draw_display_state;
 
@@ -92,12 +95,14 @@ static void qemu_ds_shm_update(DisplayChangeListener *dcl,
 
         if (draw_display_state == 0) {
             draw_display_state = 1;
+
             pthread_mutex_unlock(&mutex_draw_display);
             maru_do_pixman_dpy_surface(dpy_surface->image);
             memcpy(shared_memory,
                    surface_data(dpy_surface),
                    surface_stride(dpy_surface) *
                    surface_height(dpy_surface));
+
 #ifdef INFO_FRAME_DROP_RATE
             draw_frame++;
 #endif
@@ -108,6 +113,7 @@ static void qemu_ds_shm_update(DisplayChangeListener *dcl,
 #endif
             pthread_mutex_unlock(&mutex_draw_display);
         }
+
 #ifdef INFO_FRAME_DROP_RATE
         INFO("! frame drop rate = (%d/%d)\n",
              drop_frame, draw_frame + drop_frame);
@@ -133,7 +139,26 @@ static void qemu_ds_shm_refresh(DisplayChangeListener *dcl)
     /* If the display is turned off,
     the screen does not update until the it is turned on */
     if (shm_skip_update && brightness_off) {
+        if (blank_cnt > MAX_BLANK_FRAME_CNT) {
+            /* do nothing */
+            return;
+        } else if (blank_cnt == MAX_BLANK_FRAME_CNT) {
+            /* draw guide image */
+            INFO("draw a blank guide image\n");
+
+            notify_draw_blank_guide();
+        } else if (blank_cnt == 0) {
+            INFO("skipping of the display updating is started\n");
+        }
+
+        blank_cnt++;
+
         return;
+    } else {
+        if (blank_cnt != 0) {
+            INFO("skipping of the display updating is ended\n");
+            blank_cnt = 0;
+        }
     }
 
     graphic_hw_update(NULL);
index dc0299e4c05fdce1b9f30e790c4f933a0f4ddf3e..adc8775eb31b1cc32728b14c5d43dc6e7556375e 100644 (file)
@@ -272,10 +272,12 @@ public interface ICommunicator extends Runnable {
                SENSOR_DAEMON_START((short) 800),
                SDB_DAEMON_START((short) 801),
                DRAW_FRAME((short) 900),
+               DRAW_BLANK_GUIDE((short) 901),
                SHUTDOWN((short) 999);
 
                private short value;
-               ReceiveCommand( short value ) {
+
+               ReceiveCommand(short value) {
                        this.value = value;
                }
 
index ee162332ff9140af674b5f4a19df9de912e4a2f8..e01b4eb0810029e3fc8dfc84e5818e2b7928c4cb 100644 (file)
@@ -416,6 +416,12 @@ public class SocketCommunicator implements ICommunicator {
 
                                        break;
                                }
+                               case DRAW_BLANK_GUIDE: {
+                                       logger.info("received DRAW_BLANK_GUIDE from QEMU.");
+
+                                       //TODO:
+                                       break;
+                               }
                                case SHUTDOWN: {
                                        logger.info("received RESPONSE_SHUTDOWN from QEMU.");
 
index aa1958525d2fccad79ba28dac2eba2952c1fb395..17c2d24a82f5a3cb4a6fb0bc617a541ffabd2c4e 100644 (file)
@@ -132,6 +132,7 @@ enum {
     SEND_SENSOR_DAEMON_START = 800,
     SEND_SDB_DAEMON_START = 801,
     SEND_DRAW_FRAME = 900,
+    SEND_DRAW_BLANK_GUIDE = 901,
     SEND_SHUTDOWN = 999,
 };
 
@@ -304,6 +305,21 @@ void notify_draw_frame(void)
     }
 }
 
+void notify_draw_blank_guide(void)
+{
+    INFO("notify_draw_blank_guide\n");
+
+    if (client_sock) {
+        if (0 > send_skin_header_only(
+            client_sock, SEND_DRAW_BLANK_GUIDE, 1)) {
+
+            ERR("fail to send SEND_DRAW_BLANK_GUIDE to skin.\n");
+        }
+    } else {
+        INFO("skin client socket is not connected yet\n");
+    }
+}
+
 void notify_sdb_daemon_start(void)
 {
     INFO("notify_sdb_daemon_start\n");
index d9a202978fcaacd822eb187d63cc267db151dfc8..428ff74351ed8822b5d6f997fa09a77f08661733 100644 (file)
@@ -36,6 +36,7 @@ int start_skin_server(int argc, char** argv, int qemu_argc, char** qemu_argv);
 void shutdown_skin_server(void);
 
 void notify_draw_frame(void);
+void notify_draw_blank_guide(void);
 void notify_sensor_daemon_start(void);
 void notify_sdb_daemon_start(void);
 void notify_ramdump_completed(void);