display: Move plugin display_dimstay_check() to core 34/290234/6
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 21 Mar 2023 07:38:50 +0000 (16:38 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 27 Mar 2023 04:51:06 +0000 (13:51 +0900)
The display_dimstay_check() has bee relocated:
 - plugins/*/display/device-interface.c => src/display/display.c

Change-Id: Ifd8a23ab255d091495d6de25a8d35c933b9c8b39
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot-headed/display/device-interface.c
plugins/mobile/display/device-interface.c
plugins/tv/display/device-interface.c
plugins/wearable/display/device-interface.c
src/display/display.c
src/display/display.h
src/display/plugin-common/core.h
src/display/plugin-common/device-interface.h
src/display/plugin-common/display-backlight.c

index 2a2c497..011d6ef 100644 (file)
@@ -79,17 +79,6 @@ bool display_dev_ready(void)
        return display_dev_available;
 }
 
-bool display_dimstay_check(void)
-{
-       if (get_pm_status_flag() & DIM_FLAG)
-               return true;
-
-       if ((get_pm_status_flag() & PWRSV_FLAG) && !(get_pm_status_flag() & BRTCH_FLAG))
-               return true;
-
-       return false;
-}
-
 static struct _backlight_ops backlight_ops = {
        .get_lcd_power = dpms_get_cached_state,
        .set_brightness = NULL,
index 8726b08..3e450dc 100644 (file)
@@ -78,17 +78,6 @@ bool display_dev_ready(void)
        return display_dev_available;
 }
 
-bool display_dimstay_check(void)
-{
-       if (get_pm_status_flag() & DIM_FLAG)
-               return true;
-
-       if ((get_pm_status_flag() & PWRSV_FLAG) && !(get_pm_status_flag() & BRTCH_FLAG))
-               return true;
-
-       return false;
-}
-
 static struct _backlight_ops backlight_ops = {
        .get_lcd_power = dpms_get_cached_state,
        .set_brightness = NULL,
index 10dc227..a8f98e8 100644 (file)
@@ -79,17 +79,6 @@ bool display_dev_ready(void)
        return display_dev_available;
 }
 
-bool display_dimstay_check(void)
-{
-       if (get_pm_status_flag() & DIM_FLAG)
-               return true;
-
-       if ((get_pm_status_flag() & PWRSV_FLAG) && !(get_pm_status_flag() & BRTCH_FLAG))
-               return true;
-
-       return false;
-}
-
 static struct _backlight_ops backlight_ops = {
        .get_lcd_power = dpms_get_cached_state,
        .set_brightness = NULL,
index 0054982..929be3d 100644 (file)
@@ -92,14 +92,6 @@ bool display_dev_ready(void)
        return display_dev_available;
 }
 
-bool display_dimstay_check(void)
-{
-       if (get_pm_status_flag() & DIM_FLAG)
-               return true;
-
-       return false;
-}
-
 static int set_brightness(int val)
 {
        int max, ret;
index 32dd285..9bb1789 100644 (file)
@@ -142,6 +142,19 @@ void display_unregister_dependent_device(void)
                SYS_G_LIST_REMOVE_LIST(display_dependent_device_ops, l);
 }
 
+/* FIXME: display_dimstay_check function should be changed to plugin api call.
+ *        Only the wearable profile had the first condition only, checking DIM_FLAG. */
+bool display_dimstay_check(void)
+{
+       if (pm_status_flag & DIM_FLAG)
+               return true;
+
+       if ((pm_status_flag & PWRSV_FLAG) && !(pm_status_flag & BRTCH_FLAG))
+               return true;
+
+       return false;
+}
+
 static int display_probe(void *data)
 {
        display_plugin_device_ops = find_device("display-plugin");
index c947535..3ad974a 100644 (file)
 #include <stdbool.h>
 #include "shared/devices.h"
 
+#define VCALL_FLAG             0x00000001
+#define LOWBT_FLAG             0x00000100
+#define CHRGR_FLAG             0x00000200
+#define PWRSV_FLAG             0x00000400
+#define BRTCH_FLAG             0x00002000
+#define PWROFF_FLAG            0x00004000
+#define DIMSTAY_FLAG           0x00008000
+#define DIM_FLAG               0x00010000
+#define BATTERY_FLAG           0x00020000
+#define COOLDOWN_FLAG  0x00040000
+
 enum display_init_direction_e {
        DISPLAY_INIT_DIRECTION_HORIZONTAL,
        DISPLAY_INIT_DIRECTION_VERTICAL,
@@ -43,5 +54,6 @@ 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);
+bool display_dimstay_check(void);
 
 #endif //__DISPLAY_H__
index 0d83d1a..5bd9836 100644 (file)
 #define MASK_DIM    0x2                /* 010 */
 #define MASK_OFF    0x4                /* 100 */
 
-#define VCALL_FLAG             0x00000001
-#define LOWBT_FLAG             0x00000100
-#define CHRGR_FLAG             0x00000200
-#define PWRSV_FLAG             0x00000400
-#define BRTCH_FLAG             0x00002000
-#define PWROFF_FLAG            0x00004000
-#define DIMSTAY_FLAG           0x00008000
-#define DIM_FLAG               0x00010000
-#define BATTERY_FLAG           0x00020000
-#define COOLDOWN_FLAG  0x00040000
-
 #define DEFAULT_NORMAL_TIMEOUT 30
 
 #define DIM_MASK               0x000f0000
index 6fb6581..a069429 100644 (file)
@@ -80,7 +80,6 @@ enum dpms_state {
 };
 
 bool display_dev_ready(void);
-bool display_dimstay_check(void);
 void dpms_set_running_state(int val);
 
 enum lcdon_block_state {
index c65e2bb..51fe33c 100644 (file)
@@ -320,7 +320,6 @@ int display_backlight_set_brightness_by_dim_brightness(void)
        return ret;
 }
 
-/* FIXME: display_dimstay_check function should be changed to plugin api call */
 int display_backlight_update_by_default_brightness(void)
 {
        int ret = 0;
@@ -349,7 +348,6 @@ void display_backlight_set_custom_brightness(int brightness)
        custom_brightness = brightness;
 }
 
-/* FIXME: display_dimstay_check function should be changed to plugin api call */
 int display_backlight_update_by_custom_brightness(void)
 {
        int ret = 0;