display: Replace display_config to the libsyscommon one 39/297439/1
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 18 Aug 2023 06:48:58 +0000 (15:48 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Fri, 18 Aug 2023 07:29:13 +0000 (16:29 +0900)
The enums that had been used by display_config are also replaced
with that of the libsyscommon.
 - enum display_dpms_type -> enum deviced_dpms_type
 - enum display_init_direction_e -> enum deviced_display_orientation

Change-Id: I8995957bfdfba74b65b4bf16d8e8225104ab6315
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 files changed:
plugins/iot-headed/display/core.c
plugins/iot-headed/display/device-interface.c
plugins/iot-headed/display/key-filter.c
plugins/mobile/display/core.c
plugins/mobile/display/device-interface.c
plugins/mobile/display/key-filter.c
plugins/tv/display/core.c
plugins/tv/display/device-interface.c
plugins/tv/display/key-filter.c
plugins/wearable/display/auto-brightness-sensorhub.c
plugins/wearable/display/core.c
plugins/wearable/display/device-interface.c
plugins/wearable/display/key-filter.c
src/display/core.h
src/display/display-config.c
src/display/display-config.h
src/display/display-dbus.c
src/display/display-dpms.c
src/display/display-dpms.h
src/display/display-plugin.h
src/display/display.c
src/display/display.h

index 1eb55c52ad524ca65aa2443aba9ab7d5fbe213fa..9d53210d91190d259b5a49bb3ea2164cec644267 100644 (file)
@@ -73,7 +73,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = {
 #define CONTINUOUS_SAMPLING            1
 #define LCDOFF_TIMEOUT                 300     /* milli second */
 
-static struct display_config display_conf = {
+static struct deviced_display_config display_conf = {
        .lock_wait_time         = LOCK_SCREEN_WATING_TIME,
        .longpress_interval     = LONG_PRESS_INTERVAL,
        .lightsensor_interval   = SAMPLING_INTERVAL,
@@ -89,15 +89,15 @@ static struct display_config display_conf = {
        .continuous_sampling    = CONTINUOUS_SAMPLING,
        .timeout_enable         = true,
        .input_support          = true,
-       .display_init_direction = DISPLAY_INIT_DIRECTION_HORIZONTAL,
+       .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
        .aod_enter_level        = 40,
        .aod_tsp                = true,
        .touch_wakeup           = false,
        .display_on_usb_conn_changed = true,
-       .display_dpms_type      = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
+       .display_dpms_type      = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
 };
 
-inline const struct display_config* get_var_display_config()
+inline const struct deviced_display_config* get_var_display_config()
 {
        return &display_conf;
 }
index caa32360c1b5ef68731ea569136caeaa1ebb4083..a3e5a730ddee7ee726de0f7f87bef0355cc0a4a1 100644 (file)
@@ -36,7 +36,7 @@
 #include "device-interface.h"
 
 static struct display_backlight_ops backlight_ops;
-static const struct display_config *display_conf;
+static const struct deviced_display_config *display_conf;
 
 inline struct display_backlight_ops *get_var_backlight_ops(void)
 {
index fef3c0708a7826c462190d17fa6b2d8fc3321a9b..5f2aa30dd1c5b20ef5fb9765899baa413af3458f 100644 (file)
@@ -447,7 +447,7 @@ static int process_power_key(struct input_event *pinput)
        int ignore = true;
        static int value = KEY_RELEASED;
        unsigned int caps;
-       const struct display_config *display_conf = get_var_display_config();
+       const struct deviced_display_config *display_conf = get_var_display_config();
        if (!display_conf) {
                _E("Failed to get display configuration variable.");
                return ignore;
index 8cfbaf2c752b957f18d2cb16b809ea9ee8a1f469..6638b9d0b224956c73df0f3a45c9503514662b53 100644 (file)
@@ -40,6 +40,7 @@
 #include <vconf-keys.h>
 #include <sys/time.h>
 #include <libsyscommon/list.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
 #include <hal/device/hal-device-power.h>
 
 #include <libsyscommon/log.h>
@@ -101,7 +102,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = {
 #define CONTINUOUS_SAMPLING            1
 #define LCDOFF_TIMEOUT                 300     /* milli second */
 
-static struct display_config display_conf = {
+static struct deviced_display_config display_conf = {
        .lock_wait_time         = LOCK_SCREEN_WATING_TIME,
        .longpress_interval     = LONG_PRESS_INTERVAL,
        .lightsensor_interval   = SAMPLING_INTERVAL,
@@ -117,15 +118,15 @@ static struct display_config display_conf = {
        .continuous_sampling    = CONTINUOUS_SAMPLING,
        .timeout_enable         = true,
        .input_support          = true,
-       .display_init_direction = DISPLAY_INIT_DIRECTION_HORIZONTAL,
+       .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
        .aod_enter_level        = 40,
        .aod_tsp                = true,
        .touch_wakeup           = false,
        .display_on_usb_conn_changed = true,
-       .display_dpms_type      = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
+       .display_dpms_type      = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
 };
 
-inline const struct display_config* get_var_display_config()
+inline const struct deviced_display_config* get_var_display_config()
 {
        return &display_conf;
 }
index 0b70680e09b015e48c234009918e0152f54d2974..feec85832b1dda189b5b1b743b85c5fb5810f6b8 100644 (file)
@@ -47,7 +47,7 @@
 #include "power/power-suspend.h"
 
 static struct display_backlight_ops backlight_ops;
-static const struct display_config *display_conf;
+static const struct deviced_display_config *display_conf;
 
 inline struct display_backlight_ops *get_var_backlight_ops(void)
 {
index 32edcdff7b7bd900b25ab6f57eb5dd7598b60017..61257a894b33cfcaba17216d275127c631c9bbf1 100644 (file)
@@ -458,7 +458,7 @@ static int process_power_key(struct input_event *pinput)
        int ignore = true;
        static int value = KEY_RELEASED;
        unsigned int caps;
-       const struct display_config *display_conf = get_var_display_config();
+       const struct deviced_display_config *display_conf = get_var_display_config();
        if (!display_conf) {
                _E("Failed to get display configuration variable.");
                return ignore;
index 7aa70c67fac87d2f605d9d0c6bf28da19a173136..8dafefa44175fb548a0d6802474bf827ec4bba15 100644 (file)
@@ -41,6 +41,7 @@
 #include <sys/time.h>
 #include <libsyscommon/list.h>
 #include <libsyscommon/log.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
 #include <hal/device/hal-device-power.h>
 
 #include "ambient-mode.h"
@@ -99,7 +100,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = {
 #define CONTINUOUS_SAMPLING            1
 #define LCDOFF_TIMEOUT                 300     /* milli second */
 
-static struct display_config display_conf = {
+static struct deviced_display_config display_conf = {
        .lock_wait_time         = LOCK_SCREEN_WATING_TIME,
        .longpress_interval     = LONG_PRESS_INTERVAL,
        .lightsensor_interval   = SAMPLING_INTERVAL,
@@ -115,15 +116,15 @@ static struct display_config display_conf = {
        .continuous_sampling    = CONTINUOUS_SAMPLING,
        .timeout_enable         = true,
        .input_support          = true,
-       .display_init_direction = DISPLAY_INIT_DIRECTION_HORIZONTAL,
+       .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
        .aod_enter_level        = 40,
        .aod_tsp                = true,
        .touch_wakeup           = false,
        .display_on_usb_conn_changed = true,
-       .display_dpms_type      = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
+       .display_dpms_type      = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
 };
 
-inline const struct display_config* get_var_display_config()
+inline const struct deviced_display_config* get_var_display_config()
 {
        return &display_conf;
 }
index 19f30b5980442f745cbce98b77a46e369e4cbec7..01aeadd70985b47829b3fea7101d586a5c055e4a 100644 (file)
@@ -46,7 +46,7 @@
 #include "display-lock.h"
 
 static struct display_backlight_ops backlight_ops;
-static const struct display_config *display_conf;
+static const struct deviced_display_config *display_conf;
 
 inline struct display_backlight_ops *get_var_backlight_ops(void)
 {
index 73b42523a5411133585c269fe70d98c4102e579d..ca75646422537df1f6582886c680a0684e28dbaf 100644 (file)
@@ -439,7 +439,7 @@ static int process_power_key(struct input_event *pinput)
        int ignore = true;
        static int value = KEY_RELEASED;
        unsigned int caps;
-       const struct display_config *display_conf = get_var_display_config();
+       const struct deviced_display_config *display_conf = get_var_display_config();
        if(!display_conf) {
                _E("Failed to get display configuration variable.");
                return ignore;
index 6fc0d222b58d7732b9708c84f84674a56d4e5b67..de05a05adf30e6eaa4d6be0dfb433671611e5513 100644 (file)
@@ -48,7 +48,7 @@ static bool lbm, hbm, hold_brt, lowdim;
 
 static void change_brightness_transit(int start, int end)
 {
-       const struct display_config *display_conf = get_var_display_config();
+       const struct deviced_display_config *display_conf = get_var_display_config();
        if(!display_conf) {
                _E("Failed to get display configuration variable.");
                return ;
index 99c04097e13d996b476bcd0f080f4762a96949a1..bc96b5151f176e6063f99570c3b40de019ee7be3 100644 (file)
@@ -41,6 +41,7 @@
 #include <sys/time.h>
 #include <libsyscommon/list.h>
 #include <libsyscommon/common.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
 #include <hal/device/hal-device-power.h>
 
 #include <libsyscommon/log.h>
@@ -124,7 +125,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = {
 
 #define FORCE_RELEASE_LOCK_INTERVAL 5     /* seconds */
 
-static struct display_config display_conf = {
+static struct deviced_display_config display_conf = {
        .lock_wait_time         = LOCK_SCREEN_WATING_TIME,
        .longpress_interval     = LONG_PRESS_INTERVAL,
        .lightsensor_interval   = SAMPLING_INTERVAL,
@@ -140,15 +141,15 @@ static struct display_config display_conf = {
        .continuous_sampling    = CONTINUOUS_SAMPLING,
        .timeout_enable         = true,
        .input_support          = true,
-       .display_init_direction = DISPLAY_INIT_DIRECTION_HORIZONTAL,
+       .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
        .aod_enter_level        = 40,
        .aod_tsp                = true,
        .touch_wakeup           = false,
        .display_on_usb_conn_changed = true,
-       .display_dpms_type      = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
+       .display_dpms_type      = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
 };
 
-inline const struct display_config *get_var_display_config()
+inline const struct deviced_display_config *get_var_display_config()
 {
        return &display_conf;
 }
index 413bbd262722dc78f322819b38e6acdce62cf7eb..07cac361cf4ee4e614512d3a68e57daa54c7cc33 100644 (file)
@@ -59,7 +59,7 @@ static int aod_max_level = -1;
 static int aod_normal_level = -1;
 static int aod_min_level = -1;
 static int aod_charging_level = -1;
-static const struct display_config *display_conf;
+static const struct deviced_display_config *display_conf;
 static struct battery_status *battery = NULL;
 static struct battery_status* (*fp_get_var_battery_status)(void);
 
index fdf1080acbe9799c691b6b281ef6f26e30ddd8db..b655f298109623b978f21550fefa66ee05dc13a8 100644 (file)
@@ -419,7 +419,7 @@ static int process_power_key(struct input_event *pinput)
        int ignore = true;
        static int value = KEY_RELEASED;
        unsigned int caps;
-       const struct display_config *display_conf = get_var_display_config();
+       const struct deviced_display_config *display_conf = get_var_display_config();
        if (!display_conf) {
                _E("Failed to get display configuration variable.");
                return ignore;
index 937634ff3264cf3d342393d4f5a8a7441ab161ea..f00ef9ac12a2621b46efed91795fcad21c0394b8 100644 (file)
@@ -70,7 +70,7 @@ struct state *state_st(enum deviced_display_state state);
  * Global variables
  *   display_conf : configuration of display
  */
-const struct display_config* get_var_display_config();
+const struct deviced_display_config* get_var_display_config();
 
 typedef struct {
        pid_t pid;
index b138a8b4adeacb9a6b6587d687c910902e3ae364..874cd4de45fefb660632215668e3e2cb2614a803 100644 (file)
@@ -28,7 +28,7 @@
 
 static int display_config_parse(struct parse_result *result, void *user_data)
 {
-       struct display_config *c = user_data;
+       struct deviced_display_config *c = user_data;
 
        _D("display_load_config: section=%s name=%s value=%s", result->section, result->name, result->value);
 
@@ -93,16 +93,16 @@ static int display_config_parse(struct parse_result *result, void *user_data)
                c->display_on_usb_conn_changed = (MATCH(result->value, "yes") ? true : false);
        } else if (MATCH(result->name, "DisplayInitDirection")) {
                c->display_init_direction = (MATCH(result->value, "vertical") ? \
-               DISPLAY_INIT_DIRECTION_VERTICAL : DISPLAY_INIT_DIRECTION_HORIZONTAL);
+               DEVICED_DISPLAY_ORIENTATION_VERTICAL : DEVICED_DISPLAY_ORIENTATION_HORIZONTAL);
        } else if (MATCH(result->name, "DisplayDPMSType")) {
                c->display_dpms_type = (MATCH(result->value, "none") ? \
-               DISPLAY_DPMS_TYPE_NONE : DISPLAY_DPMS_TYPE_WINDOW_MANAGER);
+               DEVICED_DPMS_TYPE_NONE : DEVICED_DPMS_TYPE_WINDOW_MANAGER);
        }
 
        return 0;
 }
 
-int display_load_config(struct display_config *config)
+int display_load_config(struct deviced_display_config *config)
 {
        return config_parse(DISPLAY_CONF_FILE, display_config_parse, config);
 }
index be967c94df05c93bb1b61290bcb7508b3fd0d4f2..27d65b360fc23ffe3a560307b7ea6cf5bbb92a4b 100644 (file)
 #ifndef __DISPLAY_CONFIG_H__
 #define __DISPLAY_CONFIG_H__
 
-#include <stdbool.h>
-#include "display-panel.h"
+#include <system/syscommon-plugin-deviced-display-interface.h>
 
 #define DISPLAY_CONF_FILE      "/etc/deviced/display.conf"
-/*
- * @brief Configuration structure
- */
-struct display_config {
-       double lock_wait_time;
-       double longpress_interval;
-       double lightsensor_interval;
-       int lcdoff_timeout;
-       const int pm_default_brightness;
-       int brightness_change_step;
-       int lcd_always_on;
-       int dimming;
-       int framerate_app[4];
-       int control_display;
-       int powerkey_doublepress;
-       int alpm_on;
-       int accel_sensor_on;
-       int continuous_sampling;
-       int display_init_direction;
-       int aod_enter_level;
-       bool aod_tsp;
-       bool timeout_enable;
-       bool input_support;
-       bool touch_wakeup;
-       bool display_on_usb_conn_changed;
-
-       enum display_dpms_type display_dpms_type;
-};
 
-int display_load_config(struct display_config *config);
+int display_load_config(struct deviced_display_config *config);
 
 #endif //__DISPLAY_CONFIG_H__
index 4bc3c5d92f608f67a132cdd8bcbc5bc1a2d61ede..06ec586d6c61ec51b422f658225b16b42b39babd 100644 (file)
@@ -29,6 +29,7 @@
 #include <libsyscommon/libgdbus.h>
 #include <libsyscommon/proc.h>
 #include <system/syscommon-plugin-deviced-common-interface.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
 #include <device/display.h>
 #include <device/power.h>
 
@@ -1354,7 +1355,7 @@ static GVariant *dbus_getrotationangle(GDBusConnection *conn,
        int ret;
        int display_index;
        enum hal_device_display_rotation_angle angle;
-       enum display_init_direction_e init_direction;
+       enum deviced_display_orientation init_direction;
 
        g_variant_get(param, "(i)", &display_index);
        ret = hal_device_display_get_rotation_angle(display_index, &angle);
index 4c4f38a1c142d257b1c3b6ebfe00aafad3f8d91a..d04103027b33bea9dfd33def9d52c6c45f3c6d98 100644 (file)
@@ -25,6 +25,7 @@
 #include <tizen-extension-client-protocol.h>
 #include <tizen-dpms-client-protocol.h>
 #include <libsyscommon/list.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
 
 #include "core/log.h"
 #include "shared/device-notifier.h"
@@ -657,14 +658,14 @@ bool dpms_init(void)
        }
 
        switch (g_display_plugin.config->display_dpms_type) {
-       case DISPLAY_DPMS_TYPE_WINDOW_MANAGER:
+       case DEVICED_DPMS_TYPE_WINDOW_MANAGER:
                g_dpms_ops.set_state = wm_dpms_set_state;
                g_dpms_ops.get_state = wm_dpms_get_state;
                g_dpms_ops.get_cached_state = wm_dpms_get_cached_state;
                g_dpms_ops.init = wm_dpms_init;
                g_dpms_ops.exit = wm_dpms_exit;
                break;
-       case DISPLAY_DPMS_TYPE_NONE:
+       case DEVICED_DPMS_TYPE_NONE:
                g_dpms_ops.set_state = none_dpms_set_state;
                g_dpms_ops.get_state = none_dpms_get_state;
                g_dpms_ops.get_cached_state = none_dpms_get_cached_state;
index 8e1447fd199cdd89ac40d1e78b1572a929078768..99140487e2d94af8eac3e1ccff8dcd7466b93a23 100644 (file)
@@ -31,11 +31,6 @@ enum dpms_state {
        DPMS_DETACH,   /* Display detached */
 };
 
-enum display_dpms_type {
-       DISPLAY_DPMS_TYPE_NONE,
-       DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
-};
-
 void dpms_set_state(int on);
 int dpms_get_state(void);
 int dpms_get_cached_state(void);
index 7b567a565d3b180f366d9d69d5336aa29b715db7..5040bb129c06e2a870f67eecdd93628b1943ab26 100644 (file)
@@ -75,7 +75,7 @@ struct display_plugin {
        void (*reset_autobrightness_min) (GDBusConnection *conn, const gchar *sender,
                                        const gchar *unique_name, gpointer data);
 
-       struct display_config *config;
+       struct deviced_display_config *config;
        struct display_backlight_ops *backlight;
        struct state* display_states[DEVICED_DISPLAY_STATE_END];
 };
index 131a2a0bd3b1b7c956caf3d1fd141438d50d2a2a..ec42d051b4ec8d8bfa11079e0ffe4f9d310d23a3 100644 (file)
@@ -45,7 +45,7 @@
 
 static const struct device_ops *display_plugin_device_ops;
 static unsigned int pm_status_flag;
-static enum display_init_direction_e g_display_init_direction;
+static enum deviced_display_orientation g_display_init_direction;
 static bool g_display_hal_backend_available = false;
 static GList *display_dependent_device_ops;
 static enum device_ops_status display_ops_status = DEVICE_OPS_STATUS_UNINIT;
@@ -67,12 +67,12 @@ 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)
+inline enum deviced_display_orientation get_display_init_direction(void)
 {
        return g_display_init_direction;
 }
 
-inline void set_display_init_direction(enum display_init_direction_e display_init_direction)
+inline void set_display_init_direction(enum deviced_display_orientation display_init_direction)
 {
        g_display_init_direction = display_init_direction;
 }
index 697979aa4ffd8a2dbe27936c8b43f424dab07f65..011d690504dcea67b1c98f65e08382192a796ed9 100644 (file)
 #define BATTERY_FLAG           0x00020000
 #define COOLDOWN_FLAG  0x00040000
 
-enum display_init_direction_e {
-       DISPLAY_INIT_DIRECTION_HORIZONTAL,
-       DISPLAY_INIT_DIRECTION_VERTICAL,
-};
-
 void lcd_direct_control(enum dpms_state dpms_state, int flags);
 int get_pm_cur_state(void);
 int get_pm_old_state(void);
@@ -47,8 +42,8 @@ void set_pm_old_state(int old_state);
 unsigned int get_pm_status_flag(void);
 void set_pm_status_flag(unsigned int status_flag);
 void clear_pm_status_flag(unsigned int status_flag);
-enum display_init_direction_e get_display_init_direction(void);
-void set_display_init_direction(enum display_init_direction_e display_init_direction);
+enum deviced_display_orientation get_display_init_direction(void);
+void set_display_init_direction(enum deviced_display_orientation display_init_direction);
 bool display_is_hal_backend_available(void);
 void display_start_dependent_device(unsigned long flags);
 void display_stop_dependent_device(unsigned long flags);