display: Remove unncessary display_backlight_get_brightness_by_plugin_profile() 35/295635/2 accepted/tizen/unified/20230714.164920 accepted/tizen/unified/riscv/20230718.003638
authorYunhee Seo <yuni.seo@samsung.com>
Tue, 11 Jul 2023 10:23:49 +0000 (19:23 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 12 Jul 2023 09:44:04 +0000 (18:44 +0900)
As display functions are relocated and refactored, this function became unnecessary.

Change-Id: Id0ef55c6f116bc8cba3db97c4487c6e67cbeee5c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
plugins/wearable/display/auto-brightness-sensorhub.c
plugins/wearable/display/auto-brightness.c
plugins/wearable/display/device-interface.c
plugins/wearable/display/lbm.c
src/display/display-backlight.c
src/display/display-backlight.h
src/display/display-dbus.c

index df03e94..321c32e 100644 (file)
@@ -97,7 +97,7 @@ void set_brightness_level(int level)
                break;
        case SPECIFIC_MODE_OFF:
                display_backlight_get_default_brightness(&default_brightness);
-               display_backlight_get_brightness_by_plugin_profile(&current_brightness);
+               display_backlight_get_brightness(&current_brightness);
 
                /* Disable HBM, LBM */
                auto_brightness_control(BR_HBM_OFF, BR_IMPLICIT);
@@ -190,7 +190,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes
        int ret;
 
        display_backlight_get_default_brightness(&default_brightness);
-       display_backlight_get_brightness_by_plugin_profile(&current_brightness);
+       display_backlight_get_brightness(&current_brightness);
 
        if (request == BR_LBM_ON) {
                if (!get_lbm_setting())
index 0f99182..58ebec4 100644 (file)
@@ -102,7 +102,7 @@ static void alc_set_brightness(int setting, int value, float light)
 
        assert(g_display_plugin.config);
 
-       ret = display_backlight_get_brightness_by_plugin_profile(&tmp_value);
+       ret = display_backlight_get_brightness(&tmp_value);
        if (ret < 0) {
                _E("Failed to get display brightness.");
                return;
index d9c404f..3fa8e72 100644 (file)
@@ -119,7 +119,7 @@ static int backlight_transit_state(int state)
 
        display_backlight_get_default_brightness(&default_brightness);
 
-       display_backlight_get_brightness_by_plugin_profile(&brt);
+       display_backlight_get_brightness(&brt);
 
        if (state == DPMS_OFF) {
                start = brt;
index f94f72e..eea8f65 100644 (file)
@@ -142,7 +142,7 @@ static void lbm_change_brightness(int start, int end, int step)
        if (display_dimstay_check())
                return;
 
-       ret = display_backlight_get_brightness_by_plugin_profile(&prev);
+       ret = display_backlight_get_brightness(&prev);
 
        if (ret < 0) {
                _E("Failed to get brightness, %d.", ret);
index 67bad0d..6146300 100644 (file)
@@ -149,7 +149,11 @@ int display_backlight_set_brightness(int brightness)
 
 int display_backlight_get_brightness(int *brightness)
 {
-       int brt, ret;
+       int brt = 0, ret = 0;
+
+       ret = display_plugin_backlight_get_brightness(brightness);
+       if (ret == 0)
+               return 0;
 
        if (!display_is_hal_backend_available()) {
                _E("There is no display device.");
@@ -175,18 +179,6 @@ int display_backlight_get_brightness(int *brightness)
        return 0;
 }
 
-/* FIXME: this function is only for wearable plugin, it should changed or removed after refactoring */
-int display_backlight_get_brightness_by_plugin_profile(int *brightness)
-{
-       int ret;
-
-       ret = display_plugin_backlight_get_brightness(brightness);
-       if (ret == 0)
-               return 0;
-
-       return display_backlight_get_brightness(brightness);
-}
-
 void display_backlight_change_brightness(int start, int end, int step)
 {
        int diff, val;
index 7d35d19..ecf17e6 100644 (file)
@@ -34,7 +34,6 @@ int display_backlight_get_normalized_brightness(int raw_brightness,
                                                int *normalized_brightness);
 int display_backlight_set_brightness(int brightness);
 int display_backlight_get_brightness(int *brightness);
-int display_backlight_get_brightness_by_plugin_profile(int *brightness);
 void display_backlight_change_brightness(int start, int end, int step);
 int display_backlight_change_brightness_by_dpms_state(enum dpms_state state);
 int display_backlight_set_default_brightness(int brightness);
index de51880..8f37f24 100644 (file)
@@ -411,7 +411,7 @@ static GVariant *dbus_getbrightness(GDBusConnection *conn,
        int brt = -1, ret, result;
 
        if (get_pm_cur_state() == S_NORMAL) {
-               ret = display_backlight_get_brightness_by_plugin_profile(&brt);
+               ret = display_backlight_get_brightness(&brt);
                if (ret < 0)
                        result = 0;
                else
@@ -607,7 +607,7 @@ static GVariant *dbus_releasebrightness(GDBusConnection *conn,
        if (ret < 0)
                _E("Failed to set vconf value for custom brightness status: %d", vconf_get_ext_errno());
 
-       ret = display_backlight_get_brightness_by_plugin_profile(&brt);
+       ret = display_backlight_get_brightness(&brt);
        if (ret < 0)
                brt = ret;