lcd_on/off_procedure() rules are same in all plugins except wearable.
Thus, duplicated codes are removed and relocated to display-panel.
These functions are added below display-panel.
- void display_panel_lcd_on_procedure(int state, enum device_flags flag);
-> This replaces lcd_on_procedure(), it works to turn on lcd.
- void display_panel_lcd_off_procedure(enum device_flags flag);
-> This replaces lcd_off_procedure(), it works to turn off lcd.
- bool display_panel_is_lcd_on_state_broadcasted(void);
-> With this, It is possible to know if the lcd_on/off_procedure() done.
This is used as flag of lcd on/off process.
This function is added below display-plugin.
- int display_plugin_lcd_off_procedure(enum device_flags flag);
-> This is for wearable plugin, there is lcd_off_procedure() use case in the key-filter.c
Change-Id: I1a7f8268df4d45d0585fe7c8a93981cc7be4268c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
static int system_wakeup_flag = false;
static char *custom_change_name;
static struct timeval lcdon_tv;
-/*
- * The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
- * state because it should be sent from previous state at booting time.
- */
-static bool lcdon_broadcast = true;
/* default transition, action fuctions */
static int default_action(int timeout);
return UNKNOWN_STR;
}
-void lcd_on_procedure(int state, enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display on procedure
- * step 1. leave doze
- * step 2. broadcast lcd on signal with cause
- * step 3. set brightness
- * step 4. set pmstate of vconf
- * step 5. display on operate
- * - a. display on
- * - b. TSP(touch screen) and touchkey enable
- * step 6. broadcast lcd on complete signal
- * step 7. key backlight enable
- */
- leave_doze();
-
- _I("[lcdstep] 0x%lx", flags);
-
- /* send LCDOn dbus signal */
- if (!lcdon_broadcast)
- broadcast_lcd_on(SIGNAL_PRE, flags);
-
- /* Update brightness level */
- if (state == LCD_DIM)
- display_backlight_set_brightness_by_dim_brightness();
- else if (state == LCD_NORMAL)
- display_backlight_update_by_default_brightness();
-
- if (state == LCD_NORMAL)
- set_setting_pmstate(S_NORMAL);
- else if (state == LCD_DIM)
- set_setting_pmstate(S_LCDDIM);
-
- display_start_dependent_device(flags);
-
- if (!lcdon_broadcast) {
- broadcast_lcd_on(SIGNAL_POST, flags);
- lcdon_broadcast = true;
- }
-
- touchled_control_backlight(TOUCHLED_DIRECT_ON);
-
- display_misc_set_touch_event_blocked(false);
-}
-
-inline void lcd_off_procedure(enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display off procedure
- * step 0. enhance mode off using nofity (e.g mdnie, HBM, LBM)
- * step 1. broadcast lcd off signal with cause
- * step 2. set pmstate of vconf
- * step 3. display off operate
- * - a. display off
- * - b. TSP(touch screen) and touchkey disable
- * step 4. broadcast lcd off complete siganl
- * step 5. enter doze mode if it is enabled
- */
- _I("[lcdstep] 0x%lx", flags);
-
- /* notification */
-
- device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL);
-
- if (lcdon_broadcast) {
- broadcast_lcd_off(SIGNAL_PRE, flags);
- lcdon_broadcast = false;
- }
-
- /* operation */
-
- display_misc_set_touch_event_blocked(true);
-
- set_setting_pmstate(S_LCDOFF);
-
- touchled_control_backlight(TOUCHLED_DIRECT_OFF);
-
- display_stop_dependent_device(flags);
-
- broadcast_lcd_off(SIGNAL_POST, flags);
- device_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL);
-
- enter_doze();
-}
-
static void update_display_locktime(int time)
{
display_state_transition_set_lock_screen_timeout(time);
_D("lcd is on directly");
gettimeofday(&lcdon_tv, NULL);
- lcd_on_procedure(LCD_NORMAL, flags);
+ display_panel_lcd_on_procedure(LCD_NORMAL, flags);
update_display_locktime(LOCK_SCREEN_INPUT_TIMEOUT);
}
_I("custom lcd off by flag(%d)", flag);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
_I("platform lcd off by %s", reason);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
/* state transition */
set_pm_old_state(get_pm_cur_state());
break;
case S_LCDOFF:
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
if (set_custom_lcdon_timeout(0))
display_state_transition_update_display_state_timeout_by_priority();
default_proc_change_state_action(next, -1);
delete_condition(S_NORMAL);
delete_condition(S_LCDDIM);
delete_condition(S_LCDOFF);
- if (lcdon_broadcast) {
+ if (display_panel_is_lcd_on_state_broadcasted()) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
display_backlight_update_by_default_brightness();
if (check_lcd_is_on() == false)
- lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
break;
case S_LCDDIM:
display_backlight_set_brightness_by_dim_brightness();
if ((get_pm_old_state() == S_LCDOFF) || (get_pm_old_state() == S_SLEEP))
- lcd_on_procedure(LCD_DIM, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_DIM, NORMAL_MODE);
break;
case S_LCDOFF:
if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) {
/* lcd off state : turn off the backlight */
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
}
display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
if (display_panel_get_dpms_cached_state() == DPMS_ON
|| lcd_paneloff_mode)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
break;
case S_SLEEP:
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
if (!pm_get_power_lock_support()) {
/* sleep state : set system mode to SUSPEND */
val == VCONFKEY_IDLE_LOCK &&
display_panel_get_dpms_cached_state() != DPMS_ON &&
is_lcdon_blocked() == LCDON_BLOCK_NONE)
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
if (get_pm_cur_state() == S_NORMAL)
display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_INPUT);
switch (get_pm_cur_state()) {
case S_NORMAL:
case S_LCDDIM:
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
if (display_conf.timeout_enable) {
timeout = states[S_NORMAL].timeout;
/* check minimun lcd on time */
}
break;
case S_LCDOFF:
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
timeout = display_conf.lcdoff_timeout;
display_state_transition_reset_state_transition_timeout(timeout);
break;
setup_display_plugin_backlight_ops(dp);
dp->set_dim_state = NULL;
dp->get_device_flags = NULL;
+ dp->lcd_off_procedure = NULL;
setup_display_plugin_backlight_ops(dp);
/* check display feature */
// wm_ready = check_wm_ready();
if (display_panel_init_dpms()) {
if (is_lcdon_blocked() != LCDON_BLOCK_NONE)
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
else
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
} else {
add_timer_for_dpms_init();
}
broadcast_lcdoff_by_powerkey();
- lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
}
static void check_key_combination(struct input_event *pinput)
static int system_wakeup_flag = false;
static char *custom_change_name;
static struct timeval lcdon_tv;
-/*
- * The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
- * state because it should be sent from previous state at booting time.
- */
-static bool lcdon_broadcast = true;
/* default transition, action fuctions */
static int default_action(int timeout);
return UNKNOWN_STR;
}
-void lcd_on_procedure(int state, enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display on procedure
- * step 1. leave doze
- * step 2. broadcast lcd on signal with cause
- * step 3. set brightness
- * step 4. set pmstate of vconf
- * step 5. display on operate
- * - a. display on
- * - b. TSP(touch screen) and touchkey enable
- * step 6. broadcast lcd on complete signal
- * step 7. key backlight enable
- */
- leave_doze();
-
- _I("[lcdstep] 0x%lx", flags);
-
- /* send LCDOn dbus signal */
- if (!lcdon_broadcast)
- broadcast_lcd_on(SIGNAL_PRE, flags);
-
- /* Update brightness level */
- if (state == LCD_DIM)
- display_backlight_set_brightness_by_dim_brightness();
- else if (state == LCD_NORMAL)
- display_backlight_update_by_default_brightness();
-
- if (state == LCD_NORMAL)
- set_setting_pmstate(S_NORMAL);
- else if (state == LCD_DIM)
- set_setting_pmstate(S_LCDDIM);
-
- display_start_dependent_device(flags);
-
- if (!lcdon_broadcast) {
- broadcast_lcd_on(SIGNAL_POST, flags);
- lcdon_broadcast = true;
- }
-
- touchled_control_backlight(TOUCHLED_DIRECT_ON);
-
- display_misc_set_touch_event_blocked(false);
-}
-
-inline void lcd_off_procedure(enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display off procedure
- * step 0. enhance mode off using nofity (e.g mdnie, HBM, LBM)
- * step 1. broadcast lcd off signal with cause
- * step 2. set pmstate of vconf
- * step 3. display off operate
- * - a. display off
- * - b. TSP(touch screen) and touchkey disable
- * step 4. broadcast lcd off complete siganl
- * step 5. enter doze mode if it is enabled
- */
- _I("[lcdstep] 0x%lx", flags);
-
- /* notification */
-
- device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL);
-
- if (lcdon_broadcast) {
- broadcast_lcd_off(SIGNAL_PRE, flags);
- lcdon_broadcast = false;
- }
-
- /* operation */
-
- display_misc_set_touch_event_blocked(true);
-
- set_setting_pmstate(S_LCDOFF);
-
- touchled_control_backlight(TOUCHLED_DIRECT_OFF);
-
- display_stop_dependent_device(flags);
-
- broadcast_lcd_off(SIGNAL_POST, flags);
- device_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL);
-
- enter_doze();
-}
-
static void update_display_locktime(int time)
{
display_state_transition_set_lock_screen_timeout(time);
_D("lcd is on directly");
gettimeofday(&lcdon_tv, NULL);
- lcd_on_procedure(LCD_NORMAL, flags);
+ display_panel_lcd_on_procedure(LCD_NORMAL, flags);
update_display_locktime(LOCK_SCREEN_INPUT_TIMEOUT);
}
_I("custom lcd off by flag(%d)", flag);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
_I("platform lcd off by %s", reason);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
/* state transition */
set_pm_old_state(get_pm_cur_state());
case S_LCDOFF:
if (display_panel_get_dpms_cached_state() == DPMS_ON) {
if (get_proximity_state() == SENSOR_PROXIMITY_NEAR)
- lcd_off_procedure(LCD_OFF_BY_PROXIMITY);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_PROXIMITY);
else
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
}
if (set_custom_lcdon_timeout(0))
display_state_transition_update_display_state_timeout_by_priority();
delete_condition(S_NORMAL);
delete_condition(S_LCDDIM);
delete_condition(S_LCDOFF);
- if (lcdon_broadcast) {
+ if (display_panel_is_lcd_on_state_broadcasted()) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
display_backlight_update_by_default_brightness();
if (check_lcd_is_on() == false)
- lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
break;
case S_LCDDIM:
display_backlight_set_brightness_by_dim_brightness();
if ((get_pm_old_state() == S_LCDOFF) || (get_pm_old_state() == S_SLEEP))
- lcd_on_procedure(LCD_DIM, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_DIM, NORMAL_MODE);
break;
case S_LCDOFF:
if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) {
/* lcd off state : turn off the backlight */
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
}
display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
if (display_panel_get_dpms_cached_state() == DPMS_ON
|| lcd_paneloff_mode)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
break;
case S_SLEEP:
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
if (!pm_get_power_lock_support()) {
/* sleep state : set system mode to SUSPEND */
val == VCONFKEY_IDLE_LOCK &&
display_panel_get_dpms_cached_state() != DPMS_ON &&
is_lcdon_blocked() == LCDON_BLOCK_NONE)
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
if (get_pm_cur_state() == S_NORMAL)
display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_INPUT);
switch (get_pm_cur_state()) {
case S_NORMAL:
case S_LCDDIM:
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
if (display_conf.timeout_enable) {
timeout = states[S_NORMAL].timeout;
/* check minimun lcd on time */
}
break;
case S_LCDOFF:
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
timeout = display_conf.lcdoff_timeout;
display_state_transition_reset_state_transition_timeout(timeout);
break;
setup_display_plugin_backlight_ops(dp);
dp->set_dim_state = NULL;
dp->get_device_flags = NULL;
+ dp->lcd_off_procedure = NULL;
setup_display_plugin_backlight_ops(dp);
/**
// wm_ready = check_wm_ready();
if (display_panel_init_dpms()) {
if (is_lcdon_blocked() != LCDON_BLOCK_NONE)
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
else
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
} else {
add_timer_for_dpms_init();
}
broadcast_lcdoff_by_powerkey();
- lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
}
static void check_key_combination(struct input_event *pinput)
static int system_wakeup_flag = false;
static char *custom_change_name;
static struct timeval lcdon_tv;
-/*
- * The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
- * state because it should be sent from previous state at booting time.
- */
-static bool lcdon_broadcast = true;
/* default transition, action fuctions */
static int default_action(int timeout);
return UNKNOWN_STR;
}
-void lcd_on_procedure(int state, enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display on procedure
- * step 1. leave doze
- * step 2. broadcast lcd on signal with cause
- * step 3. set brightness
- * step 4. set pmstate of vconf
- * step 5. display on operate
- * - a. display on
- * - b. TSP(touch screen) and touchkey enable
- * step 6. broadcast lcd on complete signal
- * step 7. key backlight enable
- */
- leave_doze();
-
- _I("[lcdstep] 0x%lx", flags);
-
- /* send LCDOn dbus signal */
- if (!lcdon_broadcast)
- broadcast_lcd_on(SIGNAL_PRE, flags);
-
- /* Update brightness level */
- if (state == LCD_DIM)
- display_backlight_set_brightness_by_dim_brightness();
- else if (state == LCD_NORMAL)
- display_backlight_update_by_default_brightness();
-
- if (state == LCD_NORMAL)
- set_setting_pmstate(S_NORMAL);
- else if (state == LCD_DIM)
- set_setting_pmstate(S_LCDDIM);
-
- display_start_dependent_device(flags);
-
- if (!lcdon_broadcast) {
- broadcast_lcd_on(SIGNAL_POST, flags);
- lcdon_broadcast = true;
- }
-
- touchled_control_backlight(TOUCHLED_DIRECT_ON);
-
- display_misc_set_touch_event_blocked(false);
-}
-
-inline void lcd_off_procedure(enum device_flags flag)
-{
- unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
- flags |= flag;
-
- /*
- * Display off procedure
- * step 0. enhance mode off using nofity (e.g mdnie, HBM, LBM)
- * step 1. broadcast lcd off signal with cause
- * step 2. set pmstate of vconf
- * step 3. display off operate
- * - a. display off
- * - b. TSP(touch screen) and touchkey disable
- * step 4. broadcast lcd off complete siganl
- * step 5. enter doze mode if it is enabled
- */
- _I("[lcdstep] 0x%lx", flags);
-
- /* notification */
-
- device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL);
-
- if (lcdon_broadcast) {
- broadcast_lcd_off(SIGNAL_PRE, flags);
- lcdon_broadcast = false;
- }
-
- /* operation */
-
- display_misc_set_touch_event_blocked(true);
-
- set_setting_pmstate(S_LCDOFF);
-
- touchled_control_backlight(TOUCHLED_DIRECT_OFF);
-
- display_stop_dependent_device(flags);
-
- broadcast_lcd_off(SIGNAL_POST, flags);
- device_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL);
-
- enter_doze();
-}
-
static void update_display_locktime(int time)
{
display_state_transition_set_lock_screen_timeout(time);
_D("lcd is on directly");
gettimeofday(&lcdon_tv, NULL);
- lcd_on_procedure(LCD_NORMAL, flags);
+ display_panel_lcd_on_procedure(LCD_NORMAL, flags);
update_display_locktime(LOCK_SCREEN_INPUT_TIMEOUT);
}
_I("custom lcd off by flag(%d)", flag);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
_I("platform lcd off by %s", reason);
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(flag);
+ display_panel_lcd_off_procedure(flag);
/* state transition */
set_pm_old_state(get_pm_cur_state());
break;
case S_LCDOFF:
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
if (set_custom_lcdon_timeout(0))
display_state_transition_update_display_state_timeout_by_priority();
default_proc_change_state_action(next, -1);
delete_condition(S_NORMAL);
delete_condition(S_LCDDIM);
delete_condition(S_LCDOFF);
- if (lcdon_broadcast) {
+ if (display_panel_is_lcd_on_state_broadcasted()) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
display_backlight_update_by_default_brightness();
if (check_lcd_is_on() == false)
- lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
break;
case S_LCDDIM:
display_backlight_set_brightness_by_dim_brightness();
if ((get_pm_old_state() == S_LCDOFF) || (get_pm_old_state() == S_SLEEP))
- lcd_on_procedure(LCD_DIM, NORMAL_MODE);
+ display_panel_lcd_on_procedure(LCD_DIM, NORMAL_MODE);
break;
case S_LCDOFF:
if ((get_pm_old_state() != S_SLEEP) && (get_pm_old_state() != S_LCDOFF)) {
/* lcd off state : turn off the backlight */
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
}
display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
if (display_panel_get_dpms_cached_state() == DPMS_ON
|| lcd_paneloff_mode)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
break;
case S_SLEEP:
if (display_panel_get_dpms_cached_state() == DPMS_ON)
- lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
if (!pm_get_power_lock_support()) {
/* sleep state : set system mode to SUSPEND */
val == VCONFKEY_IDLE_LOCK &&
display_panel_get_dpms_cached_state() != DPMS_ON &&
is_lcdon_blocked() == LCDON_BLOCK_NONE)
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
if (get_pm_cur_state() == S_NORMAL)
display_state_transition_do_state_transition(get_pm_cur_state(), EVENT_INPUT);
switch (get_pm_cur_state()) {
case S_NORMAL:
case S_LCDDIM:
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
if (display_conf.timeout_enable) {
timeout = states[S_NORMAL].timeout;
/* check minimun lcd on time */
}
break;
case S_LCDOFF:
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
timeout = display_conf.lcdoff_timeout;
display_state_transition_reset_state_transition_timeout(timeout);
break;
setup_display_plugin_backlight_ops(dp);
dp->set_dim_state = NULL;
dp->get_device_flags = NULL;
+ dp->lcd_off_procedure = NULL;
setup_display_plugin_backlight_ops(dp);
/**
// wm_ready = check_wm_ready();
if (display_panel_init_dpms()) {
if (is_lcdon_blocked() != LCDON_BLOCK_NONE)
- lcd_off_procedure(LCD_OFF_BY_EVENT);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
else
- lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
+ display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
} else {
add_timer_for_dpms_init();
}
broadcast_lcdoff_by_powerkey();
- lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
}
static void check_key_combination(struct input_event *pinput)
return G_SOURCE_REMOVE;
}
-void lcd_on_procedure(int state, enum device_flags flag)
+static void lcd_on_procedure(int state, enum device_flags flag)
{
unsigned long flags = NORMAL_MODE;
display_plugin_get_device_flags(&flags);
display_misc_set_touch_event_blocked(false);
}
-inline void lcd_off_procedure(enum device_flags flag)
+static void lcd_off_procedure(enum device_flags flag)
{
unsigned long flags = NORMAL_MODE;
display_plugin_get_device_flags(&flags);
setup_display_plugin_backlight_ops(dp);
dp->set_dim_state = set_dim_state;
dp->get_device_flags = get_device_flags;
+ dp->lcd_off_procedure = lcd_off_procedure;
setup_display_plugin_backlight_ops(dp);
/**
broadcast_lcdoff_by_powerkey();
- lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
+ display_panel_lcd_off_procedure(LCD_OFF_BY_POWER_KEY);
}
static void check_key_combination(struct input_event *pinput)
int set_lcd_timeout(int on, int dim, int holdkey_block, const char *name);
int custom_lcdon(int timeout);
void lcd_on_direct(enum device_flags flags);
-void lcd_on_procedure(int state, enum device_flags flag);
-void lcd_off_procedure(enum device_flags flag);
void broadcast_lcd_off_late(enum device_flags flags);
/* auto-brightness.c */
#include "shared/log.h"
#include "power/power-suspend.h"
+#include "power/power-doze.h"
#include "ambient-mode.h"
#include "device-interface.h"
-#include "display-backlight.h"
+#include "display-misc.h"
#include "display-panel.h"
-#include "display-plugin.h"
+#include "display-signal.h"
+#include "led/touch-key.h"
#define MAX_WHITE_BALANCE_GAIN 2047
#define MAX_WHITE_BALANCE_OFFSET 2047
static int dpms_running_state = DPMS_SETTING_DONE;
static bool lcd_paneloff_mode = false;
+static bool lcd_on_broadcasted = true;
/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
int display_panel_set_dpms_state(int dpms_on, enum device_flags flags)
*on = lcd_paneloff_mode;
}
+void display_panel_lcd_on_procedure(int state, enum device_flags flag)
+{
+ unsigned long flags = NORMAL_MODE;
+ display_plugin_get_device_flags(&flags);
+ flags |= flag;
+
+ /*
+ * Display on procedure
+ * step 1. leave doze
+ * step 2. broadcast lcd on signal with cause
+ * step 3. set brightness
+ * step 4. set pmstate of vconf
+ * step 5. display on operate
+ * - a. display on
+ * - b. TSP(touch screen) and touchkey enable
+ * step 6. broadcast lcd on complete signal
+ * step 7. key backlight enable
+ */
+ leave_doze();
+
+ _I("[lcdstep] 0x%lx", flags);
+
+ /* send LCDOn dbus signal */
+ if (!lcd_on_broadcasted)
+ broadcast_lcd_on(SIGNAL_PRE, flags);
+
+ /* Update brightness level */
+ if (state == LCD_DIM)
+ display_backlight_set_brightness_by_dim_brightness();
+ else if (state == LCD_NORMAL)
+ display_backlight_update_by_default_brightness();
+
+ if (state == LCD_NORMAL)
+ set_setting_pmstate(S_NORMAL);
+ else if (state == LCD_DIM)
+ set_setting_pmstate(S_LCDDIM);
+
+ display_start_dependent_device(flags);
+
+ if (!lcd_on_broadcasted) {
+ broadcast_lcd_on(SIGNAL_POST, flags);
+ lcd_on_broadcasted = true;
+ }
+
+ touchled_control_backlight(TOUCHLED_DIRECT_ON);
+
+ display_misc_set_touch_event_blocked(false);
+}
+
+void display_panel_lcd_off_procedure(enum device_flags flag)
+{
+ unsigned long flags = NORMAL_MODE;
+ display_plugin_get_device_flags(&flags);
+ flags |= flag;
+
+ if (display_plugin_lcd_off_procedure(flag) == 0)
+ return;
+ /*
+ * Display off procedure
+ * step 0. enhance mode off using nofity (e.g mdnie, HBM, LBM)
+ * step 1. broadcast lcd off signal with cause
+ * step 2. set pmstate of vconf
+ * step 3. display off operate
+ * - a. display off
+ * - b. TSP(touch screen) and touchkey disable
+ * step 4. broadcast lcd off complete siganl
+ * step 5. enter doze mode if it is enabled
+ */
+ _I("[lcdstep] 0x%lx", flags);
+
+ /* notification */
+
+ device_notify(DEVICE_NOTIFIER_LCD_OFF, NULL);
+
+ if (lcd_on_broadcasted) {
+ broadcast_lcd_off(SIGNAL_PRE, flags);
+ lcd_on_broadcasted = false;
+ }
+
+ /* operation */
+
+ display_misc_set_touch_event_blocked(true);
+
+ set_setting_pmstate(S_LCDOFF);
+
+ touchled_control_backlight(TOUCHLED_DIRECT_OFF);
+
+ display_stop_dependent_device(flags);
+
+ broadcast_lcd_off(SIGNAL_POST, flags);
+ device_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL);
+
+ enter_doze();
+}
+
+bool display_panel_is_lcd_on_state_broadcasted(void)
+{
+ return lcd_on_broadcasted;
+}
+
/* FIXME: This function is deprecated, should be fixed after plugin refactoring */
void display_panel_set_dpms_running_state(int val)
{
int display_panel_set_panel_state_by_standby_state(bool standby_on);
void display_panel_set_lcd_paneloff_mode(bool on);
void display_panel_get_lcd_paneloff_mode(bool *on);
+void display_panel_lcd_on_procedure(int state, enum device_flags flag);
+void display_panel_lcd_off_procedure(enum device_flags flag);
+bool display_panel_is_lcd_on_state_broadcasted(void);
/* Deprecated functions */
int display_panel_set_image_effect(enum display_image_effect effect);
int display_panel_get_image_effect(enum display_image_effect *effect);
return 0;
}
+int display_plugin_lcd_off_procedure(enum device_flags flag)
+{
+ if (g_display_plugin.lcd_off_procedure) {
+ g_display_plugin.lcd_off_procedure(flag);
+ return 0;
+ }
+
+ return -EOPNOTSUPP;
+}
+
int display_plugin_backlight_get_lcd_power(void)
{
if (g_display_plugin.backlight && g_display_plugin.backlight->get_lcd_power)
/* FIXME: function names will be redefined */
void (*set_dim_state) (bool on);
int (*get_device_flags) (unsigned long *device_flags);
+ void (*lcd_off_procedure) (enum device_flags flag);
struct display_config *config;
struct display_backlight_ops *backlight;
int display_plugin_auto_brightness_control(enum brightness_request_e request, int set_brightness);
int display_plugin_set_dim_state(bool on);
int display_plugin_get_device_flags(unsigned long *device_flags);
+int display_plugin_lcd_off_procedure(enum device_flags flag);
int display_plugin_backlight_get_lcd_power(void);
int display_plugin_backlight_set_brightness(int brightness);