pm: set powerlock at deviced init time 25/180125/8 submit/tizen/20180531.061428
authorDonghwan Jeong <dh.jeong@samsung.com>
Fri, 25 May 2018 04:40:25 +0000 (13:40 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 29 May 2018 01:19:28 +0000 (01:19 +0000)
While the powerlock is unlocked, system can fall asleep even at the Normal state.
For instance, you can see this problem right after deviced is restarted by suspend-time crash.

Change-Id: Ibb5422409de1cf45d7e70df25c58b0f6bea0e049
Signed-off-by: Donghwan Jeong <dh.jeong@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/display/core.c
src/display/core.h
src/display/device-interface.c
src/display/device-interface.h

index 25b8016..f5be97b 100755 (executable)
@@ -2194,7 +2194,6 @@ static int display_probe(void *data)
 static void display_init(void *data)
 {
        int ret, i;
-       unsigned int flags = (WITHOUT_STARTNOTI | FLAG_X_DPMS);
        int timeout = 0;
        bool wm_ready;
 
@@ -2224,7 +2223,7 @@ static void display_init(void *data)
                case INIT_INTERFACE:
                        if (display_conf.timeout_enable)
                                get_lcd_timeout_from_settings();
-                       ret = init_sysfs(flags);
+                       ret = init_sysfs();
                        break;
                case INIT_POLL:
                        _I("input init");
@@ -2267,33 +2266,33 @@ static void display_init(void *data)
                        trans_table[S_NORMAL][EVENT_TIMEOUT] = S_NORMAL;
                }
 
-               if (flags & WITHOUT_STARTNOTI) {        /* start without noti */
-                       _I("Start Power managing without noti");
-                       pm_cur_state = S_NORMAL;
-                       set_setting_pmstate(pm_cur_state);
-
-                       if (display_conf.timeout_enable) {
-                               timeout = states[S_NORMAL].timeout;
-                               /* check minimun lcd on time */
-                               if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT))
-                                       timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT);
+               _I("Start Power managing without noti");
+               if (power_ops.get_power_lock_support())
+                       power_ops.power_lock();
 
-                               reset_timeout(timeout);
-                       }
+               pm_cur_state = S_NORMAL;
+               set_setting_pmstate(pm_cur_state);
 
-                       status = DEVICE_OPS_STATUS_START;
-                       /*
-                        * Lock lcd off until booting is done.
-                        * deviced guarantees all booting script is executing.
-                        * Last script of booting unlocks this suspend blocking state.
-                        */
-                       pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF,
-                           STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
-                       pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL,
-                           STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+               if (display_conf.timeout_enable) {
+                       timeout = states[S_NORMAL].timeout;
+                       /* check minimun lcd on time */
+                       if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT))
+                               timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT);
 
+                       reset_timeout(timeout);
                }
 
+               status = DEVICE_OPS_STATUS_START;
+               /*
+                * Lock lcd off until booting is done.
+                * deviced guarantees all booting script is executing.
+                * Last script of booting unlocks this suspend blocking state.
+                */
+               pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF,
+                               STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+               pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL,
+                               STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+
                if (display_conf.input_support)
                        if (CHECK_OPS(keyfilter_ops, init))
                                keyfilter_ops->init();
index 57261de..298a170 100644 (file)
@@ -28,7 +28,6 @@
 #include "device-interface.h"
 #include "setting.h"
 
-#define WITHOUT_STARTNOTI      0x1
 #define MASK_BIT    0x7                /* 111 */
 #define MASK_NORMAL 0x1                /* 001 */
 #define MASK_DIM    0x2                /* 010 */
index 1aa0c50..4d77030 100755 (executable)
@@ -665,7 +665,7 @@ int display_service_free(void)
        return 0;
 }
 
-int init_sysfs(unsigned int flags)
+int init_sysfs()
 {
        _init_ops();
        return 0;
index 88e25cf..7f2be5c 100755 (executable)
@@ -27,8 +27,6 @@
 #include <stdbool.h>
 #include "core/devices.h"
 
-#define FLAG_X_DPMS            0x2
-
 #define DEFAULT_DISPLAY 0
 
 #define PM_MAX_BRIGHTNESS       100
@@ -52,7 +50,7 @@ enum {
        EVENT_END,
 };
 
-int init_sysfs(unsigned int);
+int init_sysfs(void);
 int exit_sysfs(void);
 int display_service_load(void);
 int display_service_free(void);