display: remove lbm 61/93361/1
authortaeyoung <ty317.kim@samsung.com>
Mon, 24 Oct 2016 02:10:39 +0000 (11:10 +0900)
committertaeyoung <ty317.kim@samsung.com>
Mon, 24 Oct 2016 02:10:39 +0000 (11:10 +0900)
lbm is replaced to auto-brightness operation

Change-Id: I702aef8ea2d0b0331775d4dcdd9dfbdaa6998e81
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/display/auto-brightness.c
src/display/display-wearable.conf

index 5c069b5..c7923af 100644 (file)
 #define ON_COUNT       1
 #define OFF_COUNT      1
 
-struct lbm_config {
-       int on;
-       int off;
-       int on_count;
-       int off_count;
-};
-
-struct lbm_config lbm_conf = {
-       .on             = ON_LUX,
-       .off            = OFF_LUX,
-       .on_count       = ON_COUNT,
-       .off_count      = OFF_COUNT,
-};
-
 static int (*_default_action) (int);
 static Ecore_Timer *alc_timeout_id = 0;
 static Ecore_Timer *update_timeout;
@@ -87,7 +73,6 @@ static int automatic_brt = DEFAULT_AUTOMATIC_BRT;
 static int min_brightness = PM_MIN_BRIGHTNESS;
 static char *min_brightness_name = 0;
 static int value_table[MAX_AUTOMATIC_COUNT];
-static int lbm_state = -1;
 
 static bool update_working_position(void)
 {
@@ -169,45 +154,6 @@ static void alc_set_brightness(int setting, int value, int lux)
        }
 }
 
-static bool check_lbm(int lux, int setting)
-{
-       static int on_count, off_count;
-
-       if (lux < 0)
-               return false;
-
-       if (lbm_conf.on < 0 || lbm_conf.off < 0)
-               return true;
-
-       if (lux <= lbm_conf.on && lbm_state != true) {
-               off_count = 0;
-               on_count++;
-               if (on_count >= lbm_conf.on_count || setting) {
-                       on_count = 0;
-                       lbm_state = true;
-                       _D("LBM is on");
-                       return true;
-               }
-       } else if (lux >= lbm_conf.off && lbm_state != false) {
-               on_count = 0;
-               off_count++;
-               if (off_count >= lbm_conf.off_count || setting) {
-                       off_count = 0;
-                       lbm_state = false;
-                       _D("LBM is off");
-                       return true;
-               }
-       } else if (lux > lbm_conf.on && lux < lbm_conf.off) {
-               off_count = 0;
-               on_count = 0;
-       }
-
-       if (setting)
-               return true;
-
-       return false;
-}
-
 static bool check_brightness_changed(int value)
 {
        int i;
@@ -251,9 +197,6 @@ static bool alc_update_brt(bool setting)
                } else {
                        fault_count = 0;
 
-                       if (!check_lbm((int)light_data.values[0], setting))
-                               return EINA_TRUE;
-
                        if (display_conf.continuous_sampling &&
                            !check_brightness_changed(value) && !setting)
                                return EINA_TRUE;
@@ -442,10 +385,8 @@ static int set_autobrightness_state(int status)
        } else if (status == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
                _I("auto brightness paused!");
                disconnect_sensor();
-               lbm_state = 0;
        } else {
                disconnect_sensor();
-               lbm_state = 0;
                /* escape dim state if it's in low battery.*/
                set_brightness_changed_state();
 
@@ -647,35 +588,6 @@ static int booting_done_cb(void *data)
        return 0;
 }
 
-static int lbm_load_config(struct parse_result *result, void *user_data)
-{
-       struct lbm_config *c = user_data;
-
-       _D("%s,%s,%s", result->section, result->name, result->value);
-
-       if (!c)
-               return -EINVAL;
-
-       if (!MATCH(result->section, "LBM"))
-               return 0;
-
-       if (MATCH(result->name, "on")) {
-               SET_CONF(c->on, atoi(result->value));
-               _D("on lux is %d", c->on);
-       } else if (MATCH(result->name, "off")) {
-               SET_CONF(c->off, atoi(result->value));
-               _D("off lux is %d", c->off);
-       } else if (MATCH(result->name, "on_count")) {
-               SET_CONF(c->on_count, atoi(result->value));
-               _D("on count is %d", c->on_count);
-       } else if (MATCH(result->name, "off_count")) {
-               SET_CONF(c->off_count, atoi(result->value));
-               _D("off count is %d", c->off_count);
-       }
-
-       return 0;
-}
-
 static void exit_lsensor(void)
 {
        vconf_ignore_key_changed(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT,
@@ -695,12 +607,6 @@ static void auto_brightness_init(void *data)
        display_info.set_autobrightness_min = set_autobrightness_min;
        display_info.reset_autobrightness_min = reset_autobrightness_min;
 
-       /* load configutation */
-       ret = config_parse(BOARD_CONF_FILE, lbm_load_config, &lbm_conf);
-       if (ret < 0)
-               _W("Failed to load %s, %d Use default value!",
-                   BOARD_CONF_FILE, ret);
-
        register_notifier(DEVICE_NOTIFIER_LCD, lcd_changed_cb);
        register_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done_cb);
 }
index bbdbdff..237c2a0 100644 (file)
@@ -35,11 +35,3 @@ AccelSensorOn=no             # yes or no
 
 # Use Continuous Sampling when autobrightness is on.
 ContinuousSampling=no          # yes or no
-
-[LBM]
-# Low brightness
-on=10
-off=30
-on_count=3
-off_count=2
-