From: Yunhee Seo Date: Thu, 2 Mar 2023 07:29:09 +0000 (+0900) Subject: display: Change get_lcd_power() to dpms_get_cached_state() X-Git-Tag: accepted/tizen/unified/20230330.025600~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2b118b73f29161309e2edd7005238c375b10962;p=platform%2Fcore%2Fsystem%2Fdeviced.git display: Change get_lcd_power() to dpms_get_cached_state() To move plugin functions without plugin dependency, get_lcd_power() should be replaced by dpms_get_cached_state(). However, touchscreen module is dependent on display module build. Thus, this get_lcd_power() will be changed after resolving build dependency. Change-Id: I4d58f852cf3da29fe58df4fe3f8b69d954c77959 Signed-off-by: Yunhee Seo --- diff --git a/plugins/iot-headed/display/core.c b/plugins/iot-headed/display/core.c index c021a59..d87a3cc 100644 --- a/plugins/iot-headed/display/core.c +++ b/plugins/iot-headed/display/core.c @@ -327,7 +327,7 @@ void lcd_on_procedure(int state, enum device_flags flag) _I("[lcdstep] 0x%lx", flags); if (flags & AMBIENT_MODE) { - if (ambient_get_state() == false && backlight_ops->get_lcd_power() == DPMS_ON) + if (ambient_get_state() == false && dpms_get_cached_state() == DPMS_ON) return; ambient_set_state(false); } @@ -693,7 +693,7 @@ void lcd_on_direct(enum device_flags flags) static inline bool check_lcd_is_on(void) { - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) return false; return true; @@ -766,7 +766,7 @@ int custom_lcdoff(enum device_flags flag) } _I("custom lcd off by flag(%d)", flag); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); if (set_custom_lcdon_timeout(0) == true) @@ -854,7 +854,7 @@ int display_off_by_reason(const char *reason) } _I("platform lcd off by %s", reason); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); /* state transition */ @@ -904,7 +904,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) default_proc_change_state_action(next, -1); break; case S_LCDOFF: - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_EVENT); if (set_custom_lcdon_timeout(0)) update_display_time(); @@ -1450,11 +1450,11 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) { stop_lock_timer(); /* lcd off state : turn off the backlight */ - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); } - if (backlight_ops->get_lcd_power() == DPMS_ON + if (dpms_get_cached_state() == DPMS_ON || lcd_paneloff_mode) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); break; @@ -1463,7 +1463,7 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) stop_lock_timer(); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); if (!pm_get_power_lock_support()) { @@ -1650,7 +1650,7 @@ static int update_setting(int key_idx, int val) /* LCD on if lock screen show before waiting time */ if ((get_pm_cur_state() == S_NORMAL) && val == VCONFKEY_IDLE_LOCK && - backlight_ops->get_lcd_power() != DPMS_ON && + dpms_get_cached_state() != DPMS_ON && is_lcdon_blocked() == LCDON_BLOCK_NONE) lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT); stop_lock_timer(); @@ -1883,7 +1883,7 @@ static int battery_health_changed(void *data) set_pm_status_flag(DIMSTAY_FLAG); } - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) display_backlight_update_by_default_brightness(); return 0; @@ -2106,7 +2106,7 @@ static void display_init(void *data) check_seed_status(); /* In smd test, TSP should be turned off if display panel is not existed. */ - if (backlight_ops->get_lcd_power() == -ENOENT) { + if (dpms_get_cached_state() == -ENOENT) { _I("Display panel is not existed."); lcd_direct_control(DPMS_OFF, NORMAL_MODE); exit_lcd_operation(); diff --git a/plugins/iot-headed/display/key-filter.c b/plugins/iot-headed/display/key-filter.c index aefad96..08adddd 100644 --- a/plugins/iot-headed/display/key-filter.c +++ b/plugins/iot-headed/display/key-filter.c @@ -210,7 +210,7 @@ static inline bool switch_on_lcd(enum device_flags flags) if (current_state_in_on()) return false; - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { if (ambient_get_state() == false) return false; } @@ -230,7 +230,7 @@ static inline void switch_off_lcd(void) if (!current_state_in_on()) return; - if (backlight_ops->get_lcd_power() == DPMS_OFF) + if (dpms_get_cached_state() == DPMS_OFF) return; broadcast_lcdoff_by_powerkey(); @@ -357,7 +357,7 @@ static int decide_lcdoff(void) { /* It's not needed if it's already LCD off state */ if (!current_state_in_on() && - backlight_ops->get_lcd_power() != DPMS_ON) + dpms_get_cached_state() != DPMS_ON) return false; /* diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index bdf0ee3..245d7eb 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -334,7 +334,7 @@ void lcd_on_procedure(int state, enum device_flags flag) _I("[lcdstep] 0x%lx", flags); if (flags & AMBIENT_MODE) { - if (ambient_get_state() == false && backlight_ops->get_lcd_power() == DPMS_ON) + if (ambient_get_state() == false && dpms_get_cached_state() == DPMS_ON) return; ambient_set_state(false); } @@ -700,7 +700,7 @@ void lcd_on_direct(enum device_flags flags) static inline bool check_lcd_is_on(void) { - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) return false; return true; @@ -773,7 +773,7 @@ int custom_lcdoff(enum device_flags flag) } _I("custom lcd off by flag(%d)", flag); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); if (set_custom_lcdon_timeout(0) == true) @@ -861,7 +861,7 @@ int display_off_by_reason(const char *reason) } _I("platform lcd off by %s", reason); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); /* state transition */ @@ -911,7 +911,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) default_proc_change_state_action(next, -1); break; case S_LCDOFF: - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { if (get_proximity_state() == SENSOR_PROXIMITY_NEAR) lcd_off_procedure(LCD_OFF_BY_PROXIMITY); else @@ -1460,11 +1460,11 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) { stop_lock_timer(); /* lcd off state : turn off the backlight */ - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); } - if (backlight_ops->get_lcd_power() == DPMS_ON + if (dpms_get_cached_state() == DPMS_ON || lcd_paneloff_mode) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); break; @@ -1473,7 +1473,7 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) stop_lock_timer(); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); if (!pm_get_power_lock_support()) { @@ -1660,7 +1660,7 @@ static int update_setting(int key_idx, int val) /* LCD on if lock screen show before waiting time */ if ((get_pm_cur_state() == S_NORMAL) && val == VCONFKEY_IDLE_LOCK && - backlight_ops->get_lcd_power() != DPMS_ON && + dpms_get_cached_state() != DPMS_ON && is_lcdon_blocked() == LCDON_BLOCK_NONE) lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT); stop_lock_timer(); @@ -1893,7 +1893,7 @@ static int battery_health_changed(void *data) set_pm_status_flag(DIMSTAY_FLAG); } - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) display_backlight_update_by_default_brightness(); return 0; @@ -2112,7 +2112,7 @@ static void display_init(void *data) check_seed_status(); /* In smd test, TSP should be turned off if display panel is not existed. */ - if (backlight_ops->get_lcd_power() == -ENOENT) { + if (dpms_get_cached_state() == -ENOENT) { _I("Display panel is not existed."); lcd_direct_control(DPMS_OFF, NORMAL_MODE); exit_lcd_operation(); diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c index efdc77c..5e218ef 100644 --- a/plugins/mobile/display/key-filter.c +++ b/plugins/mobile/display/key-filter.c @@ -199,7 +199,7 @@ static inline bool switch_on_lcd(enum device_flags flags) if (current_state_in_on()) return false; - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { if (ambient_get_state() == false) return false; } @@ -219,7 +219,7 @@ static inline void switch_off_lcd(void) if (!current_state_in_on()) return; - if (backlight_ops->get_lcd_power() == DPMS_OFF) + if (dpms_get_cached_state() == DPMS_OFF) return; broadcast_lcdoff_by_powerkey(); @@ -346,7 +346,7 @@ static int decide_lcdoff(void) { /* It's not needed if it's already LCD off state */ if (!current_state_in_on() && - backlight_ops->get_lcd_power() != DPMS_ON) + dpms_get_cached_state() != DPMS_ON) return false; /* @@ -409,7 +409,7 @@ static bool key_check_display_on(void) if (current_state_in_on()) return false; - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { _W("display power was on"); return false; } @@ -423,7 +423,7 @@ static gboolean display_on_cb(void *data) return G_SOURCE_REMOVE; displayon_by_powerkey_timeout_id = 0; - if (backlight_ops->get_lcd_power() != DPMS_ON || + if (dpms_get_cached_state() != DPMS_ON || current_state_in_on() == false) { broadcast_lcdon_by_powerkey(); lcd_on_direct(LCD_ON_BY_POWER_KEY); @@ -496,7 +496,7 @@ static int process_power_key(struct input_event *pinput) ignore = true; if (!displayon_by_powerkey_timeout_id && - backlight_ops->get_lcd_power() != DPMS_ON && + dpms_get_cached_state() != DPMS_ON && key_combination != COMBINATION_TORCH) { displayon_by_powerkey_timeout_id = g_timeout_add( 100, diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 5fa0867..e36a91b 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -327,7 +327,7 @@ void lcd_on_procedure(int state, enum device_flags flag) _I("[lcdstep] 0x%lx", flags); if (flags & AMBIENT_MODE) { - if (ambient_get_state() == false && backlight_ops->get_lcd_power() == DPMS_ON) + if (ambient_get_state() == false && dpms_get_cached_state() == DPMS_ON) return; ambient_set_state(false); } @@ -693,7 +693,7 @@ void lcd_on_direct(enum device_flags flags) static inline bool check_lcd_is_on(void) { - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) return false; return true; @@ -766,7 +766,7 @@ int custom_lcdoff(enum device_flags flag) } _I("custom lcd off by flag(%d)", flag); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); if (set_custom_lcdon_timeout(0) == true) @@ -854,7 +854,7 @@ int display_off_by_reason(const char *reason) } _I("platform lcd off by %s", reason); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); /* state transition */ @@ -904,7 +904,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) default_proc_change_state_action(next, -1); break; case S_LCDOFF: - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_EVENT); if (set_custom_lcdon_timeout(0)) update_display_time(); @@ -1450,11 +1450,11 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) { stop_lock_timer(); /* lcd off state : turn off the backlight */ - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); } - if (backlight_ops->get_lcd_power() == DPMS_ON + if (dpms_get_cached_state() == DPMS_ON || lcd_paneloff_mode) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); break; @@ -1463,7 +1463,7 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) stop_lock_timer(); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); if (!pm_get_power_lock_support()) { @@ -1650,7 +1650,7 @@ static int update_setting(int key_idx, int val) /* LCD on if lock screen show before waiting time */ if ((get_pm_cur_state() == S_NORMAL) && val == VCONFKEY_IDLE_LOCK && - backlight_ops->get_lcd_power() != DPMS_ON && + dpms_get_cached_state() != DPMS_ON && is_lcdon_blocked() == LCDON_BLOCK_NONE) lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT); stop_lock_timer(); @@ -1883,7 +1883,7 @@ static int battery_health_changed(void *data) set_pm_status_flag(DIMSTAY_FLAG); } - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) display_backlight_update_by_default_brightness(); return 0; @@ -2103,7 +2103,7 @@ static void display_init(void *data) check_seed_status(); /* In smd test, TSP should be turned off if display panel is not existed. */ - if (backlight_ops->get_lcd_power() == -ENOENT) { + if (dpms_get_cached_state() == -ENOENT) { _I("Display panel is not existed."); lcd_direct_control(DPMS_OFF, NORMAL_MODE); exit_lcd_operation(); diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index 1a7729a..d5b6ee6 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -210,7 +210,7 @@ static inline bool switch_on_lcd(enum device_flags flags) if (current_state_in_on()) return false; - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { if (ambient_get_state() == false) return false; } @@ -230,7 +230,7 @@ static inline void switch_off_lcd(void) if (!current_state_in_on()) return; - if (backlight_ops->get_lcd_power() == DPMS_OFF) + if (dpms_get_cached_state() == DPMS_OFF) return; broadcast_lcdoff_by_powerkey(); @@ -357,7 +357,7 @@ static int decide_lcdoff(void) { /* It's not needed if it's already LCD off state */ if (!current_state_in_on() && - backlight_ops->get_lcd_power() != DPMS_ON) + dpms_get_cached_state() != DPMS_ON) return false; /* diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index 55067ab..a87e408 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -545,7 +545,7 @@ void lcd_on_procedure(int state, enum device_flags flag) _I("[lcdstep] 0x%lx", flags); if (flags & AMBIENT_MODE) { - if (ambient_get_state() == false && backlight_ops->get_lcd_power() == DPMS_ON) + if (ambient_get_state() == false && dpms_get_cached_state() == DPMS_ON) return; ambient_set_state(false); } @@ -911,7 +911,7 @@ void lcd_on_direct(enum device_flags flags) static inline bool check_lcd_is_on(void) { - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) return false; return true; @@ -1012,7 +1012,7 @@ int custom_lcdoff(enum device_flags flag) } _I("custom lcd off by flag(%d)", flag); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); if (set_custom_lcdon_timeout(0) == true) @@ -1105,7 +1105,7 @@ int display_off_by_reason(const char *reason) } _I("platform lcd off by %s", reason); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(flag); /* state transition */ @@ -1155,7 +1155,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) default_proc_change_state_action(next, -1); break; case S_LCDOFF: - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_EVENT); if (set_custom_lcdon_timeout(0)) update_display_time(); @@ -1721,11 +1721,11 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) { stop_lock_timer(); /* lcd off state : turn off the backlight */ - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); } - if (backlight_ops->get_lcd_power() == DPMS_ON + if (dpms_get_cached_state() == DPMS_ON || lcd_paneloff_mode) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); break; @@ -1734,7 +1734,7 @@ static int default_action(int timeout) if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) stop_lock_timer(); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) lcd_off_procedure(LCD_OFF_BY_TIMEOUT); if (!pm_get_power_lock_support()) { @@ -1917,7 +1917,7 @@ static int update_setting(int key_idx, int val) /* LCD on if lock screen show before waiting time */ if ((get_pm_cur_state() == S_NORMAL) && val == VCONFKEY_IDLE_LOCK && - backlight_ops->get_lcd_power() != DPMS_ON && + dpms_get_cached_state() != DPMS_ON && is_lcdon_blocked() == LCDON_BLOCK_NONE) lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT); stop_lock_timer(); @@ -2145,12 +2145,12 @@ static int battery_health_changed(void *data) if (health == HEALTH_GOOD) { clear_pm_status_flag(BATTERY_FLAG); clear_pm_status_flag(DIMSTAY_FLAG); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) auto_brightness_restore(); } else if (health == HEALTH_LOW || health == HEALTH_HIGH || health == HEALTH_OVP) { set_pm_status_flag(BATTERY_FLAG); set_pm_status_flag(DIMSTAY_FLAG); - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) display_backlight_update_by_default_brightness(); } @@ -2428,7 +2428,7 @@ static void display_init(void *data) check_seed_status(); /* In smd test, TSP should be turned off if display panel is not existed. */ - if (backlight_ops->get_lcd_power() == -ENOENT) { + if (dpms_get_cached_state() == -ENOENT) { _I("Display panel is not existed."); lcd_direct_control(DPMS_OFF, NORMAL_MODE); exit_lcd_operation(); diff --git a/plugins/wearable/display/device-interface.c b/plugins/wearable/display/device-interface.c index ed7ee7d..4b3c185 100644 --- a/plugins/wearable/display/device-interface.c +++ b/plugins/wearable/display/device-interface.c @@ -362,7 +362,7 @@ int display_service_free(void) int is_lcdon_blocked(void) { - int state = backlight_ops.get_lcd_power(); + int state = dpms_get_cached_state(); if ((state == DPMS_DETACH) || (state == -EINVAL)) return LCDON_BLOCK_WHEN_DISPLAY_DETACHED; diff --git a/plugins/wearable/display/display-handler.c b/plugins/wearable/display/display-handler.c index 19517ed..47912b1 100644 --- a/plugins/wearable/display/display-handler.c +++ b/plugins/wearable/display/display-handler.c @@ -56,7 +56,7 @@ static gboolean lcdon_from_aod_cb(gpointer data) autobrt_timer = 0; /* If it is still not turned on, do not apply auto brightness */ - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) return G_SOURCE_REMOVE; backlight_ops->transit_state(DPMS_ON); diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index 69b0fb3..ac92106 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -206,7 +206,7 @@ static inline bool switch_on_lcd(enum device_flags flags) if (current_state_in_on()) return false; - if (backlight_ops->get_lcd_power() == DPMS_ON) { + if (dpms_get_cached_state() == DPMS_ON) { if (ambient_get_state() == false) return false; } @@ -226,7 +226,7 @@ static inline void switch_off_lcd(void) if (!current_state_in_on()) return; - if (backlight_ops->get_lcd_power() == DPMS_OFF) + if (dpms_get_cached_state() == DPMS_OFF) return; broadcast_lcdoff_by_powerkey(); @@ -353,7 +353,7 @@ static int decide_lcdoff(void) { /* It's not needed if it's already LCD off state */ if (!current_state_in_on() && - backlight_ops->get_lcd_power() != DPMS_ON) + dpms_get_cached_state() != DPMS_ON) return false; /* diff --git a/plugins/wearable/display/swim.c b/plugins/wearable/display/swim.c index d30eade..40c0928 100644 --- a/plugins/wearable/display/swim.c +++ b/plugins/wearable/display/swim.c @@ -91,7 +91,7 @@ static void swimmode_signal_handler(GDBusConnection *conn, _I("Request swim mode state %d by %d", val, pid); - if (backlight_ops->get_lcd_power != DPMS_ON) { + if (dpms_get_cached_state() != DPMS_ON) { if (disp_plgn->pm_change_internal) disp_plgn->pm_change_internal(INTERNAL_LOCK_SWIM, S_NORMAL); lcd_state = true; diff --git a/src/display/ambient-mode.c b/src/display/ambient-mode.c index 0a91396..8f4cdb7 100644 --- a/src/display/ambient-mode.c +++ b/src/display/ambient-mode.c @@ -88,7 +88,7 @@ static void ambient_set_condition(keynode_t *key_nodes, void *data) val = vconf_keynode_get_bool(key_nodes); if (val != ambient_condition) { - if (backlight_ops->get_lcd_power() != DPMS_ON) + if (dpms_get_cached_state() != DPMS_ON) if (disp_plgn->pm_lock_internal) disp_plgn->pm_change_internal(INTERNAL_LOCK_PM, LCD_NORMAL); } @@ -140,7 +140,7 @@ void ambient_check_invalid_state(pid_t pid) if (is_emulator()) { /* In emulator, deviced does not turn off the display. */ - if (backlight_ops->get_lcd_power() == DPMS_ON) + if (dpms_get_cached_state() == DPMS_ON) return; } diff --git a/src/display/display-lock.c b/src/display/display-lock.c index bfdd7e9..fa5170b 100644 --- a/src/display/display-lock.c +++ b/src/display/display-lock.c @@ -181,7 +181,7 @@ static gboolean default_pmlock_check(void *data) state = node->state; pid = node->pid; - if (state == S_LCDOFF && backlight_ops->get_lcd_power() == DPMS_ON) { + if (state == S_LCDOFF && dpms_get_cached_state() == DPMS_ON) { _D("Lcd state is PM_LCD_POWER_ON"); return G_SOURCE_CONTINUE; } diff --git a/src/touchscreen/touchscreen.c b/src/touchscreen/touchscreen.c index d7d0c18..5c76054 100644 --- a/src/touchscreen/touchscreen.c +++ b/src/touchscreen/touchscreen.c @@ -66,6 +66,11 @@ static void touchscreen_wakeup_status(keynode_t *key, void *data) display_conf->touch_wakeup = vconf_keynode_get_bool(key); + /** + * FIXME: backlight_ops->get_lcd_power() should be changed to + * dpms_get_cached_state() function. + * After deviding src/display module and plugin display module from build. + */ if (backlight_ops->get_lcd_power() != DPMS_ON) { if (display_conf->touch_wakeup) touchscreen_start(NORMAL_MODE); @@ -185,6 +190,11 @@ static int touchscreen_start(enum device_flags flags) ret = touchscreen_set_state(TOUCHSCREEN_ON); state = -1; + /** + * FIXME: backlight_ops->get_lcd_power() should be changed to + * dpms_get_cached_state() function. + * After deviding src/display module and plugin display module from build. + */ if (backlight_ops && backlight_ops->get_lcd_power) state = backlight_ops->get_lcd_power();