Youngjae Cho [Thu, 16 Jan 2025 07:20:23 +0000 (16:20 +0900)]
libcommon: Remove syscommon_proc_get_attr_current() and syscommon_proc_is_app()
The syscommon_proc_is_app() was changed to use security-manager instaed
of access directly to a smack node. However, the newly added dependency
to security-manager generated dependency cycle:
• libsyscommon → security-manager → pkgmgr → rpc-port → libstorage
→ libsyscommon
Removed the newly added dependency libsyscommon → security-manager, and
moved related function to where it has been used. Currently only the
deviced and resourced are using it.
Likewise, removed cynara-creds-pid and related function as well that
has been added recently. This is currently not a problem like
security-manager, but we realized that this libsyscommon is used by
a number of system packages so it is likely to generate unintended
cycle dependency when it gains external dependency. Therefore,
proactively removed dependency to cynara-creds-pid as well.
Change-Id: Ife78fee3601bcd3d9b0532b9935350c408891b32
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 14 Jan 2025 08:41:22 +0000 (17:41 +0900)]
spec: Fix typo of variable libsyscommon_plugin_api_update_control
The trailing '_version' was missing to the variable so added it.
Change-Id: Ie518c9f952dbf69b437377ea2edf1d3251b86d05
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 15 Jan 2025 04:42:10 +0000 (13:42 +0900)]
Remove unnecessary linker flag on libsyscommon.pc
The linker flags pulled in by the variable SYSCOMMON_LIBS caused
problem when the libsyscommon was linked to another program. The
program might have located the libsyscommon by libsyscommon.pc.
Because of this, the program might have added linker flags
unintentionally that were, in fact, dependent to the libsyscommon,
not the program itself. And this causes build error like:
ld: cannot find -lcynara-creds-pid: No such file or directory
The program didn't intend to link it to libcynara-creds-pid, and
therefore the rpmbuild would also not have installed the library.
But the linker flag -lcynara-creds-pid was pulled in by the
libsyscommon.pc, so it makes build error.
Change-Id: I81c2e4544f1c904527e4015aafb28ef0b2a659e9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 9 Jan 2025 03:22:32 +0000 (12:22 +0900)]
libcommon: Replace direct access to smack node with cynara/security-manager API
Considering no-smack environment, used API provided by cynara and
security-manager instead of direct access to the smack label node
/proc/<pid>/attr/current.
Change-Id: I6b2ce39a787726ad6c4b97fff0608ae2963f92fb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 26 Dec 2024 10:31:00 +0000 (19:31 +0900)]
plugin-api: deviced: Add attributes to manage power lock
DEVICED_POWER_ATTR_UINT64_3_CPU_LOCK
: Takes 3 parameter and controls cpulock.
- int : acquire(1) or release(1) cpulock
- pid_t: pid of requester
- int : timeout of cpulock, only effective when the first
parameter is acquire(1)
DEVICED_POWER_ATTR_INT_CPU_LOCK_COUNT
: Gets cpulock count
Change-Id: I8bc43727dfd8104b35d754865879b9a7ffa58b27
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Thu, 17 Oct 2024 03:46:42 +0000 (12:46 +0900)]
Add extern C definition to notifier.h
Although plugin-api-deviced header has extern C definition,
there was no extern C definition in the notifier header.
Thus, it was hard to implement utilizing notifier releated logic
from the C++ environment.
To support notifier usage in the C++ environment,
this is necessary.
Change-Id: I41b58beba054746dcfb21fe7cf7ed7c2193da440
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 3 Sep 2024 08:31:20 +0000 (17:31 +0900)]
display: Add lockscreen enable/disable configuration
Added a feature that enables/disables the lockscreen logic according to the profile's configuration.
Because the lockscreen is not always a necessary.
Change-Id: I9447c350577b5bafb6ab064395ec6fd77d596aa9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 3 Sep 2024 01:58:38 +0000 (10:58 +0900)]
Add new attributes and enum definition to support lcd on procedure logic
lcd on procedure needs below logics.
- power doze mode setting
- broadcast lcd on process
- setting brightness
- setting pmstate vconf
- start display devices
To support lcd on procedure, below resource attributes are added
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE2_BROADCAST_LCD_ON
- type: SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64
- setter: O
- getter: X
New attribute:
- id: DEVICED_DISPLAY_ATTR_BOOL_BROADCASTED_FLAG
- type: SYSCOMMON_RESMAN_DATA_TYPE_BOOLEAN
- setter: O
- getter: O
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_UPDATE_BRIGHTNESS
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_PM_STATE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE2_START_DEPENDENT_DEVICE
- type: SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64
- setter: O
- getter: X
New attribute:
- id: DEVICED_POWER_ATTR_INT_DOZE_MODE
- type: SYSCOMMON_RESMAN_ATTR_INT_DOZE_MODE
- setter: O
- getter: X
Below enumerations are added, also.
- enum syscommon_deviced_display_signal_type;
- enum syscommon_deviced_display_brightness_type;
- enum syscommon_deviced_display_dependent_device_type;
- enum syscommon_deviced_power_doze_mode;
To distinguish value for new attributes uages,
above enumerations are added.
Change-Id: Ia319735fa73b1ff3e4095884e23012a95a391b4f
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Tue, 3 Sep 2024 02:33:25 +0000 (11:33 +0900)]
resource-manager: Add syscommon_resman_set_resource_attr_bool()
To support set attribute boolean type,
Below function is added
- int syscommon_resman_set_resource_attr_bool(int resource_id, u_int64_t attr_id, bool data);
Also, omitted boolean data type memory allocation is added.
Because omitted code invokes create resource manager failure.
Change-Id: Ic3e9bdf621d43d09c33c38a114e402a1e1ea417b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Chanwoo Choi [Fri, 30 Aug 2024 10:30:36 +0000 (19:30 +0900)]
plugin-api: update-control: Remove unneeded blank line from plugin inteface
Change-Id: I7eabce616d40681c98efacc7af826a24ed5d91d3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Yunhee Seo [Wed, 28 Aug 2024 07:15:28 +0000 (16:15 +0900)]
Add new attributes and notifier for display setup when the dpms is initialized
When the dpms initialization is done, display state is set to DISPLAY_STATE_ON.
And then, normal state timeout counting starts.
After normal state timeout, display state can be changed to other state.
To support above description, below attributes and event is added.
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_RESET_STATE_TIMEOUT
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_PM_CURRENT_STATE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
New attribute:
- id: DEVICED_TOUCHLED_ATTR_INT_STATE_TIMEOUT
- type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_WITH_1_USER_DATA
- setter: X
- getter: O
New notifier:
- DEVICED_NOTIFIER_DISPLAY_DPMS_INIT
- When the dpms init done, that can be notified with this.
Change-Id: I3db81cf3138e94021d8b0cfedb2703fffb256ec5
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 22 Jul 2024 07:51:53 +0000 (16:51 +0900)]
tests: Remove MATCH macro and change it to strncmp
MATCH macro was used to compare two strings in wrong way.
This because when the two string are compared by strncmp,
the comparison length should be strlen + 1 of one string to avoid null string comparison case.
Thus, MATCH macro is replaced by original strncmp function.
Furthermore, using sizeof literal is more clear in terms of readability and maintenance.
Change-Id: I00272ccb12f9424177bdab3a3d33a1f97617b29c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Mon, 15 Jul 2024 11:47:57 +0000 (20:47 +0900)]
libcommon: Modify the length of strncmp parameter
When comparing two strings, it is not clear what values are contained in the case where they are obtained from an array.
Thus, using sizeof literal is more clear in terms of readability and maintenance.
This is meaningful especially when the array does not contain proper values or is empty.
Change-Id: Ic427c15767640c20a3e6aaaaa68763a66085ef64
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Mon, 24 Jun 2024 04:50:06 +0000 (13:50 +0900)]
plugin-api: deviced: Fix EOPNOTSUPP to ENOSYS
The error ENOTSUP and EOPNOTSUPP are both 95 so they cannot be
distinguished. Therefore, fixed the EOPNOTSUPP to ENOSYS.
ENOSYS 38 Function not implemented
The EOPNOTSUPP was for not implemented operations so the ENOSYS fits
into that meaning.
Change-Id: I10af2b25a848344c82c91afad3ab8ebada35c872
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 19 Jun 2024 02:33:29 +0000 (11:33 +0900)]
plugin-api: deviced: Add interface for changing display state
Change-Id: I43e1862b655695174f17be7280ac372650ae2f53
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Jun 2024 12:58:27 +0000 (21:58 +0900)]
plugin-api: deviced: Add interface for loading state info
Change-Id: Ibb30166a10ae437d580ff8e2bf10810723b27ec4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Jun 2024 11:04:14 +0000 (20:04 +0900)]
plugin-api: deviced: Add interface for controlling auto brightness
Change-Id: I187facea2f96d58b89a7365e4f450597ec5dedd1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Jun 2024 09:05:28 +0000 (18:05 +0900)]
plugin-api: deviced: Add interface for controlling display powersaving mode
Change-Id: I9f749cb7fe30bfd814de4b12c545554dee1eae2b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 17 Jun 2024 05:37:51 +0000 (14:37 +0900)]
plugin-api: deviced: Add interfaces for controlling display brightness
Change-Id: I02850dc6fe19bc3c05fde89a83a82ce4421a2c1a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Fri, 14 Jun 2024 06:26:26 +0000 (15:26 +0900)]
plugin-api: deviced: Add touchled resource type and attribute
New attribute:
- id: DEVICED_TOUCHLED_ATTR_INT_BACKLIGHT
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
To support touchled function usage from plugin-backend side,
touchled resource type is newly added.
Change-Id: I4753f35edd36bb0f276ea525818648bd43f655b9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 13 Jun 2024 10:40:16 +0000 (19:40 +0900)]
plugin-api: deviced: Add attributes for display
New attribute:
- id: DEVICED_DISPLAY_ATTR_LOCKSCREEN_BG_STATE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_LCDOFF_REASON
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_STATE_TRANSITION
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
The corresponding attributes may be changed during the
display state refactoring process.
These are necessary for plugin backend separation.
Change-Id: Iaaa53863e641e3bef401def4a0022aa14d055b96
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Thu, 13 Jun 2024 05:56:21 +0000 (14:56 +0900)]
plugin-api: deviced: Elaborate error code
Plugin api has changed to return negative error value in three ways.
1. -ENOTSUP
: Fail to load plugin backend.
2. -EOPNOTSUPP
: Successfully loaded plugin backend, but there is no implementation
of requested interface.
3. The other negative values
: Successfully loaded plugin backend, and successfully invoked
implemented interface, but the implementation itself returned
a negative value. In this case, it is strongly discouraged
that implementation returning -ENOTSUP or -EOPNOTSUPP as it
cannot be distinguished from the above two cases.
Change-Id: I754c06a813c7c4587c07bc285677fdc1a99cbc80
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 13 Jun 2024 04:48:29 +0000 (13:48 +0900)]
plugin-api: deviced: Add display on/off controlling interfaces
Change-Id: I8d5380ee9f59ed24aba92e3691098b90e2d3a497
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 10 Jun 2024 06:38:17 +0000 (15:38 +0900)]
plugin-api: deviced: Add deviced events and event name getter
DEVICED_EVENT_DEVICE_ATTACH
DEVICED_EVENT_DEVICE_DETACH
DEVICED_EVENT_DEVICE_READY
: Changes of generic device
DEVICED_EVENT_POWER_SUSPEND
DEVICED_EVENT_POWER_RESUME
DEVICED_EVENT_POWER_OFF
DEVICED_EVENT_POWER_REBOOT
DEVICED_EVENT_POWER_EXIT
: Changes of power state
DEVICED_EVENT_MISC_PROXIMITY
: Proximity sensor
DEVICED_EVENT_MISC_GESTURE
: Wrist up/down (to turn on/off screen, come from watch UI)
DEVICED_EVENT_MISC_PALM
: Palm over watch face (to turn off screen, come from watch UI)
DEVICED_EVENT_MISC_ESD
: Electrostatic discharge
Change-Id: I13e054838207c09c705249e6c93bcf4f2fcded20
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 5 Jun 2024 10:57:28 +0000 (19:57 +0900)]
plugin-api: deviced: Add attribute for lockscreen state
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_LOCKSCREEN_STATE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
Change-Id: I1e2c20c291111e24ec6209fa0ac4a377013227dc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 5 Jun 2024 07:08:15 +0000 (16:08 +0900)]
plugin-api: deviced: Add interface for detecting setting value change
The function has been added as display plugin operation
: on_changed_setting_value(int key, int value)
It is invoked when setting app changes display setting such as
screen timeout or brightness. The parameters are saying that which
'key' has changed to what 'value'.
Change-Id: Id904488c3fb393a648618d4fd30df2d283dfa6ef
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Wed, 5 Jun 2024 02:26:26 +0000 (11:26 +0900)]
plugin-api: Relocate header inclusion part
When the extern C is applied, below header file occurs build error
while building cplusplus package.
When applying extern C, it causes a type error from glib header.
There is a possibility of type conflict depending on the header file,
and there is no need to inclusion part be located under "extern C".
Change-Id: I7782da2f5d130baf6c86285e2347ccd9d0bb94e7
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Wed, 5 Jun 2024 01:20:51 +0000 (10:20 +0900)]
libsystemd: Fix wrong dlog message format
When applying dlog to libsyscommon, build error occurs
due to incorrect formatting.
To avoid build error, fix wrong message format is necessary.
Change-Id: Ib73e55d7068e4a810dedb5d59a7a78e79fdba3cc
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Fri, 31 May 2024 06:29:07 +0000 (15:29 +0900)]
resource-manager: Add syscommon_resman_get_resource_attr_bool()
To support get attribute boolean type,
syscommon_resman_get_resource_attr_bool() is added.
Change-Id: I43e25e5fa8945ac6ea4deb42fef40272a677b93c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 30 May 2024 12:45:22 +0000 (21:45 +0900)]
plugin-api: deviced: Add attribute for setting display state with option
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE2_CURRENT_STATE_WITH_OPTION
- type: SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64
- setter: O
- getter: X
- 1st param: enum deviced_event
- 2nd param: enum syscommon_deviced_display_state
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE4_LOCK_WITH_OPTION
- type: SYSCOMMON_RESMAN_DATA_TYPE_4_UINT64
- setter: O
- getter: X
- 1st param: enum deviced_event
- 2nd param: enum syscommon_deviced_display_state
- 3rd param: display state flag (Macro starts with DEVICED_DISPLAY_STATE_*)
- 4th param: timeout
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE3_UNLOCK_WITH_OPTION
- type: SYSCOMMON_RESMAN_DATA_TYPE_3_UINT64
- setter: O
- getter: X
- 1st param: enum deviced_event
- 2nd param: enum syscommon_deviced_display_state
- 3rd param: display lock flag (Macro starts with DEVICED_LOCK_*)
When the display state or display lock changing, some options are needed.
- time for locking or display state changing, triggered pid, lcd state, etc.
To support setting with options, new attributes are added.
Change-Id: Ib6a3afbbace129b7d4a02445f3899646af94c262
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 30 May 2024 07:39:12 +0000 (16:39 +0900)]
plugin-api: deviced: Add attribute for handling abnormal battery health
New attribute:
- id: DEVICED_BATTERY_ATTR_BOOL_DO_NOT_DISTURB
- type: SYSCOMMON_RESMAN_DATA_TYPE_BOOLEAN
- setter: X
- getter: O
New attribute:
- id: DEVICED_BATTERY_ATTR_INT_LOW_BATTERY_POPUP
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: X
- 1st param: enum syscommon_deviced_battery_option_type
In order to handle abnormal battery health status, above battery attributes are needed.
To support above attribute getter/setter,
enum syscommon_deviced_battery_option_type is added.
Change-Id: I4d8a66875d581feeb993b19921c5d37fb588c6a4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Yunhee Seo [Thu, 30 May 2024 06:00:34 +0000 (15:00 +0900)]
plugin-api: deviced: Add attribute for battery health status
New attribute:
- id: DEVICED_BATTERY_ATTR_INT_STATUS_HEALTH
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
New attribute:
- id: DEVICED_BATTERY_ATTR_STRING_STATUS_HEALTH
- type: SYSCOMMON_RESMAN_DATA_TYPE_STRING
- setter: X
- getter: O
To support deviced battery resource driver,
battery resource enum type is added to deviced_resource_type.
Change-Id: Ibd6ccbcc6c67cf823bd6302495ab557ffd2b6704
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Tue, 28 May 2024 02:55:21 +0000 (11:55 +0900)]
resource-manager: Fix parameter of string type setter
Change-Id: I1d6cfc4dea96730aaf6d6a69ba346300031a447c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 28 Dec 2023 04:10:00 +0000 (13:10 +0900)]
libgdbus: add dbus signal for power lock count change
Change-Id: I86fafd338625126c8c624beeeb992a71e472d63f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 14 Mar 2024 08:04:43 +0000 (17:04 +0900)]
plugin-api: common: Remove abi_version module
system-plugin-backend packcages don't need to check the ABI (Application
Binary Interface) version because libsyscommon-plugin-api and
system-plguin-backend packages have been built always together.
Change-Id: I45272586624a0449e9b86cb33a912a99a1e5dbcb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Antoni [Mon, 5 Feb 2024 13:38:38 +0000 (14:38 +0100)]
Add API for update-control plugins
Change-Id: I74dd669132ae2866902fc4644a5a40bab5c368ed
Yunhee Seo [Fri, 12 Jan 2024 06:40:32 +0000 (15:40 +0900)]
pluginapi: common: Add support RISC-V architecture type
To load plugin backend, this is necessary.
Change-Id: I467baae85265cb45a0a73c8b51a5d4afb1ada484
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Fri, 24 Nov 2023 07:11:37 +0000 (16:11 +0900)]
test: Fix mock function to call the real one
Technically, to call the real symbol open() associated with the
linker flag --wrap=open, it should be invoked via __real_open().
It is matter in some build environment. Without it, the mock function
__wrap_open() calls open(), which is call for __wrap_open() itself
recursively.
ASAN build blames it:
[ RUN ] test_sys_get_str_p1
[ ERROR ] --- No entries for symbol __wrap_open.
/home/abuild/rpmbuild/BUILD/libsyscommon-5.0.0/tests/test-mock.c:16:
error: Could not get value to mock function __wrap_open
/home/abuild/rpmbuild/BUILD/libsyscommon-5.0.0/tests/test-mock.c:35:
note: Previously returned mock value was declared here
In this case, the __wrap_open() is recursively called. Within the
recursive call, there is no more reserved value to get as it has
already been consumed up by the previous __wrap_open(), which is test
failure. Fixed open() to __real_open() in order not to recursively
call the __wrap_open() but to call the real open().
Change-Id: Ib53f13ed68f335929569ad8755e86a711a08e274
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Yunhee Seo [Tue, 17 Oct 2023 09:11:31 +0000 (18:11 +0900)]
plugin-api: deviced: Add syscommon_plugin_deviced_battery_update_health_ovp_state()
When the battery health state is changed to OVP, update_health_ovp_state is called
according to deviced battery policy.
It is moved from deviced mobile plugin to syscommon plugin api.
Change-Id: I00daa9d69c73e41d4c00ea928d9823292a648f94
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
Youngjae Cho [Fri, 13 Oct 2023 09:09:49 +0000 (18:09 +0900)]
plugin-api: deviced: Add attribute for controlling doze source
Change-Id: I5f04d68e8435954a8bed5ba6aa4026f1c76981f3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 16 Oct 2023 06:21:12 +0000 (15:21 +0900)]
resource-manager: Check associated get ops correctly
Change-Id: I2c7ae3b4b295f2fbdfe8ed60f2b1cb2a4c3a17dc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 11 Oct 2023 07:39:27 +0000 (16:39 +0900)]
plugin-api: deviced: Add header files for resource type 'core'
Resource 'core' is virtual resource type that manages core attributes
such as DEVICED_CORE_ATTR_INT_DELAYED_INIT_DONE that means whether the
system session has finished startup.
Change-Id: Ie5effc6d6362db97fe14cf12bf6f3765320c424e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 11 Oct 2023 07:15:01 +0000 (16:15 +0900)]
resource-manager: Add guard clause when removing element during list iteration
When notify callback is underway, removing element from notify list
might mess up the list iteration. Therefore, make it not to remove
list element during iteration. Instead, just mark it as removed and
postpone removal until the entire iteration is completed.
Change-Id: Iea6600be99f8499729d3268a9bd57c70ec7a714d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 6 Oct 2023 07:23:04 +0000 (16:23 +0900)]
resource-manager: Add API for fine-tuned event listening
The syscommon_resman_subscribe_resource_event() has been split into
3 variants, each of which can narrow down the range of events that
we want to listen to.
- syscommon_resman_subscribe_event(...)
: It is identical to the existing one. Listen any events from any
type of resources.
- syscommon_resman_subscribe_resource_event(resource_type, ...)
: Listen any changes of attribute from specific type of resources.
- syscommon_resman_subscribe_resource_attribute_event(resource_type,
attr_mask, ...)
: Listen change of specific attributes from specific type of resources.
In addition, the event callback has been changed to receive an additional
parameter, void *user_data.
Change-Id: I41876fa746d1d042bc1595db55d29e3b8ff13e86
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 10 Oct 2023 01:20:22 +0000 (10:20 +0900)]
tests: Rename resource-manager tests driver
Use practical device name, display, instead of logical device name,
test.
Change-Id: I2a29ccd2189b6926011353d6762ec79adba53f47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 13 Sep 2023 07:38:04 +0000 (16:38 +0900)]
resource-manager: Add API for event handling
On setting a value onto an attribute using resource-manager set API,
that setting event is broadcasted to listeners.
- typedef (*syscommon_resman_resource_event_cb) (int resource_type,
int resource_id, int attr_id, const void *data, int count)
: It receives information about attribute value that has been set
by resource-manager set API.
- syscommon_resman_subscribe_resource_event()
: It registers callback function and receives associated 'id' that
represents callback object. The callback function will be called
on calling set API to the attribute.
- syscommon_resman_unsubscribe_resource_event()
: It unregisters callback from listening. The 'id' is one that has
received from the syscommon_resman_subscribe_resource_event().
Change-Id: I38765498521968e5db0c11a5e5d9285b4a4951f2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 7 Sep 2023 12:37:59 +0000 (21:37 +0900)]
tests: Add test for resource-manager
Change-Id: Id16676523c3c503ce76593d408b1701cc3f6cc20
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 7 Sep 2023 08:03:56 +0000 (17:03 +0900)]
tests: Restructure test
Instead of building testsuite into a shared object and the main()
dlopens it, the macro
* #define TESTSUITE()
has been introduced for testsuite. It runs the testsuite and report
to the main() how many testcases have failed.
Change-Id: I6a9330601b96f7795442a85631dc666a97fe6d47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 7 Sep 2023 12:44:00 +0000 (21:44 +0900)]
resource-manager: Validate attribute before update it
Add check_attr_validate() for all NORMAL type getter, making it affect
the update_resource_attr().
Change-Id: Ic2be4c565226fa4f9a4be14118a44bd9aa5a9468
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 11 Sep 2023 05:27:30 +0000 (14:27 +0900)]
plugin-api: deviced: Remove _GET_/_SET_ from attribute name
Change-Id: I632a52421adc20411716dfd633e52f3d2e36fd8e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 6 Sep 2023 07:49:26 +0000 (16:49 +0900)]
resource-manager: Change type name of multiple data
SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64
-> SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64
SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64
-> SYSCOMMON_RESMAN_DATA_TYPE_3_UINT64
SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64_UINT64
-> SYSCOMMON_RESMAN_DATA_TYPE_4_UINT64
Change-Id: I840db7996a3c7a0dba7afaa8465489a038edaeb0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Unsung Lee [Tue, 5 Sep 2023 02:24:00 +0000 (11:24 +0900)]
plugin-api: resourced: Add lmk_try_count in get_kill_candidates_post_with_wss
resourced-lmk-governor needs to know the number of killing cycle.
This is because, the governor should know whether
memory thrasing happens or not. If lowmem state is not recovered during the
threshold cycle, then the governor skips working set size calculation and
does not give benefit to apps with effcient memory usage.
Change-Id: I4ba581d10b967665ae3155205cba9b30b0e3fa6b
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Unsung Lee [Tue, 5 Sep 2023 01:59:14 +0000 (10:59 +0900)]
plugin-api: resourced: Add working set size related info in task_info
resourced requires active, inactive, and swap memory size,
because working set size-based resourced-lmk-governor should know them
to calculate memory efficiency of each app.
Normally, this information is located in memory.stat of memcg.
In addition, some apps are free from LMK according to working set size.
Change-Id: I8d20a3be57391fb4813f42a4704dc91f43ce1101
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Unsung Lee [Tue, 5 Sep 2023 01:41:26 +0000 (10:41 +0900)]
plugin-api: resourced: Move common struct and enum from *.h to *-interface.h
Move common struct and enum, referened by both resourced and resourced backend,
from syscommon-plugin-resourced-memory-lmk.h
to syscommon-plugin-resourced-memory-lmk-interface.h for consistency.
*.h can be referenced only by resourced. On the other hand, *-interface.h can
be referenced by both side. Therefore, common struct and enum should be
defined in *-interface.h.
Change-Id: I0529e21da6688eeebb9a0583521dc69c2e400f2c
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Youngjae Cho [Wed, 6 Sep 2023 11:16:21 +0000 (20:16 +0900)]
resource-manager: Add missing cases for unset_resource_attr_interest()
Change-Id: Ibc6b4d62c3209a8826d349ae3b818c8a9c68e4f9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Unsung Lee [Mon, 4 Sep 2023 06:36:47 +0000 (15:36 +0900)]
plugin-api: resourced: Add is_cpu_busy argument into govenor func
Add is_cpu_busy argument into
syscommon_plugin_resourced_cpu_boosting_governor_govern_request() function
to check whether system cpu is busy or not.
If system cpu is not busy, then resourced cpu boosting will ignore stall event
immediately.
Function called cpu boosting governor is modified:
- int syscommon_plugin_resourced_cpu_boosting_governor_govern_request
(GHashTable *cpu_boosting_info_table,
cpu_boosting_level_e cpu_boosting_level,
GSList **cpu_boosting_controller_action, bool *is_cpu_busy);
* output argument called is_cpu_busy is added.
Change-Id: I0827f4b5ac5ffec8c64f34c124e89176e24a6c3c
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Unsung Lee [Wed, 30 Aug 2023 08:09:51 +0000 (17:09 +0900)]
plugin-api: resourced: Add is_cpu_contention_alleviated
Add is_cpu_contention_alleviated function to check whether
cpu contention is alleviated or not.
Prototype of new function is like below:
- bool syscommon_plugin_resourced_is_cpu_contention_alleviated(
guint timer_id, guint latest_timer_id);
* After a stall event is monitored, a timer with some interval set.
If no more stall events between setting timer and timeout,
timer_id is equal to latest_timer_id.
Change-Id: I0136f445827ae49d002fd8dcb0919cef0ada40b9
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Unsung Lee [Wed, 9 Aug 2023 08:17:47 +0000 (17:17 +0900)]
plugin-api: resourced: Add cpu boosting module
Add cpu boosting governor function to be called when CPU PSI is triggered
in resourced. The goal of cpu boosting governor is finding out cpu contention reason
and making actions to do in cpu boosting controller.
A new function called cpu boosting governor is added:
- int syscommon_plugin_resourced_cpu_boosting_governor_govern_request
(GHashTable *cpu_boosting_info_table,
cpu_boosting_level_e cpu_boosting_level,
GSList **cpu_boosting_controller_action);
* This function receives cpu_boosting_info_table and cpu_boosting_level
as inputs and gives cpu_boosting_controller_action as an output.
If return value of this function is not 0,
then cpu_boosting_controller_action is meaningless.
Change-Id: Id6f7854278560fd8816a2e15021cccd7261b7027
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
Youngjae Cho [Fri, 25 Aug 2023 00:57:55 +0000 (09:57 +0900)]
plugin-api: deviced: Add assert() to prevent NULL dereferencing
Change-Id: I55a46976ff30100468e249e02a769099da9fa0f3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 23 Aug 2023 08:09:44 +0000 (17:09 +0900)]
plugin-api: deviced: Add syscommon_plugin_deviced_display_load_config()
Add plugin API that loads display configuration that intialized by
plugin.
Change-Id: Ie4767a61db7dd1a222866a23f71c98b056a58607
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 23 Aug 2023 06:46:51 +0000 (15:46 +0900)]
plugin-api: deviced: Add attribute for display config
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_POWERKEY_DOUBLEPRESS
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_LONGPRESS_INTERVAL
- type: SYSCOMMON_RESMAN_DATA_TYPE_DOUBLE
- setter: X
- getter: O
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_TOUCH_WAKEUP
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
Change-Id: I841459f76e6a4a75379c53d9875006823917c570
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Tue, 22 Aug 2023 10:55:51 +0000 (19:55 +0900)]
plugin-api: common: Remove log macro from common.h to use libsyscommon/log.h
Change-Id: I4de1c0b035397d4c58a702665696bd64233d4885
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 22 Aug 2023 10:43:10 +0000 (19:43 +0900)]
plugin-api: Change the header including style and remove duplicate common.h
In order to specify the path of header file, change the header including
style as following and the remove the duplicated common.h including log
macro.
- Before header including style
#include "syscommon-plugin-common.h"
#include "syscommon-plugin-common-interface.h"
- After header including style
#include <system/syscommon-plugin-common.h>
#include <system/syscommon-plugin-common-interface.h>
Change-Id: I723114be26e7891661dcc7ac02fd7d1ceb8dc0a1
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 21 Aug 2023 10:12:32 +0000 (19:12 +0900)]
plugin-api: common: Add SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin module
Add SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY for display plugin module.
[Detailed description]
1. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin module
- module : SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY
- library_name : "/usr/lib/system/plugin/libplugin-backend-deviced-display.so"
- library_name_64bit : "/usr/lib64/system/plugin/libplugin-backend-deviced-display.so"
- symbol_name : "system_plugin_backend_deviced_display_data"
2. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_DISPLAY plugin api
- int syscommon_plugin_deviced_display_get_backend(void)
: Load deviced display plugin-backend from above library_name/library_name_64bit path
- int syscommon_plugin_deviced_display_put_backend(void);
: Unload Deviced display plugin-backend
Change-Id: I51ea96d56046d09b10d449c1455c97575837fdee
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Tue, 22 Aug 2023 07:42:02 +0000 (16:42 +0900)]
plugin-api: deviced: Add attribute for power history log
New attribute:
- id: DEVICED_POWER_ATTR_TUPLE2_SET_HISTORY_LOG
- type: DEVICED_POWER_ATTR_TUPLE2_SET_HISTORY_LOG
- setter: O
- getter: X
- 1st param: enum syscommon_deviced_power_log_type
- 2nd param: secondary information of type integer
In addition, added enum syscommon_deviced_power_log_type for the power
history log.
Change-Id: Ibdebeac6fa97bfd6705c251b694314dad11a98e6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 22 Aug 2023 02:57:32 +0000 (11:57 +0900)]
plugin-api: deviced: Add deviced_event DEVICED_EVENT_INPUT_BACKKEY
Change-Id: If05c2d43ec9230cc085465aee42dda8ab8e1b63a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 22 Aug 2023 02:32:05 +0000 (11:32 +0900)]
plugin-api: deviced: Add attribute for release all display lock
Change-Id: I988fdb0a18073a88f3a63b399f58105959c53ceb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 22 Aug 2023 02:15:23 +0000 (11:15 +0900)]
plugin-api: deviced: Add attribute for touch event blocked
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_GET_TOUCH_EVENT_BLOCKED
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
Change-Id: Idf5030debd46da3ed88851e61198ddd52cbd3e85
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 21 Aug 2023 11:51:53 +0000 (20:51 +0900)]
plugin-api: deviced: Add attribute for display actor capability
New attribute:
- id: DEVICED_DISPLAY_ATTR_UINT64_GET_ACTOR_CAPABILITY
- type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_WITH_2_USER_DATA
- setter: X
- getter: O
- 1st param: syscommon_deviced_display_actor_id
- 2nd param: syscommon_deviced_display_capability
It finds whether an actor id has an capability.
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE3_SET_ACTOR_CAPABILITY
- type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64
- setter: O
- getter: X
- 1st param: syscommon_deviced_display_actor_id
- 2nd param: syscommon_deviced_display_capability
- 3rd param: 0: reset, 1: set
It sets/resets capability of an actor id.
Change-Id: Ib63c31f10c5180b48cd677be1d6e3e11538580aa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Mon, 21 Aug 2023 09:26:29 +0000 (18:26 +0900)]
resource-manager: Gather the related funciton of set_resource_attr_uint64
Gather the related funciton of set_resource_attr_uint64 in order to
improve the readability as following:
int syscommon_resman_set_resource_attr_uint64(int resource_id, u_int64_t attr_id, u_int64_t data);
int syscommon_resman_set_resource_attr_uint64_2(int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2);
int syscommon_resman_set_resource_attr_uint64_3(int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2, u_int64_t data3);
int syscommon_resman_set_resource_attr_uint64_4(int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2, u_int64_t data3, u_int64_t data4);
Change-Id: I45e2a8736af3e1f2a397298629c50fe78acd2e1a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 21 Aug 2023 09:03:45 +0000 (18:03 +0900)]
resource-manager: Add new getter with user data
Until now, getter function has only passed the data to get the data
without any other arguments. But, it has the constraint which is not
able to pass the user data and then get the data.
So thet add new following getter funciton with passed user data:
- int syscommon_resman_get_resource_attr_uint64_with_1_user_data(
int resource_id, u_int64_t attr_id,
u_int64_t *user_data1,
u_int64_t *data);
: This function is able to pass the one user data in order to get data
from resource attirbute.
: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_WITH_1_USER_DATA data type
should be used for this new getter function.
- int syscommon_resman_get_resource_attr_uint64_with_2_user_data(
int resource_id, u_int64_t attr_id,
u_int64_t *user_data1, u_int64_t *user_data2,
u_int64_t *data);
: This function is able to pass the two user data in order to get data
from resource attirbute.
: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_WITH_2_USER_DATA data type
should be used for this new getter function.
Change-Id: Ic406fe4bad5e952472769f4ec634544a4d45d0a8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Mon, 21 Aug 2023 08:08:38 +0000 (17:08 +0900)]
plugin-api: deviced: Add power attribute and enum for vital mode
New attribute:
- id: DEVICED_POWER_ATTR_INT_GET_VITAL_MODE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: X
- getter: O
Change-Id: I8b1819d0171b0406b1eaf2b92d9e044e55408df2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 21 Aug 2023 08:28:47 +0000 (17:28 +0900)]
plugin-api: deviced: Replace macro MATCH() with strncmp()
The macro MATCH() has come from the deviced, and has been working
well as it is, currently, always built with that macro definition
within the deviced. Fix it not to be associated with the deviced
so that it is able to be built alone.
Change-Id: I21fe6f33f14ad6037592af12c6e1404f8ef128d1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Mon, 21 Aug 2023 06:49:29 +0000 (15:49 +0900)]
plugin-api: deviced: Add attribute for custom brightness
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_CUSTOM_BRIGHTNESS
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: O
It gets whether custom brightness is set or not. And it enables the
custom brightness when it sets attrbute by a value other than 0.
Change-Id: I6ba2c27f82d76933633e3322248d99fd2bc6df35
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Fri, 18 Aug 2023 12:17:33 +0000 (21:17 +0900)]
plugin-api: common: Fix wrong symbol name of SYSCOMMON_PLUGIN_MODULE_DEVICED_BATTERY
Change-Id: I810cd3cbbf6f78f3bd4d20c925912d90140c127e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 05:31:55 +0000 (14:31 +0900)]
plugin-api: common: Add SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT plugin module
Add SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT for input plugin module.
[Detailed description]
1. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT plugin module
- module : SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT
- library_name : "/usr/lib/system/plugin/libplugin-backend-deviced-input.so"
- library_name_64bit : "/usr/lib64/system/plugin/libplugin-backend-deviced-input.so"
- symbol_name : "system_plugin_backend_deviced_input_data"
2. Newly added SYSCOMMON_PLUGIN_MODULE_DEVICED_INPUT plugin api
- int syscommon_plugin_deviced_input_get_backend(void)
: Load Deviced input plugin-backend from above library_name/library_name_64bit path
- int syscommon_plugin_deviced_input_put_backend(void);
: Unload Deviced input plugin-backend
- void syscommon_plugin_deviced_input_event_cb(struct timeval time, unsigned short type,
unsigned short keycode, unsigned int keyvalue);
: Callback function to handle the key event when input key event happen
Change-Id: I0194c88da69abff226c92846637c0e000d58e019
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Fri, 18 Aug 2023 10:45:23 +0000 (19:45 +0900)]
plugin-api: deviced: Add struct syscommon_deviced_display_state_info
Change-Id: I4b9c8e605fa8c111d95fe9dbb09710d6ba2d33e9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 18 Aug 2023 10:06:47 +0000 (19:06 +0900)]
plugin-api: deviced: Add prefix 'syscommon' to enum and struct
Change-Id: Ie08a5397ef8829ef27eb3a8010d599941352e591
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 18 Aug 2023 06:44:17 +0000 (15:44 +0900)]
plugin-api: deviced: Add struct deviced_display_config
Add display configuration structure that can be accessed by both
display core and plugin. And the below enums also be added
- enum deviced_dpms_type
: Type that DPMS is working on top of.
- enum deviced_display_orientation
: Direction that display hardware is attached to.
Change-Id: I2c36f4d38ce654d80843ff21cbf1f702c3c034c9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 17 Aug 2023 12:12:59 +0000 (21:12 +0900)]
plugin-api: deviced: Add display DPMS attribute and enum
New attribute:
- id: DEVICED_DISPLAY_ATTR_INT_DPMS_STATE
- type: SYSCOMMON_RESMAN_DATA_TYPE_INT
- setter: O
- getter: O
It sets/gets DPMS value type of enum deviced_dpms_state.
New attribute:
- id: DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT
- type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64
- setter: O
- getter: X
- 1st param: enum deviced_dpms_state
- 2nd param: enum deviced_event
It bypasses display state transition routine. Instead it sets DPMS
directly.
Change-Id: I077c4066288f8e0f8856e4f78bbc6e7e1283f3e6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 10:51:40 +0000 (19:51 +0900)]
plugin-api: deviced: power: Add struct syscommon_plugin_deviced_power_trans_info
Add struct syscommon_plugin_deviced_power_trans_info which contains the
power transition information.
[Detailed description]
struct syscommon_plugin_deviced_power_trans_info
- curr : Current power state
- next : Next power state for transition
- reason : Transition reason when changing the state from curr to next
- void *data : Passed data of transition information
Change-Id: I69450db85c4303f77f7675270a4a1890e0f98bbe
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 10:44:15 +0000 (19:44 +0900)]
plugin-api: deviced: power: Add syscommon_plugin_deviced_power_convert_to_power_state()
syscommon_plugin_deviced_power_convert_to_power_state() plugin api
converts the power action string to DEVICED_POWER_STATE_* enumeration.
Change-Id: I14fb07cfa64527fceba58116977b32986c14edda
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Thu, 17 Aug 2023 11:30:14 +0000 (20:30 +0900)]
libsyscommon: Add CRITICAL_LOG()
It requires macro definition ENABLE_DLOG and CRITICAL_LOG_ON.
Change-Id: Ic25393d9c96cd24047cff33cdaf72a25cf627706
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 09:06:41 +0000 (18:06 +0900)]
dbus-iface-system: Add event dbus interface of deviced
Add new deviced dbus interface to broadcast the event id.
[Detailed description of newly added dbus information]
- DEVICED_PATH_EVENT "/Org/Tizen/System/DeviceD/Event"
- DEVICED_INTERFACE_EVENT "org.tizen.system.deviced.Event"
- DEVICED_SIGNAL_EVENT_ID "Id"
Change-Id: I5a444639b64bb47ee10f32a092b9879850c26000
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 05:44:43 +0000 (14:44 +0900)]
plugin-api: deviced: power: Add new DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK
DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK attribute provides the
setter function to acquire the wakelock in order to prevent the
suspending.
- attr id : DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK
- setter : O
- getter : X
- 1st param : Event ID
- 2nd param : Timeout to release the wakelock count
Change-Id: If0daee6ffc53838313a661feedd5b2fae45af136
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Thu, 17 Aug 2023 05:30:43 +0000 (14:30 +0900)]
plugin-api: deviced: Add enum deviced_notifier
Change-Id: If2b3960557996dd483d0a77f4db643a77914bd3f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Thu, 17 Aug 2023 05:11:24 +0000 (14:11 +0900)]
libsyscommon: Add common log.h to print log via dlog
All system service uses the dlog to print the logging.
So that add the common log.h file using dlog.
Change-Id: Id3f594bb5607db807f8608670f9e60839146d917
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Youngjae Cho [Wed, 16 Aug 2023 02:18:29 +0000 (11:18 +0900)]
plugin-api: deviced: Add display state set attribute
- DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE
: Attribute for setting display state. It requires two parameter,
each type of enum deviced_display_state and enum deviced_event.
The first one designates state to be changed and the latter one
specifies reason why the state change has been triggered.
When it comes to the state setter, it is necessary to reset screen
timeout of the changed state. Therefore the below values have been
added.
- DEVICED_EVENT_DISPLAY_SCREEN_TIMEOUT
: Event for screen timeout expiration
- DEVICED_DISPLAY_SCREEN_TIMEOUT_INFINITE
: Magic number for setting infinite screen timeout
Change-Id: I616a5ecd009dfb8c5aa4710ed68f2b09f5fe2981
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Thu, 10 Aug 2023 04:17:15 +0000 (13:17 +0900)]
plugin-api: deviced: Add display state get attribute
- DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE
: Reprenest the current display state. Only gettable.
Change-Id: I170f62ce68ae31c60775d1253d9e83b6f0e706ce
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 9 Aug 2023 11:27:27 +0000 (20:27 +0900)]
plugin-api: deviced: Add display state
It replaces existing enum state_t of the deviced.
- S_START => DEVICED_DISPLAY_STATE_START
- S_NORMAL => DEVICED_DISPLAY_STATE_ON
- S_LCDON => DEVICED_DISPLAY_STATE_ON
- S_LCDDIM => DEVICED_DISPLAY_STATE_DIM
- S_LCDOFF => DEVICED_DISPLAY_STATE_OFF
- S_STANDBY => removed
- S_SLEEP => DEVICED_DISPLAY_STATE_SLEEP*
- S_SUSPEND => removed
- S_POWEROFF => removed
[*] Technically, the DEVICED_DISPLAY_STATE_SLEEP cannot be a state of
display. It should be a state of power, not display. However, current
code indiscriminately uses S_SLEEP state as one of the display state.
This will be fixed to make power module exclusively handle sleep, and
the enum itself will be removed accordingly.
The other removed enums are not being used.
Change-Id: I1f22379e730311c211b36cd516a020eadd730938
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 9 Aug 2023 08:45:23 +0000 (17:45 +0900)]
resource-manager: Add convenient macro SYSCOMMON_RESOURCE_ID()
The resource-manage APIs are working on top of the resource_id. Thus
an API user must get resource_id in advance to access resource instance.
Currently resource-manager provides syscommon_resman_get_resource_id()
for this purpose, however, it gets resource_id via parameter. Therefore,
it cannot pass resource_id directly to a function parameter.
On the other hand, the convenient macro returns resource_id on success,
-1 on failure. As it returns reosurce_id, it can be used as an inline
parameter.
Change-Id: I45426096144c2a47de2554cbf2856b9f78d5b51d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 9 Aug 2023 07:39:33 +0000 (16:39 +0900)]
plugin-api: deviced: Include necessary header
Currently, the syscommon-plugin-deviced-display.h has nothing though,
those headers will be necessary for the display plugin-api. Therefore
added them in advance.
Change-Id: I5a0e20e627ca5845a52e1a47b9dc474f8759600d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Dongwoo Lee [Wed, 2 Aug 2023 05:53:23 +0000 (14:53 +0900)]
resource-manager: Fix checking attribute and control id validation
In order to prevent misbehavior during code genenration or
optimization for builtin function clzll of gcc due to undefined
operation, this fixes condition for checking attribute and control id
of resources properly.
Change-Id: Icef57b1ec27c54afdaf1ef93c94a069c4d8855be
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Youngjae Cho [Mon, 7 Aug 2023 10:34:28 +0000 (19:34 +0900)]
plugin-api: deviced: Add enum deviced_event
It replaces enum of the deviced, INTERNAL_LOCK_*, and it enumerates events
that the deviced can handle.
The events are grouped by module name. And each group can have a single
'General' event and several 'Specific' events. General event is named with
module name. Specific event have suffix to the general event, describing
what the event exactly is. For example,
- DEVICED_EVENT_BATTERY
: Representative event of battery event. Represents overall events
of battery and can be used by general battery event.
- DEVICED_EVENT_BATTERY_CAPACITY_LOW
: Specific event of battery event. Denotes battery capacity has
entered into or escaped from low status.
Change-Id: I4bd752c2d5303ff25d7a070a621fe122f7d0f0dc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 4 Aug 2023 07:28:42 +0000 (16:28 +0900)]
plugin-api: deviced: Add display max brightness attributes
- DEVICED_DISPLAY_ATTR_INT_GET_MAX_BRIGHTNESS
: Represent the max brightness. Only gettable.
Change-Id: I7b599eec0a1e6a5704b826478e3030f6cf9c2ad6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 4 Aug 2023 04:49:50 +0000 (13:49 +0900)]
plugin-api: deviced: Add DEVICED_RESOURCE_TYPE_DISPLAY
Deviced service controls the Display device.
When controlling the Display device of deviced
via resman (resource-manager), DEVICED_RESOURCE_TYPE_DISPLAY will be used
to control the Display attribute.
Change-Id: Iec69c2edf2ec18ef82641bc04ca31e9b2c5aaa47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Fri, 4 Aug 2023 03:08:11 +0000 (12:08 +0900)]
resource-manager: Cleanup uninitialized object correctly
When create_resource() fails to set interest bit, a resource instance
fails to be initialized completely. At that point of failure, however,
the resource instance already has been registered to the hashtable,
g_resource_hash_table. Therefore, it is necessary to remove it from the
hashtable.
Change-Id: I26d392f6645ef9871a10de91117f69226f753638
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Chanwoo Choi [Wed, 2 Aug 2023 08:26:17 +0000 (17:26 +0900)]
resource-manager: Add N-tuple setter to pass multiple parameter
Add N-tuple setter function of resource manager to support the case
of when some attribute requires the multi paramters as setter.
[Newly added setter of resource-manager]
- int syscommon_resman_set_resource_attr_uint64_2(
int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2)
: It pass the two parameter to the specific attribute which requires
the two parameter as setter.
- int syscommon_resman_set_resource_attr_uint64_3(
int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2, u_int64_t data3)
: It pass the three parameter to the specific attribute which requires
the three parameter as setter.
- int syscommon_resman_set_resource_attr_uint64_4(
int resource_id, u_int64_t attr_id,
u_int64_t data1, u_int64_t data2, u_int64_t data3, u_int64_t data4)
: It pass the four parameter to the specific attribute which requires
the four parameter as setter.
[Newly added data type of resource manager]
- SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64
: This data type include the two of u_int64 data type
- SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64
: This data type include the three of u_int64 data type
- SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64_UINT64
: This data type include the four of u_int64 data type
Change-Id: I8c659e5a9f5447e7aecb17c71005e5fa939960e8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Wed, 2 Aug 2023 07:57:51 +0000 (16:57 +0900)]
resource-manager: Fix bug of set_resource_attr_value_data()
It must check existence of setter instead of getter.
Change-Id: I1e34647390257ba1ac0c580b35bf1934eeb10d18
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Youngjae Cho [Tue, 1 Aug 2023 08:56:28 +0000 (17:56 +0900)]
resource-manager: Fix BIT() to SYSCOMMON_BIT()
The BIT() is too general so that it is possible to collide with other
header when it is imported. Therefore, added prefix for the macro.
Change-Id: Idc999d6c09364bfc9fbc0dc93fb63c1d5eeea995
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>