dp->display_on_by_reason = NULL;
dp->display_off_by_reason = NULL;
dp->default_saving_mode = NULL;
- dp->is_lcdon_blocked = is_lcdon_blocked;
dp->proc_change_state = NULL;
/* check display feature */
.transit_brt = NULL,
};
-/* Dummy. Do not consider detached display state */
-int is_lcdon_blocked(void)
-{
- return LCDON_BLOCK_NONE;
-}
-
void setup_display_plugin_backlight_ops(struct display_plugin *dp)
{
assert(dp);
dp->display_on_by_reason = NULL;
dp->display_off_by_reason = NULL;
dp->default_saving_mode = NULL;
- dp->is_lcdon_blocked = is_lcdon_blocked;
dp->proc_change_state = default_proc_change_state;
return 0;
.transit_brt = NULL,
};
-static int delayed_init_done(void *data)
-{
- static int done = false;
-
- if (!data)
- return done;
-
- done = *(int *)data;
-
- return done;
-}
-
-int is_lcdon_blocked(void)
-{
- /* block lcdon until booting done in silent boot mode */
- if (silent_boot && !delayed_init_done(NULL))
- return LCDON_BLOCK_DURING_SILENT_BOOT;
-
- return LCDON_BLOCK_NONE;
-}
-
void setup_display_plugin_backlight_ops(struct display_plugin *dp)
{
assert(dp);
dp->display_on_by_reason = NULL;
dp->display_off_by_reason = NULL;
dp->default_saving_mode = NULL;
- dp->is_lcdon_blocked = is_lcdon_blocked;
dp->proc_change_state = NULL;
return 0;
.transit_brt = NULL,
};
-/* Dummy. Do not consider detached display state */
-int is_lcdon_blocked(void)
-{
- return LCDON_BLOCK_NONE;
-}
-
void setup_display_plugin_backlight_ops(struct display_plugin *dp)
{
assert(dp);
#include "display-config.h"
#include "display-state-transition.h"
#include "shared/plugin.h"
+#include "plugin-util.h"
#define POWERLOCK_CONF_FILE "/etc/deviced/powerlock.conf"
dp->display_on_by_reason = display_on_by_reason;
dp->display_off_by_reason = display_off_by_reason;
dp->default_saving_mode = default_saving_mode;
- dp->is_lcdon_blocked = is_lcdon_blocked;
dp->proc_change_state = default_proc_change_state;
return 0;
#include "battery/power-supply.h"
#include "power/power-suspend.h"
#include "shared/plugin.h"
+#include "plugin-util.h"
static struct display_backlight_ops backlight_ops;
static struct battery_plugin *battery_plgn;
#include "power/power-suspend.h"
#include "display-lock.h"
#include "input/input.h"
+#include "plugin-util.h"
#ifndef KEY_SCREENLOCK
#define KEY_SCREENLOCK 0x98
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __PLUGIN_UTIL_H__
+#define __PLUGIN_UTIL_H__
+
+int is_lcdon_blocked(void);
+
+#endif /* __PLUGIN_UTIL_H__ */
LCDON_BLOCK_WHEN_DISPLAY_DETACHED,
LCDON_BLOCK_DURING_SILENT_BOOT,
};
-int is_lcdon_blocked(void);
void setup_display_plugin_backlight_ops(struct display_plugin *dp);
#endif
goto out;
}
- lcdon_blocked = display_plugin_is_lcd_on_blocked();
+ lcdon_blocked = display_is_lcdon_blocked();
if (lcdon_blocked != LCDON_BLOCK_NONE) {
if (state == LCD_NORMAL || state == LCD_DIM) {
_W("LCDON is blocked, %d.", lcdon_blocked);
g_variant_get(param, "(i)", &timeout);
- lcdon_blocked = display_plugin_is_lcd_on_blocked();
+ lcdon_blocked = display_is_lcdon_blocked();
if (lcdon_blocked != LCDON_BLOCK_NONE) {
_W("LCDON is blocked, %d.", lcdon_blocked);
return g_variant_new("(i)", -ENOTSUP);
return -EOPNOTSUPP;
}
-/** FIXME: is_lcdon_blocked() should be moved or refactored after plugin relocation
- * Also, this is temporary wrapper function. It should be removed.
- */
-int display_plugin_is_lcd_on_blocked(void)
-{
- if (g_display_plugin.is_lcdon_blocked)
- return g_display_plugin.is_lcdon_blocked();
-
- return -EOPNOTSUPP;
-}
-
int display_plugin_backlight_set_brightness(int brightness)
{
if (g_display_plugin.backlight && g_display_plugin.backlight->set_brightness)
int (*display_on_by_reason) (const char *reason, int timeout);
int (*display_off_by_reason) (const char *reason);
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,
int display_plugin_display_on_by_reason(const char *reason, int timeout);
int display_plugin_display_off_by_reason(const char *reason);
int display_plugin_set_power_save_mode_flag(int onoff);
-int display_plugin_is_lcd_on_blocked(void);
int display_plugin_backlight_set_brightness(int brightness);
int display_plugin_backlight_get_brightness(int *brightness);
if (cond < 0)
return cond;
- ret = display_plugin_is_lcd_on_blocked();
+ ret = display_is_lcdon_blocked();
if (ret != LCDON_BLOCK_NONE && (cond & display_on)) {
_W("LCDON is blocked, %d.", ret);
return -ENOTSUP;
#include "shared/log.h"
#include "power/power.h"
#include "power/power-suspend.h"
+#include "power/power-boot.h"
#include "device-interface.h"
#include "display.h"
#include "display-lock.h"
return done;
}
+int display_is_lcdon_blocked(void)
+{
+ if (silent_boot && !delayed_init_done(NULL))
+ return LCDON_BLOCK_DURING_SILENT_BOOT;
+
+ return LCDON_BLOCK_NONE;
+}
+
static void init_lcd_operation(void)
{
const struct device_ops *ops = NULL;
* In the case, display cannot be turned on at the first booting */
// wm_ready = check_wm_ready();
if (display_panel_init_dpms()) {
- if (display_plugin_is_lcd_on_blocked() != LCDON_BLOCK_NONE) {
+ if (display_is_lcdon_blocked() != LCDON_BLOCK_NONE) {
display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
} else {
display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
STAY_CUR_STATE, DELAYED_INIT_WATING_TIME);
/* Initial display state right after the booting done */
- if (display_plugin_is_lcd_on_blocked())
+ if (display_is_lcdon_blocked())
set_pm_cur_state(DEVICED_DISPLAY_STATE_OFF);
else
set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
void display_set_initial_brightness(void);
void display_set_initial_battery_flag(void);
void display_set_initial_lockscreen_status(void);
+int display_is_lcdon_blocked(void);
#endif //__DISPLAY_H__
if ((current == DEVICED_DISPLAY_STATE_ON) &&
val == VCONFKEY_IDLE_LOCK &&
display_panel_get_dpms_cached_state() != DPMS_ON &&
- display_plugin_is_lcd_on_blocked() == LCDON_BLOCK_NONE)
+ display_is_lcdon_blocked() == LCDON_BLOCK_NONE)
display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
if (current == DEVICED_DISPLAY_STATE_ON)