display : Skip the display updates until the LCD is turned off.
authorjinhyung.jo <jinhyung.jo@samsung.com>
Mon, 11 Mar 2013 07:20:19 +0000 (16:20 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Mon, 11 Mar 2013 07:20:19 +0000 (16:20 +0900)
Skip the display updates until the LCD is turned off.
And returns a dummy screenshot(back screen) when the LCD is turned off.

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

index e15ebac1f09bac06e8de6dce077281931f439255..62ad27bf80edf525b3de662bbc9c02ed6863adf4 100644 (file)
@@ -37,6 +37,7 @@
 #include "maru_sdl_rotozoom.h"
 #include "maru_finger.h"
 #include "hw/maru_pm.h"
+#include "hw/maru_brightness.h"
 #include "debug_ch.h"
 #if defined(CONFIG_LINUX)
 #include <sys/shm.h>
@@ -62,6 +63,8 @@ static int sdl_alteration;
 extern int g_shmid;
 extern char *g_shared_memory;
 
+static int sdl_skip_update;
+
 #if 0
 static int sdl_opengl = 0; //0 : just SDL surface, 1 : using SDL with OpenGL
 GLuint texture;
@@ -166,6 +169,7 @@ void qemu_ds_sdl_refresh(DisplayState *ds)
 
                 pthread_mutex_unlock(&sdl_mutex);
                 vga_hw_invalidate();
+                sdl_skip_update = 0;
                 break;
             }
 
@@ -174,7 +178,21 @@ void qemu_ds_sdl_refresh(DisplayState *ds)
         }
     }
 
+    /* If the LCD is turned off,
+       the screen does not update until the LCD is turned on */
+    if (sdl_skip_update && brightness_off) {
+        return;
+    }
+
+    /* Usually, continuously updated.
+       When the LCD is turned off,
+       once updates the screen for a black screen. */
     vga_hw_update();
+    if (brightness_off) {
+        sdl_skip_update = 1;
+    } else {
+        sdl_skip_update = 0;
+    }
 
 #ifdef TARGET_ARM
 #ifdef SDL_THREAD
index 9fba1d689e19ec5857f6210c8ac651b53897b09a..3395e30e9fcaeb4316eef749d5b553e497b8279e 100644 (file)
@@ -360,6 +360,13 @@ QemuSurfaceInfo* get_screenshot_info(void)
         return NULL;
     }
 
+    /* If the LCD is turned off, return empty buffer.
+       Because the empty buffer is seen as a black. */
+    if (brightness_off) {
+        info->pixel_data_length = length;
+        return info;
+    }
+
     pthread_mutex_lock(&mutex_screenshot);
     MaruScreenshot* maru_screenshot = get_maru_screenshot();
     if ( !maru_screenshot || maru_screenshot->isReady != 1) {