Remove and redefine display dpms state function.
These functions are added to below display-panel.
int display_panel_get_dpms_state(void)
-> This function returns dpms state and replaces get_lcd_power_node located in plugins.
void display_panel_set_dpms_running_state(int val)
-> This function initialize dpms_running_state
Change-Id: I34e29e3477113d2f19835c0782303334ba0d870f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
static struct _backlight_ops backlight_ops;
static int force_brightness;
-static int dpms_running_state = DPMS_SETTING_DONE;
static bool display_dev_available = false;
static const struct display_config *display_conf;
return display_dev_available;
}
-void dpms_set_running_state(int val)
-{
- dpms_running_state = val;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
return ret;
}
-static int get_lcd_power_node(void)
-{
- int ret;
- enum display_state val;
-
- ret = hal_device_display_get_state(&val);
- if (ret < 0)
- return ret;
-
- if (val == DISPLAY_ON && ambient_get_state())
- return DPMS_OFF;
-
- if (dpms_running_state != DPMS_SETTING_DONE)
- return dpms_running_state;
-
- switch (val) {
- case DISPLAY_ON:
- return DPMS_ON;
- case DISPLAY_STANDBY:
- return DPMS_STANDBY;
- case DISPLAY_SUSPEND:
- return DPMS_SUSPEND;
- case DISPLAY_OFF:
- return DPMS_OFF;
- default:
- return -EINVAL;
- }
-}
-
bool display_dimstay_check(void)
{
if (get_pm_status_flag() & DIM_FLAG)
static struct _backlight_ops backlight_ops = {
.get_lcd_power = dpms_get_cached_state,
- .get_lcd_power_node = get_lcd_power_node,
.set_force_brightness = set_force_brightness,
.set_brightness = set_brightness,
.get_brightness = get_brightness,
static struct _backlight_ops backlight_ops;
static int force_brightness;
-static int dpms_running_state = DPMS_SETTING_DONE;
static bool display_dev_available = false;
static const struct display_config *display_conf;
return display_dev_available;
}
-void dpms_set_running_state(int val)
-{
- dpms_running_state = val;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
return ret;
}
-static int get_lcd_power_node(void)
-{
- int ret;
- enum display_state val;
-
- ret = hal_device_display_get_state(&val);
- if (ret < 0)
- return ret;
-
- if (val == DISPLAY_ON && ambient_get_state())
- return DPMS_OFF;
-
- if (dpms_running_state != DPMS_SETTING_DONE)
- return dpms_running_state;
-
- switch (val) {
- case DISPLAY_ON:
- return DPMS_ON;
- case DISPLAY_STANDBY:
- return DPMS_STANDBY;
- case DISPLAY_SUSPEND:
- return DPMS_SUSPEND;
- case DISPLAY_OFF:
- return DPMS_OFF;
- default:
- return -EINVAL;
- }
-}
-
bool display_dimstay_check(void)
{
if (get_pm_status_flag() & DIM_FLAG)
static struct _backlight_ops backlight_ops = {
.get_lcd_power = dpms_get_cached_state,
- .get_lcd_power_node = get_lcd_power_node,
.set_force_brightness = set_force_brightness,
.set_brightness = set_brightness,
.get_brightness = get_brightness,
static struct _backlight_ops backlight_ops;
static int force_brightness;
-static int dpms_running_state = DPMS_SETTING_DONE;
static bool display_dev_available = false;
static const struct display_config *display_conf;
return display_dev_available;
}
-void dpms_set_running_state(int val)
-{
- dpms_running_state = val;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
return ret;
}
-static int get_lcd_power_node(void)
-{
- int ret;
- enum display_state val;
-
- ret = hal_device_display_get_state(&val);
- if (ret < 0)
- return ret;
-
- if (val == DISPLAY_ON && ambient_get_state())
- return DPMS_OFF;
-
- if (dpms_running_state != DPMS_SETTING_DONE)
- return dpms_running_state;
-
- switch (val) {
- case DISPLAY_ON:
- return DPMS_ON;
- case DISPLAY_STANDBY:
- return DPMS_STANDBY;
- case DISPLAY_SUSPEND:
- return DPMS_SUSPEND;
- case DISPLAY_OFF:
- return DPMS_OFF;
- default:
- return -EINVAL;
- }
-}
-
bool display_dimstay_check(void)
{
if (get_pm_status_flag() & DIM_FLAG)
static struct _backlight_ops backlight_ops = {
.get_lcd_power = dpms_get_cached_state,
- .get_lcd_power_node = get_lcd_power_node,
.set_force_brightness = set_force_brightness,
.set_brightness = set_brightness,
.get_brightness = get_brightness,
static struct _backlight_ops backlight_ops;
static struct battery_plugin *battery_plgn;
static int force_brightness;
-static int dpms_running_state = DPMS_SETTING_DONE;
static bool display_dev_available = false;
static int aod_max_level = -1;
static int aod_normal_level = -1;
return display_dev_available;
}
-void dpms_set_running_state(int val)
-{
- dpms_running_state = val;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
return ret;
}
-static int get_lcd_power_node(void)
-{
- int ret;
- enum display_state val;
-
- ret = hal_device_display_get_state(&val);
- if (ret < 0)
- return ret;
-
- if (val == DISPLAY_ON && ambient_get_state())
- return DPMS_OFF;
-
- if (dpms_running_state != DPMS_SETTING_DONE)
- return dpms_running_state;
-
- switch (val) {
- case DISPLAY_ON:
- return DPMS_ON;
- case DISPLAY_STANDBY:
- return DPMS_STANDBY;
- case DISPLAY_SUSPEND:
- return DPMS_SUSPEND;
- case DISPLAY_OFF:
- return DPMS_OFF;
- case DISPLAY_DETACH:
- return DPMS_DETACH;
- default:
- return -EINVAL;
- }
-}
-
bool display_dimstay_check(void)
{
if (get_pm_status_flag() & DIM_FLAG)
static struct _backlight_ops backlight_ops = {
.get_lcd_power = dpms_get_cached_state,
- .get_lcd_power_node = get_lcd_power_node,
.set_force_brightness = set_force_brightness,
.set_brightness = set_brightness,
.get_brightness = get_brightness,
struct _backlight_ops {
int (*get_lcd_power)(void);
- int (*get_lcd_power_node)(void);
int (*set_force_brightness)(int level);
int (*set_brightness)(int val);
int (*get_brightness)(int *val);
#include "shared/log.h"
#include "power/power-suspend.h"
+#include "ambient-mode.h"
#include "display.h"
#include "display-backlight.h"
#include "display-dpms.h"
#define LCD_PHASED_MIN_BRIGHTNESS 1
#define LCD_PHASED_CHANGE_STEP 5
+static int dpms_running_state = DPMS_SETTING_DONE;
+
static struct _backlight_ops *backlight_ops;
/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
return ret;
}
+/* FIXME: This function is deprecated, should be fixed after plugin refactoring */
+void display_panel_set_dpms_running_state(int val)
+{
+ dpms_running_state = val;
+}
+
+/* FIXME: This function is deprecated, should be fixed after plugin refactoring */
+int display_panel_get_dpms_state(void)
+{
+ int ret;
+ enum display_state val;
+
+ ret = hal_device_display_get_state(&val);
+ if (ret < 0)
+ return ret;
+
+ if (val == DISPLAY_ON && ambient_get_state())
+ return DPMS_OFF;
+
+ if (dpms_running_state != DPMS_SETTING_DONE)
+ return dpms_running_state;
+
+ switch (val) {
+ case DISPLAY_ON:
+ return DPMS_ON;
+ case DISPLAY_STANDBY:
+ return DPMS_STANDBY;
+ case DISPLAY_SUSPEND:
+ return DPMS_SUSPEND;
+ case DISPLAY_OFF:
+ return DPMS_OFF;
+ case DISPLAY_DETACH:
+ return DPMS_DETACH;
+ default:
+ return -EINVAL;
+ }
+}
+
/* FIXME: This function is used for only wearable profile, should be fixed after plugin refactoring */
int display_panel_set_image_effect(enum display_image_effect effect)
{
int display_panel_get_panel_mode(enum display_panel_mode *mode);
int display_panel_set_frame_rate(int frame_rate);
int display_panel_get_frame_rate(int *frame_rate);
+int display_panel_get_dpms_state(void);
+void display_panel_set_dpms_running_state(int val);
#endif /* __DISPLAY_PANEL_H__ */
\ No newline at end of file