From: GiWoong Kim Date: Fri, 23 Aug 2013 08:47:39 +0000 (+0900) Subject: communication: added DRAW_BLANK_GUIDE protocol X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~801 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e2d0299dcbd38e7e9133526dc732580835077a1;p=sdk%2Femulator%2Fqemu.git communication: added DRAW_BLANK_GUIDE protocol Change-Id: I93d4a0d3afc42fe2879c016aea8d8c044f040d61 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index 3db320966b..1f366de7b1 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -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) { diff --git a/tizen/src/maru_shm.c b/tizen/src/maru_shm.c index 64293c8f97..176f494b59 100644 --- a/tizen/src/maru_shm.c +++ b/tizen/src/maru_shm.c @@ -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); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java index dc0299e4c0..adc8775eb3 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java @@ -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; } diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java index ee162332ff..e01b4eb081 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java @@ -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."); diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index aa1958525d..17c2d24a82 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -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"); diff --git a/tizen/src/skin/maruskin_server.h b/tizen/src/skin/maruskin_server.h index d9a202978f..428ff74351 100644 --- a/tizen/src/skin/maruskin_server.h +++ b/tizen/src/skin/maruskin_server.h @@ -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);