To move plugin functions without plugin dependency, this temporary function is needed.
int display_panel_set_dpms_state(int dpms_on, enum device_flags flags)
-> This function replaces the bl_onoff function of plugins.
Change-Id: I0720781ba1cb2afeda5e461c1d979d4a9f2ceb4d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
#include "display/display.h"
#include "display/display-lock.h"
#include "display/display-backlight.h"
+#include "display/display-panel.h"
#define TOUCH_ON 1
#define TOUCH_OFF 0
dpms_running_state = val;
}
-static int bl_onoff(int on, enum device_flags flags)
-{
- dpms_set_state(on);
-
-#ifdef ENABLE_PM_LOG
- if (on == DPMS_ON)
- pm_history_save(PM_LOG_LCD_ON_COMPLETE, get_pm_cur_state());
- else if (on == DPMS_OFF || on == DPMS_FORCE_OFF)
- pm_history_save(PM_LOG_LCD_OFF_COMPLETE, get_pm_cur_state());
- else
- pm_history_save(PM_LOG_LCD_CONTROL_FAIL, on);
-#endif
-
- return 0;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
_I("[DPMS XLIB Backlight] LCD on %#x cnt:%d", flags, cnt);
cnt++;
- ret = bl_onoff(DPMS_ON, flags);
+ ret = display_panel_set_dpms_state(DPMS_ON, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_ON, get_pm_cur_state());
#endif
LCD_PHASED_MIN_BRIGHTNESS, LCD_PHASED_CHANGE_STEP);
if (flags & FORCE_OFF_MODE)
- ret = bl_onoff(DPMS_FORCE_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_FORCE_OFF, flags);
else
- ret = bl_onoff(DPMS_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_OFF, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_OFF, get_pm_cur_state());
if ((dpms_get_cached_state() == DPMS_ON) || force) {
_I("LCD standby");
- ret = bl_onoff(DPMS_STANDBY, 0);
+ ret = display_panel_set_dpms_state(DPMS_STANDBY, 0);
}
return ret;
#include "display/display.h"
#include "display/display-lock.h"
#include "display/display-backlight.h"
+#include "display/display-panel.h"
#include "power/power-boot.h"
#include "power/power-suspend.h"
dpms_running_state = val;
}
-static int bl_onoff(int on, enum device_flags flags)
-{
- dpms_set_state(on);
-
-#ifdef ENABLE_PM_LOG
- if (on == DPMS_ON)
- pm_history_save(PM_LOG_LCD_ON_COMPLETE, get_pm_cur_state());
- else if (on == DPMS_OFF || on == DPMS_FORCE_OFF)
- pm_history_save(PM_LOG_LCD_OFF_COMPLETE, get_pm_cur_state());
- else
- pm_history_save(PM_LOG_LCD_CONTROL_FAIL, on);
-#endif
-
- return 0;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
_I("[DPMS XLIB Backlight] LCD on %#x cnt:%d", flags, cnt);
cnt++;
- ret = bl_onoff(DPMS_ON, flags);
+ ret = display_panel_set_dpms_state(DPMS_ON, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_ON, get_pm_cur_state());
#endif
LCD_PHASED_MIN_BRIGHTNESS, LCD_PHASED_CHANGE_STEP);
if (flags & FORCE_OFF_MODE)
- ret = bl_onoff(DPMS_FORCE_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_FORCE_OFF, flags);
else
- ret = bl_onoff(DPMS_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_OFF, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_OFF, get_pm_cur_state());
if ((dpms_get_cached_state() == DPMS_ON) || force) {
_I("LCD standby");
- ret = bl_onoff(DPMS_STANDBY, 0);
+ ret = display_panel_set_dpms_state(DPMS_STANDBY, 0);
}
return ret;
#include "vconf.h"
#include "core.h"
#include "display/display-dpms.h"
+#include "display/display-panel.h"
#include "display/display.h"
#include "display/display-backlight.h"
#include "power/power-suspend.h"
dpms_running_state = val;
}
-static int bl_onoff(int on, enum device_flags flags)
-{
- dpms_set_state(on);
-
-#ifdef ENABLE_PM_LOG
- if (on == DPMS_ON)
- pm_history_save(PM_LOG_LCD_ON_COMPLETE, get_pm_cur_state());
- else if (on == DPMS_OFF || on == DPMS_FORCE_OFF)
- pm_history_save(PM_LOG_LCD_OFF_COMPLETE, get_pm_cur_state());
- else
- pm_history_save(PM_LOG_LCD_CONTROL_FAIL, on);
-#endif
-
- return 0;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
_I("[DPMS XLIB Backlight] LCD on %#x cnt:%d", flags, cnt);
cnt++;
- ret = bl_onoff(DPMS_ON, flags);
+ ret = display_panel_set_dpms_state(DPMS_ON, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_ON, get_pm_cur_state());
#endif
LCD_PHASED_MIN_BRIGHTNESS, LCD_PHASED_CHANGE_STEP);
if (flags & FORCE_OFF_MODE)
- ret = bl_onoff(DPMS_FORCE_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_FORCE_OFF, flags);
else
- ret = bl_onoff(DPMS_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_OFF, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_OFF, get_pm_cur_state());
if ((dpms_get_cached_state() == DPMS_ON) || force) {
_I("LCD standby");
- ret = bl_onoff(DPMS_STANDBY, 0);
+ ret = display_panel_set_dpms_state(DPMS_STANDBY, 0);
}
return ret;
#include "display/display.h"
#include "display/display-lock.h"
#include "display/display-backlight.h"
+#include "display/display-panel.h"
#include "battery-monitor.h"
#include "battery/power-supply.h"
#include "power/power-suspend.h"
dpms_running_state = val;
}
-static int bl_onoff(int on, enum device_flags flags)
-{
- dpms_set_state(on);
-
-#ifdef ENABLE_PM_LOG
- if (on == DPMS_ON)
- pm_history_save(PM_LOG_LCD_ON_COMPLETE, get_pm_cur_state());
- else if (on == DPMS_OFF || on == DPMS_FORCE_OFF)
- pm_history_save(PM_LOG_LCD_OFF_COMPLETE, get_pm_cur_state());
- else
- pm_history_save(PM_LOG_LCD_CONTROL_FAIL, on);
-#endif
-
- return 0;
-}
-
static int bl_brt(int brightness, int delay)
{
int ret = -1;
_I("[DPMS XLIB Backlight] LCD on %#x cnt:%d", flags, cnt);
cnt++;
- ret = bl_onoff(DPMS_ON, flags);
+ ret = display_panel_set_dpms_state(DPMS_ON, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_ON, get_pm_cur_state());
#endif
LCD_PHASED_MIN_BRIGHTNESS, LCD_PHASED_CHANGE_STEP);
if (flags & FORCE_OFF_MODE)
- ret = bl_onoff(DPMS_FORCE_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_FORCE_OFF, flags);
else
- ret = bl_onoff(DPMS_OFF, flags);
+ ret = display_panel_set_dpms_state(DPMS_OFF, flags);
#ifdef ENABLE_PM_LOG
pm_history_save(PM_LOG_LCD_OFF, get_pm_cur_state());
if ((dpms_get_cached_state() == DPMS_ON) || force) {
_I("LCD standby");
- ret = bl_onoff(DPMS_STANDBY, 0);
+ ret = display_panel_set_dpms_state(DPMS_STANDBY, 0);
}
return ret;
*/
#include "shared/log.h"
-#include "display-panel.h"
+#include "power/power-suspend.h"
#include "display.h"
+#include "display-dpms.h"
+#include "display-panel.h"
#define MAX_WHITE_BALANCE_GAIN 2047
#define MAX_WHITE_BALANCE_OFFSET 2047
#define DEFAULT_WHITE_BALANCE_GAIN 1024
#define DEFAULT_WHITE_BALANCE_OFFSET 0
+/* 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)
+{
+ dpms_set_state(dpms_on);
+
+#ifdef ENABLE_PM_LOG
+ if (dpms_on == DPMS_ON)
+ pm_history_save(PM_LOG_LCD_ON_COMPLETE, get_pm_cur_state());
+ else if (dpms_on == DPMS_OFF || dpms_on == DPMS_FORCE_OFF)
+ pm_history_save(PM_LOG_LCD_OFF_COMPLETE, get_pm_cur_state());
+ else
+ pm_history_save(PM_LOG_LCD_CONTROL_FAIL, dpms_on);
+#endif
+
+ return 0;
+}
+
int display_panel_set_white_balance(enum hal_display_white_balance white_balance_type,
int value)
{
#include <hal/device/hal-display.h>
+#include "shared/devices.h"
+
+int display_panel_set_dpms_state(int dpms_on, enum device_flags flags);
int display_panel_set_white_balance(enum hal_display_white_balance white_balance_type, int value);
int display_panel_get_white_balance(enum hal_display_white_balance white_balance_type, int* out_val);