static struct timeval lcdon_tv;
static int lcd_paneloff_mode = false;
static int stay_touchscreen_off = false;
-GList *lcdon_ops;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
void lcd_on_procedure(int state, enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_on_flags();
flags |= flag;
else if (state == LCD_DIM)
set_setting_pmstate(S_LCDDIM);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->start(flags);
+ display_start_dependent_device(flags);
if (!lcdon_broadcast) {
broadcast_lcd_on(SIGNAL_POST, flags);
inline void lcd_off_procedure(enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_off_flags();
flags |= flag;
if (flags & LCD_PHASED_TRANSIT_MODE)
display_backlight_change_brightness_by_dpms_state(DPMS_OFF);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->stop(flags);
+ display_stop_dependent_device(flags);
if (flags & AMBIENT_MODE) {
broadcast_lcd_off_late(flags);
ops = find_device("display");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchkey");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchscreen");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
}
static void exit_lcd_operation(void)
{
- GList *l = NULL;
- GList *l_next = NULL;
- const struct device_ops *ops = NULL;
-
- SYS_G_LIST_FOREACH_SAFE(lcdon_ops, l, l_next, ops)
- SYS_G_LIST_REMOVE_LIST(lcdon_ops, l);
+ display_unregister_dependent_device();
}
enum {
#include "vconf.h"
#include "core.h"
#include "display-dpms.h"
-#include "display.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
static struct timeval lcdon_tv;
static int lcd_paneloff_mode = false;
static int stay_touchscreen_off = false;
-GList *lcdon_ops;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
void lcd_on_procedure(int state, enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_on_flags();
flags |= flag;
else if (state == LCD_DIM)
set_setting_pmstate(S_LCDDIM);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->start(flags);
+ display_start_dependent_device(flags);
if (!lcdon_broadcast) {
broadcast_lcd_on(SIGNAL_POST, flags);
inline void lcd_off_procedure(enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_off_flags();
flags |= flag;
if (flags & LCD_PHASED_TRANSIT_MODE)
display_backlight_change_brightness_by_dpms_state(DPMS_OFF);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->stop(flags);
+ display_stop_dependent_device(flags);
if (flags & AMBIENT_MODE) {
broadcast_lcd_off_late(flags);
ops = find_device("display");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchkey");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchscreen");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
}
static void exit_lcd_operation(void)
{
- GList *l = NULL;
- GList *l_next = NULL;
- const struct device_ops *ops = NULL;
-
- SYS_G_LIST_FOREACH_SAFE(lcdon_ops, l, l_next, ops)
- SYS_G_LIST_REMOVE_LIST(lcdon_ops, l);
+ display_unregister_dependent_device();
}
enum {
#include "vconf.h"
#include "core.h"
#include "display-dpms.h"
-#include "display.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
static struct timeval lcdon_tv;
static int lcd_paneloff_mode = false;
static int stay_touchscreen_off = false;
-GList *lcdon_ops;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
void lcd_on_procedure(int state, enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_on_flags();
flags |= flag;
else if (state == LCD_DIM)
set_setting_pmstate(S_LCDDIM);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->start(flags);
+ display_start_dependent_device(flags);
if (!lcdon_broadcast) {
broadcast_lcd_on(SIGNAL_POST, flags);
inline void lcd_off_procedure(enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_off_flags();
flags |= flag;
if (flags & LCD_PHASED_TRANSIT_MODE)
display_backlight_change_brightness_by_dpms_state(DPMS_OFF);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->stop(flags);
+ display_stop_dependent_device(flags);
if (flags & AMBIENT_MODE) {
broadcast_lcd_off_late(flags);
ops = find_device("display");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchkey");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchscreen");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
}
static void exit_lcd_operation(void)
{
- GList *l = NULL;
- GList *l_next = NULL;
- const struct device_ops *ops = NULL;
-
- SYS_G_LIST_FOREACH_SAFE(lcdon_ops, l, l_next, ops)
- SYS_G_LIST_REMOVE_LIST(lcdon_ops, l);
+ display_unregister_dependent_device();
}
enum {
#include "core.h"
#include "display-dpms.h"
#include "display-panel.h"
-#include "display.h"
#include "display-backlight.h"
#include "power/power-suspend.h"
#include "display-lock.h"
#define HBM_LEVEL 120
#include "display.h"
+#include "display-ops.h"
int prepare_level_handler(void);
void exit_level_handler(void);
static struct timeval lcdon_tv;
static int lcd_paneloff_mode = false;
static int stay_touchscreen_off = false;
-GList *lcdon_ops;
/*
* The two variables(lcdon_broadcast, pmstate_suspend) must be set initial
* state because it should be sent from previous state at booting time.
void lcd_on_procedure(int state, enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_on_flags();
flags |= flag;
int ret;
else if (state == LCD_DIM)
set_setting_pmstate(S_LCDDIM);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->start(flags);
+ display_start_dependent_device(flags);
if (!lcdon_broadcast) {
broadcast_lcd_on(SIGNAL_POST, flags);
inline void lcd_off_procedure(enum device_flags flag)
{
- GList *l = NULL;
- const struct device_ops *ops = NULL;
unsigned long flags = get_lcd_off_flags();
flags |= flag;
if (flags & LCD_PHASED_TRANSIT_MODE)
display_backlight_change_brightness_by_dpms_state(DPMS_OFF);
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->stop(flags);
+ display_stop_dependent_device(flags);
if (flags & AMBIENT_MODE) {
broadcast_lcd_off_late(flags);
ops = find_device("display");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("touchscreen");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
ops = find_device("bezel");
if (!check_default(ops))
- SYS_G_LIST_APPEND(lcdon_ops, ops);
+ display_register_dependent_device(ops);
}
static void exit_lcd_operation(void)
{
- GList *l = NULL;
- GList *l_next = NULL;
- const struct device_ops *ops = NULL;
-
- SYS_G_LIST_FOREACH_SAFE(lcdon_ops, l, l_next, ops)
- SYS_G_LIST_REMOVE_LIST(lcdon_ops, l);
+ display_unregister_dependent_device();
}
enum {
#include "vconf.h"
#include "core.h"
#include "display-dpms.h"
-#include "display.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
-#include "display-config.h"
+#include "display/display-config.h"
#include "battery-monitor.h"
#include "battery/power-supply.h"
#include "power/power-suspend.h"
* limitations under the License.
*/
+#include <libsyscommon/list.h>
#include <shared/devices.h>
+#include "display/display.h"
+#include "shared/log.h"
+
static const struct device_ops *display_plugin_device_ops;
+static int pm_cur_state;
+static int pm_old_state;
+static unsigned int pm_status_flag;
+static enum display_init_direction_e g_display_init_direction;
+static bool g_display_hal_backend_available;
+static GList *display_dependent_device_ops;
+
+inline int get_pm_cur_state(void)
+{
+ return pm_cur_state;
+}
+
+inline void set_pm_cur_state(int cur_state)
+{
+ pm_cur_state = cur_state;
+}
+
+inline int get_pm_old_state(void)
+{
+ return pm_old_state;
+}
+
+inline void set_pm_old_state(int old_state)
+{
+ pm_old_state = old_state;
+}
+
+inline unsigned int get_pm_status_flag(void)
+{
+ return pm_status_flag;
+}
+
+inline void set_pm_status_flag(unsigned int status_flag)
+{
+ pm_status_flag |= status_flag;
+}
+
+inline void clear_pm_status_flag(unsigned int status_flag)
+{
+ pm_status_flag &= ~status_flag;
+}
+
+inline enum display_init_direction_e get_display_init_direction(void)
+{
+ return g_display_init_direction;
+}
+
+inline void set_display_init_direction(enum display_init_direction_e display_init_direction)
+{
+ g_display_init_direction = display_init_direction;
+}
+
+/* FIXME: The first parameter was type enum dpms_state.
+ * After extracting display-dpms from plugin, restore its type to enum dpms_state. */
+void lcd_direct_control(int dpms_state, int flags)
+{
+ const struct device_ops *ops = NULL;
+ GList *l = NULL;
+
+ switch (dpms_state) {
+ case 0: /* FIXME: DPMS_ON */
+ SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
+ ops->start(flags);
+ break;
+ case 3: /* FIXME: DPMS_OFF */
+ SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
+ ops->stop(flags);
+ break;
+ default:
+ _E("state is wrong value %d", dpms_state);
+ break;
+ }
+}
+
+/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
+void display_set_hal_backend_available(bool display_hal_backend_available)
+{
+ g_display_hal_backend_available = display_hal_backend_available;
+}
+
+/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
+bool display_is_hal_backend_available(void)
+{
+ return g_display_hal_backend_available;
+}
+
+void display_start_dependent_device(unsigned long flags)
+{
+ const struct device_ops *ops = NULL;
+ GList *l;
+
+ SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
+ ops->start(flags);
+}
+
+void display_stop_dependent_device(unsigned long flags)
+{
+ const struct device_ops *ops = NULL;
+ GList *l;
+
+ SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
+ ops->stop(flags);
+}
+
+void display_register_dependent_device(const struct device_ops *ops)
+{
+ SYS_G_LIST_APPEND(display_dependent_device_ops, ops);
+}
+
+void display_unregister_dependent_device(void)
+{
+ GList *l = NULL;
+ GList *l_next = NULL;;
+ const struct device_ops *ops = NULL;
+
+ SYS_G_LIST_FOREACH_SAFE(display_dependent_device_ops, l, l_next, ops)
+ SYS_G_LIST_REMOVE_LIST(display_dependent_device_ops, l);
+}
static int display_probe(void *data)
{
* limitations under the License.
*/
-
#ifndef __DISPLAY_H__
#define __DISPLAY_H__
-#include <libsyscommon/ini-parser.h>
-#include "device-interface.h"
+#include <stdbool.h>
+#include "shared/devices.h"
-void lcd_direct_control(enum dpms_state state, int flags);
+enum display_init_direction_e {
+ DISPLAY_INIT_DIRECTION_HORIZONTAL,
+ DISPLAY_INIT_DIRECTION_VERTICAL,
+};
+
+void lcd_direct_control(int dpms_state, int flags); /* FIXME: The first parameter was type enum dpms_state */
int get_pm_cur_state(void);
int get_pm_old_state(void);
void set_pm_cur_state(int cur_state);
void set_display_init_direction(enum display_init_direction_e display_init_direction);
void display_set_hal_backend_available(bool display_hal_backend_available);
bool display_is_hal_backend_available(void);
+void display_start_dependent_device(unsigned long flags);
+void display_stop_dependent_device(unsigned long flags);
+void display_register_dependent_device(const struct device_ops *ops);
+void display_unregister_dependent_device(void);
-enum brightness_request_e {
- BR_MIN = 0,
- /* entering request */
- BR_LBM_ON,
- BR_HBM_ON,
- BR_HOLD_BRIGHTNESS,
- BR_LOWDIM_ON, /* low battery dim */
-
- /* exiting request */
- BR_LBM_OFF,
- BR_HBM_OFF,
- BR_RELEASE_BRIGHTNESS,
- BR_LOWDIM_OFF, /* low battery dim off */
-
- /* special */
- BR_SET_BRIGHTNESS,
-
- BR_MAX,
-};
-
-enum display_init_direction_e {
- DISPLAY_INIT_DIRECTION_HORIZONTAL,
- DISPLAY_INIT_DIRECTION_VERTICAL,
-};
-
-/* request for brightness that managed internally.
- * BR_HOLD_BRIGHTNESS and BR_SET_BRIGHTNESS does not use this implicit brightness
- * for request, but explicitly request for a brightness value */
-#define BR_IMPLICIT (-1)
-
-#endif
+#endif //__DISPLAY_H__
#include "device-interface.h"
#include "setting.h"
#include "display-dpms.h"
+#include "display.h"
#include "display-config.h"
#define WITHOUT_STARTNOTI 0x1
};
extern const struct display_keyfilter_ops *keyfilter_ops;
-extern GList *lcdon_ops;
typedef struct {
pid_t pid;
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 lcd_direct_control(enum dpms_state state, int flags);
bool touch_event_blocked(void);
void broadcast_lcd_off_late(enum device_flags flags);
void set_dim_state(bool on);
#include "dd-display.h"
#include "display-actor.h"
#include "display-ops.h"
-#include "display.h"
#include "shared/plugin.h"
#include "display-lock.h"
#include "display-panel.h"
+//#include "display/display.h"
#include "display-backlight.h"
#define AUL_APPSTATUS_PATH "/Org/Tizen/Aul/AppStatus"
#include "shared/common.h"
#include "device-interface.h"
#include "poll.h"
-#include "display.h"
+//#include "display.h"
#include "display-signal.h"
#include "lock-detector.h"
#include "display-lock.h"
#include <errno.h>
#include "shared/common.h"
#include "shared/devices.h"
-#include "display.h"
+//#include "display.h"
struct display_ops {
char *name;
#define DISPLAY_FUNC(a, b) (((a) << 16) | (b))
+enum brightness_request_e {
+ BR_MIN = 0,
+ /* entering request */
+ BR_LBM_ON,
+ BR_HBM_ON,
+ BR_HOLD_BRIGHTNESS,
+ BR_LOWDIM_ON, /* low battery dim */
+
+ /* exiting request */
+ BR_LBM_OFF,
+ BR_HBM_OFF,
+ BR_RELEASE_BRIGHTNESS,
+ BR_LOWDIM_OFF, /* low battery dim off */
+
+ /* special */
+ BR_SET_BRIGHTNESS,
+
+ BR_MAX,
+};
+
+/* request for brightness that managed internally.
+ * BR_HOLD_BRIGHTNESS and BR_SET_BRIGHTNESS does not use this implicit brightness
+ * for request, but explicitly request for a brightness value */
+#define BR_IMPLICIT (-1)
+
struct display_plugin {
void *handle;
int (*pm_lock_internal) (pid_t pid, int s_bits, int flag, int timeout);
#include "shared/log.h"
#include "power/power-suspend.h"
#include "ambient-mode.h"
-#include "display.h"
+//#include "display.h"
#include "display-backlight.h"
#include "display-dpms.h"
#include "display-panel.h"
+++ /dev/null
-/*
- * deviced
- *
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <libsyscommon/list.h>
-#include <libsyscommon/ini-parser.h>
-
-#include "util.h"
-#include "core.h"
-#include "display-dpms.h"
-#include "display-ops.h"
-#include "dd-display.h"
-#include "shared/common.h"
-
-static int pm_cur_state;
-static int pm_old_state;
-static unsigned int pm_status_flag;
-static enum display_init_direction_e g_display_init_direction;
-static bool g_display_hal_backend_available;
-
-inline int get_pm_cur_state(void)
-{
- return pm_cur_state;
-}
-
-inline void set_pm_cur_state(int cur_state)
-{
- pm_cur_state = cur_state;
-}
-
-inline int get_pm_old_state(void)
-{
- return pm_old_state;
-}
-
-inline void set_pm_old_state(int old_state)
-{
- pm_old_state = old_state;
-}
-
-inline unsigned int get_pm_status_flag(void)
-{
- return pm_status_flag;
-}
-
-inline void set_pm_status_flag(unsigned int status_flag)
-{
- pm_status_flag |= status_flag;
-}
-
-inline void clear_pm_status_flag(unsigned int status_flag)
-{
- pm_status_flag &= ~status_flag;
-}
-
-inline enum display_init_direction_e get_display_init_direction(void)
-{
- return g_display_init_direction;
-}
-
-inline void set_display_init_direction(enum display_init_direction_e display_init_direction)
-{
- g_display_init_direction = display_init_direction;
-}
-
-void lcd_direct_control(enum dpms_state state, int flags)
-{
- const struct device_ops *ops = NULL;
- GList *l = NULL;
-
- switch (state) {
- case DPMS_ON:
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->start(flags);
- break;
- case DPMS_OFF:
- SYS_G_LIST_FOREACH(lcdon_ops, l, ops)
- ops->stop(flags);
- break;
- default:
- _E("state is wrong value %d", state);
- break;
- }
-}
-
-/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
-void display_set_hal_backend_available(bool display_hal_backend_available)
-{
- g_display_hal_backend_available = display_hal_backend_available;
-}
-
-/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
-bool display_is_hal_backend_available(void)
-{
- return g_display_hal_backend_available;
-}