From 66b486b87b040e2b01c3d2e7c143b69684ef1154 Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Tue, 11 Jul 2023 19:23:49 +0900 Subject: [PATCH] display: Remove unncessary display_backlight_get_brightness_by_plugin_profile() As display functions are relocated and refactored, this function became unnecessary. Change-Id: Id0ef55c6f116bc8cba3db97c4487c6e67cbeee5c Signed-off-by: Yunhee Seo --- plugins/wearable/display/auto-brightness-sensorhub.c | 4 ++-- plugins/wearable/display/auto-brightness.c | 2 +- plugins/wearable/display/device-interface.c | 2 +- plugins/wearable/display/lbm.c | 2 +- src/display/display-backlight.c | 18 +++++------------- src/display/display-backlight.h | 1 - src/display/display-dbus.c | 4 ++-- 7 files changed, 12 insertions(+), 21 deletions(-) diff --git a/plugins/wearable/display/auto-brightness-sensorhub.c b/plugins/wearable/display/auto-brightness-sensorhub.c index df03e94..321c32e 100644 --- a/plugins/wearable/display/auto-brightness-sensorhub.c +++ b/plugins/wearable/display/auto-brightness-sensorhub.c @@ -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(¤t_brightness); + display_backlight_get_brightness(¤t_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(¤t_brightness); + display_backlight_get_brightness(¤t_brightness); if (request == BR_LBM_ON) { if (!get_lbm_setting()) diff --git a/plugins/wearable/display/auto-brightness.c b/plugins/wearable/display/auto-brightness.c index 0f99182..58ebec4 100644 --- a/plugins/wearable/display/auto-brightness.c +++ b/plugins/wearable/display/auto-brightness.c @@ -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; diff --git a/plugins/wearable/display/device-interface.c b/plugins/wearable/display/device-interface.c index d9c404f..3fa8e72 100644 --- a/plugins/wearable/display/device-interface.c +++ b/plugins/wearable/display/device-interface.c @@ -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; diff --git a/plugins/wearable/display/lbm.c b/plugins/wearable/display/lbm.c index f94f72e..eea8f65 100644 --- a/plugins/wearable/display/lbm.c +++ b/plugins/wearable/display/lbm.c @@ -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); diff --git a/src/display/display-backlight.c b/src/display/display-backlight.c index 67bad0d..6146300 100644 --- a/src/display/display-backlight.c +++ b/src/display/display-backlight.c @@ -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; diff --git a/src/display/display-backlight.h b/src/display/display-backlight.h index 7d35d19..ecf17e6 100644 --- a/src/display/display-backlight.h +++ b/src/display/display-backlight.h @@ -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); diff --git a/src/display/display-dbus.c b/src/display/display-dbus.c index de51880..8f37f24 100644 --- a/src/display/display-dbus.c +++ b/src/display/display-dbus.c @@ -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; -- 2.7.4