display : Modified to avoid to appear a white region when screen is rotated or scaled...
authorjinhyung.jo <jinhyung.jo@samsung.com>
Tue, 7 May 2013 08:48:00 +0000 (17:48 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Tue, 7 May 2013 08:48:00 +0000 (17:48 +0900)
draw ten more blank screen when the skin is rotated or scaled up/down while powered off.

Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
tizen/src/hw/maru_vga.c
tizen/src/maru_sdl.c
tizen/src/maru_shm.c

index ca0d5b78e50f7858aa4ed106afef82e5bcd277ee..c1991a46a90789dc903e96ef62c4411d118e95b7 100644 (file)
@@ -1418,34 +1418,16 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
                 }
 
             }
-
-            if ( brightness_off ) {
-
-                dst_sub = s->ds->surface->data + addr;
-                dst = (uint32_t*) ( s->ds->surface->data + addr );
-
-                for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) {
-                    *dst = 0xFF000000; // black
-                }
-
-            } else  {
-
-                if ( brightness_level < BRIGHTNESS_MAX ) {
-
-                    alpha = brightness_tbl[brightness_level];
-
-                    dst_sub = s->ds->surface->data + addr;
-                    dst = (uint32_t*) ( s->ds->surface->data + addr );
-
-                    for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) {
-                        *dst = ( ( alpha * dst_sub[0] ) >> 8 )
-                                | ( ( alpha * dst_sub[1] ) & 0xFF00 )
-                                | ( ( ( alpha * dst_sub[2] ) & 0xFF00 ) << 8 );
-                    }
+            if (brightness_level < BRIGHTNESS_MAX) {
+                alpha = brightness_tbl[brightness_level];
+                    dst_sub = ds_get_data(s->ds) + addr;
+                    dst = (uint32_t *)(ds_get_data(s->ds) + addr);
+                    for (i = 0; i < disp_width; i++, dst_sub += 4, dst++) {
+                        *dst = ((alpha * dst_sub[0])>> 8)
+                                | ((alpha * dst_sub[1]) & 0xFF00)
+                                | (((alpha * dst_sub[2]) & 0xFF00) << 8);
                 }
-
             }
-
 #endif /* MARU_VGA */
 
         } else {
@@ -1538,6 +1520,11 @@ static void vga_update_display(void *opaque)
             s->cursor_blink_time = qemu_get_clock_ms(vm_clock);
             full_update = 1;
         }
+        if (brightness_off) {
+            full_update = 1;
+            vga_draw_blank(s, full_update);
+            return;
+        }
         switch(graphic_mode) {
         case GMODE_TEXT:
             vga_draw_text(s, full_update);
index b561c4a10d2bb4aa55dd0dee46594038675f1bee..ce34f003506c0392794430b1bb92ba48cdd6ea3a 100644 (file)
@@ -172,6 +172,7 @@ static int maru_sdl_poll_event(SDL_Event *ev)
 void qemu_ds_sdl_refresh(DisplayState *ds)
 {
     SDL_Event ev1, *ev = &ev1;
+    static uint32_t sdl_skip_count = 0;
 
     // surface may be NULL in init func.
     qemu_display_surface = ds->surface;
@@ -185,8 +186,8 @@ void qemu_ds_sdl_refresh(DisplayState *ds)
                 maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true);
 
                 pthread_mutex_unlock(&sdl_mutex);
-                vga_hw_invalidate();
                 sdl_skip_update = 0;
+                sdl_skip_count = 0;
                 break;
             }
 
@@ -203,11 +204,16 @@ void qemu_ds_sdl_refresh(DisplayState *ds)
 
     /* Usually, continuously updated.
        When the LCD is turned off,
-       once updates the screen for a black screen. */
+       ten more updates the screen for a black screen. */
     vga_hw_update();
     if (brightness_off) {
-        sdl_skip_update = 1;
+        if (++sdl_skip_count > 10) {
+            sdl_skip_update = 1;
+        } else {
+            sdl_skip_update = 0;
+        }
     } else {
+        sdl_skip_count = 0;
         sdl_skip_update = 0;
     }
 
index 7b33c747fd79ee8e63771d2617e6d95d9198b5f2..3204e7532ca2bd487accc81100229737cd86b218 100644 (file)
@@ -46,6 +46,7 @@ static void *shared_memory = (void*) 0;
 static int skin_shmid;
 
 static int shm_skip_update;
+static int shm_skip_count;
 extern pthread_mutex_t mutex_draw_display;
 extern int draw_display_state;
 
@@ -91,6 +92,7 @@ void qemu_ds_shm_resize(DisplayState *ds)
     TRACE("qemu_ds_shm_resize\n");
 
     shm_skip_update = 0;
+    shm_skip_count = 0;
 }
 
 void qemu_ds_shm_refresh(DisplayState *ds)
@@ -105,10 +107,15 @@ void qemu_ds_shm_refresh(DisplayState *ds)
 
     /* Usually, continuously updated.
     But when the display is turned off,
-    just once updates the surface for a black screen. */
+    ten more updates the surface for a black screen. */
     if (brightness_off) {
-        shm_skip_update = 1;
+        if (++shm_skip_count > 10) {
+            shm_skip_update = 1;
+        } else {
+            shm_skip_update = 0;
+        }
     } else {
+        shm_skip_count = 0;
         shm_skip_update = 0;
     }
 }