display_info interface is only used in the wearable plugins.
Thus there is no reason why display_info should exist in all display plugins.
Furthermore, it is hard to figure out above interface usage and role.
Delete display_info to eliminate the dependence between core and display plugins.
During refactoring, the wearable plugin codes must be cleaned up later.
Change-Id: I3caa44fb213cd70416435b02214f0bc0c26edddd
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
.display_dpms_type = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
};
-struct display_function_info display_info = {
- .update_auto_brightness = NULL,
- .set_autobrightness_min = NULL,
- .reset_autobrightness_min = NULL,
- .face_detection = NULL,
-};
-
inline const struct display_config* get_var_display_config()
{
return &display_conf;
int ignore = true;
if (decide_lcdoff() == true) {
- if (display_info.update_auto_brightness)
- display_info.update_auto_brightness(false);
switch_off_lcd();
display_lock_release_lock_all(S_NORMAL);
display_lock_release_lock_all(S_LCDDIM);
.display_dpms_type = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
};
-struct display_function_info display_info = {
- .update_auto_brightness = NULL,
- .set_autobrightness_min = NULL,
- .reset_autobrightness_min = NULL,
- .face_detection = NULL,
-};
-
inline const struct display_config* get_var_display_config()
{
return &display_conf;
int ignore = true;
if (decide_lcdoff() == true) {
- if (display_info.update_auto_brightness)
- display_info.update_auto_brightness(false);
switch_off_lcd();
display_lock_release_lock_all(S_NORMAL);
display_lock_release_lock_all(S_LCDDIM);
.display_dpms_type = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
};
-struct display_function_info display_info = {
- .update_auto_brightness = NULL,
- .set_autobrightness_min = NULL,
- .reset_autobrightness_min = NULL,
- .face_detection = NULL,
-};
-
inline const struct display_config* get_var_display_config()
{
return &display_conf;
int ignore = true;
if (decide_lcdoff() == true) {
- if (display_info.update_auto_brightness)
- display_info.update_auto_brightness(false);
switch_off_lcd();
display_lock_release_lock_all(S_NORMAL);
display_lock_release_lock_all(S_LCDDIM);
#include "util.h"
#include "core.h"
#include "device-interface.h"
+#include "display-info.h"
#include "display-ops.h"
#include "display-backlight.h"
#include "display-config.h"
display_conf->brightness_change_step);
}
-static void set_brightness_level(int level)
+void set_brightness_level(int level)
{
int default_brightness;
int current_brightness;
{
int status, ret;
- display_info.set_brightness_level = set_brightness_level;
disp_plgn->auto_brightness_control = auto_brightness_control;
ret = vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &status);
#include "util.h"
#include "core.h"
#include "device-interface.h"
+#include "display-info.h"
#include "display-ops.h"
#include "display-backlight.h"
#include "display-config.h"
/* sampling timer add */
if (alc_timeout_id == 0 && !(get_pm_status_flag() & PWRSV_FLAG)) {
- display_info.update_auto_brightness(true);
+ update_auto_brightness(true);
alc_timeout_id =
g_timeout_add_seconds(g_display_plugin.config->lightsensor_interval,
_default_action = state_st(S_NORMAL)->action;
state_st(S_NORMAL)->action = alc_action;
- display_info.update_auto_brightness(true);
+ update_auto_brightness(true);
alc_timeout_id =
g_timeout_add_seconds(g_display_plugin.config->lightsensor_interval,
return G_SOURCE_REMOVE;
}
-static void update_auto_brightness(bool update)
+void update_auto_brightness(bool update)
{
if (update_timeout) {
g_source_remove(update_timeout);
static void auto_brightness_init(void *data)
{
- display_info.update_auto_brightness = update_auto_brightness;
- display_info.set_autobrightness_min = set_autobrightness_min;
- display_info.reset_autobrightness_min = reset_autobrightness_min;
+ g_display_plugin.set_autobrightness_min = set_autobrightness_min;
+ g_display_plugin.reset_autobrightness_min = reset_autobrightness_min;
register_notifier(DEVICE_NOTIFIER_LCD, lcd_changed_cb);
register_notifier(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done);
.display_dpms_type = DISPLAY_DPMS_TYPE_WINDOW_MANAGER,
};
-struct display_function_info display_info = {
- .update_auto_brightness = NULL,
- .set_autobrightness_min = NULL,
- .reset_autobrightness_min = NULL,
- .face_detection = NULL,
-};
-
inline const struct display_config *get_var_display_config()
{
return &display_conf;
#include "shared/common.h"
#include "shared/devices.h"
#include "display-actor.h"
+#include "display-info.h"
#include "display-panel.h"
#include "display-backlight.h"
#include "display-ops.h"
return G_SOURCE_REMOVE;
display_backlight_change_brightness_by_dpms_state(DPMS_ON);
- display_info.set_brightness_level(level);
+ set_brightness_level(level);
/* lcdon is completed, aod disappered */
aod_clock_displayed = false;
return g_variant_new("(i)", ret);
}
- if (display_info.set_brightness_level) {
- if (autobrt_timer) {
- g_source_remove(autobrt_timer);
- autobrt_timer = 0;
- }
+ if (autobrt_timer) {
+ g_source_remove(autobrt_timer);
+ autobrt_timer = 0;
+ }
- device_notify(DEVICE_NOTIFIER_LCD_AUTOBRT_SENSING, NULL);
-
- /* When display state changes from AOD to LCDON, brightness change
- * effect seems sluggish because of heavy load of jobs for turning on
- * display. So delay this brightness change a bit to avoid this
- * heavy loaded time and therefore make it change smoothly. */
- if (aod_clock_displayed) {
- autobrtlevel = level; /* reserve the level, defer applying */
- autobrt_timer = g_timeout_add(200, lcdon_from_aod_cb, (gpointer)(intptr_t) level);
- } else { /* S_NORMAL state or LCDON from usual OFF state, not from AOD */
- display_info.set_brightness_level(level);
- }
- } else {
- ret = -ENOTSUP;
+ device_notify(DEVICE_NOTIFIER_LCD_AUTOBRT_SENSING, NULL);
+
+ /* When display state changes from AOD to LCDON, brightness change
+ * effect seems sluggish because of heavy load of jobs for turning on
+ * display. So delay this brightness change a bit to avoid this
+ * heavy loaded time and therefore make it change smoothly. */
+ if (aod_clock_displayed) {
+ autobrtlevel = level; /* reserve the level, defer applying */
+ autobrt_timer = g_timeout_add(200, lcdon_from_aod_cb, (gpointer)(intptr_t) level);
+ } else { /* S_NORMAL state or LCDON from usual OFF state, not from AOD */
+ set_brightness_level(level);
}
return g_variant_new("(i)", ret);
if (autobrt_timer) { /* if there is reserved level, apply it */
g_source_remove(autobrt_timer);
autobrt_timer = 0;
- display_info.set_brightness_level(autobrtlevel);
+ set_brightness_level(autobrtlevel);
}
/* lcdon is completed, aod disappered */
aod_clock_displayed = false;
int timeout;
};
+void update_auto_brightness(bool update);
+void set_brightness_level(int level);
+
#endif
#include "poll.h"
#include "device-interface.h"
#include "display-actor.h"
+#include "display-info.h"
#include "display-ops.h"
#include "display-panel.h"
#include "display-backlight.h"
int ignore = true;
if (decide_lcdoff() == true) {
- if (display_info.update_auto_brightness)
- display_info.update_auto_brightness(false);
+ update_auto_brightness(false);
switch_off_lcd();
display_lock_release_lock_all(S_NORMAL);
display_lock_release_lock_all(S_LCDDIM);
*/
const struct display_config* get_var_display_config();
-/*
- * @brief Display Extension features
- */
-struct display_function_info {
- void (*update_auto_brightness)(bool);
- int (*set_autobrightness_min)(int, char *);
- GBusNameAppearedCallback reset_autobrightness_min;
- int (*face_detection)(int, int, int);
- void (*set_brightness_level)(int);
-};
-
-extern struct display_function_info display_info;
-
typedef struct {
pid_t pid;
unsigned int cond;
void (*default_saving_mode) (int onoff);
int (*is_lcdon_blocked) (void);
int (*proc_change_state) (unsigned int cond, pid_t pid);
+ int (*set_autobrightness_min) (int val, char *name);
+ void (*reset_autobrightness_min) (GDBusConnection *conn, const gchar *sender,
+ const gchar *unique_name, gpointer data);
struct display_config *config;
struct display_backlight_ops *backlight;
pid_t pid;
int id = 0;
- if (!display_info.set_autobrightness_min) {
+ if (!g_display_plugin.set_autobrightness_min) {
ret = -EIO;
goto error;
}
ret = -ESRCH;
goto error;
}
- ret = display_info.set_autobrightness_min(val, (char *)sender);
+ ret = g_display_plugin.set_autobrightness_min(val, (char *)sender);
if (ret) {
_W("fail to set autobrightness min %d, %d by %d", val, ret, pid);
goto error;
}
- if (display_info.reset_autobrightness_min) {
- id = gdbus_watch_name(sender, display_info.reset_autobrightness_min, NULL, NULL, NULL);
+ if (g_display_plugin.reset_autobrightness_min) {
+ id = gdbus_watch_name(sender, g_display_plugin.reset_autobrightness_min, NULL, NULL, NULL);
if (id <= 0) {
_E("failed to watch name %s, id %d", sender, id);
//todo: set return value