Display : first fix for display error.
authorjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 10 Jul 2013 12:04:21 +0000 (21:04 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 10 Jul 2013 12:04:21 +0000 (21:04 +0900)
fix the error that died of emulator caused from SEGV

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

index f572d45978a5287d90ced0ab0ebe608ab8531f5e..66551255c460e46765cc593c194631e19fcbfa65 100644 (file)
@@ -130,8 +130,12 @@ static void brightness_reg_write(void *opaque,
         if (brightness_off == val) {
             return;
         }
-
         brightness_off = val;
+        if (brightness_image) {
+            pixman_image_unref(brightness_image);
+        }
+        level_color.alpha = 0xFF << 8;
+        brightness_image = pixman_image_create_solid_fill(&level_color);
 
 #ifdef TARGET_ARM
         graphic_hw_invalidate(NULL);
index ffbc50a99a0a573c28dea119fe54ab36cbda987d..1ebd9195c19248d3c6ffd57a196589fd79bcb532 100644 (file)
@@ -99,7 +99,7 @@ static void maru_do_pixman_sdl(pixman_image_t *dst_image)
                                overlay1_width, overlay1_height);
     }
     /* apply the brightness level */
-    if (brightness_level < BRIGHTNESS_MAX) {
+    if (brightness_off || (brightness_level < BRIGHTNESS_MAX)) {
         pixman_image_composite(PIXMAN_OP_OVER,
                                brightness_image, NULL, dst_image,
                                0, 0, 0, 0, 0, 0,
@@ -324,6 +324,7 @@ static void qemu_ds_sdl_refresh(DisplayChangeListener *dcl)
                         true);
 
                 pthread_mutex_unlock(&sdl_mutex);
+                graphic_hw_invalidate(NULL);
                 sdl_skip_update = 0;
                 sdl_skip_count = 0;
                 break;
@@ -344,14 +345,14 @@ static void qemu_ds_sdl_refresh(DisplayChangeListener *dcl)
        When the LCD is turned off,
        ten more updates the screen for a black screen. */
     if (brightness_off) {
-        dpy_gfx_update(dcl->con, 0, 0, 0, 0);
+        qemu_ds_sdl_update(NULL, 0, 0, 0, 0);
         if (++sdl_skip_count > 10) {
             sdl_skip_update = 1;
         } else {
             sdl_skip_update = 0;
         }
     } else {
-        graphic_hw_update(dcl->con);
+        graphic_hw_update(NULL);
         sdl_skip_count = 0;
         sdl_skip_update = 0;
     }
index c1b938f07dbd0efaa85ef0e2f08d96fa6bc962e8..087b245b25b90940091f834354a960e8a4022c99 100644 (file)
@@ -74,7 +74,7 @@ static void maru_do_pixman_shm(void)
                                overlay1_width, overlay1_height);
     }
     /* apply the brightness level */
-    if (brightness_level < BRIGHTNESS_MAX) {
+    if (brightness_off || (brightness_level < BRIGHTNESS_MAX)) {
         pixman_image_composite(PIXMAN_OP_OVER,
                                brightness_image, NULL, shm_surface->image,
                                0, 0, 0, 0, 0, 0,
@@ -146,14 +146,14 @@ static void qemu_ds_shm_refresh(DisplayChangeListener *dcl)
     But when the display is turned off,
     ten more updates the surface for a black screen. */
     if (brightness_off) {
-        dpy_gfx_update(dcl->con, 0, 0, 0, 0);
+        qemu_ds_shm_update(NULL, 0, 0, 0, 0);
         if (++shm_skip_count > 10) {
             shm_skip_update = 1;
         } else {
             shm_skip_update = 0;
         }
     } else {
-        graphic_hw_update(dcl->con);
+        graphic_hw_update(NULL);
         shm_skip_count = 0;
         shm_skip_update = 0;
     }