Chanwoo Choi [Wed, 16 Feb 2022 07:51:54 +0000 (16:51 +0900)]
util: kernel: Add cpu utilization helper function
Add cpu utilization helper function as following:
[Detailed description of cpu utilization helper function]
int kernel_get_avg_cpu_util(struct cpu_util_data *avg_cpu)
: Store the average cpu utilization of all cpus to 'avg_cpu'
int kernel_get_per_cpu_util(struct cpu_util_data *cpus, int num_possible_cpus,
int *num_online_cpus);
: Store the per-cpu utilization datas to 'cpus' and store the number of
online to 'num_online_cpus'
Change-Id: I1594dc656759194ffa9468ed6eebbc159a47e5fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Wed, 16 Feb 2022 03:40:42 +0000 (12:40 +0900)]
util: kernel: Add kernel helper funtion to get number of cpu
include/util/kernel.h provides helper function to get the information
from standardy linux kernel interface. This version provdies the
function to get the number of online/possible cpu.
Change-Id: I4c5ae5d73e3250b141e5aea69231b6e850790a25
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 11 Feb 2022 02:16:24 +0000 (11:16 +0900)]
util: resouce: Print attribute name when upate fail
Change-Id: I63524d282d7083663b580dea7edbd81b57b7e8b3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 10 Feb 2022 10:13:48 +0000 (19:13 +0900)]
resource: display: Fix error when get_fps_info return null
When enlightenment doesn't draw the anything, get_fps_info of enlightenment
doesn't return the fps information with null. DISPLAY_FPS returns the 0.0
for handling this case.
And add RESOURCE_DRIVER_NO_DEVICE flag to display resource driver.
Change-Id: I4087e97f49231ab45bd1ce88a17a0cca5baf3441
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Thu, 10 Feb 2022 12:00:11 +0000 (21:00 +0900)]
util: resource: Add preprocessing before updating attributes
There are resource information to be shared between attributes, so as
to support these resources this introduces prepare_update(), the new
driver operation called before update_resource_attrs() automatically.
In order to prevent updating each resource individually, removes
get_resource_attr_*_sync() functions and prohibits calling
update_resource_attr() soley.
Change-Id: Id3c0b19c6b4a78a6c7a018d8ead7d95f2cd8f4f1
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 10 Feb 2022 11:42:14 +0000 (20:42 +0900)]
util: resource: Make resource has its own driver
Change-Id: I5355dd10289ecd51546b7db26ee769439c17a734
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Thu, 10 Feb 2022 08:14:48 +0000 (17:14 +0900)]
resource: display: Fix build error
Change-Id: I643f110698f1f623cf4a6478c03cb64306781abf
Fixes:
cc6617bc6f29 ("resource: Add display resource driver")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 8 Feb 2022 10:22:29 +0000 (19:22 +0900)]
resource: Add display resource driver
The resource-display.c provides the display information
like FPS (Frame Per Second) as the display resource driver.
This version supportsthe only DISPLAY_FPS attribute.
Change-Id: I105fb0d463e4ce55cff48ddf291f642ea5ca723d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Tue, 8 Feb 2022 10:38:52 +0000 (19:38 +0900)]
util: resource: Bypass checking device for virtual device
Change-Id: I07076a0549130d452d82e611011389bd58843d88
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 10 Feb 2022 04:06:19 +0000 (13:06 +0900)]
util: common: Add BIT operation
Change-Id: I6db6713364c702e16018bba092fbc39a344fd9d5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Mon, 7 Feb 2022 12:53:50 +0000 (21:53 +0900)]
util: resource: Add init/exit ops for resource driver
Change-Id: Ie71a2f7de493f198dc57d9daa0b939b3c9eb8e4b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Mon, 7 Feb 2022 12:41:36 +0000 (21:41 +0900)]
util: resource: Remove unnecessary passing user_data parameter
Change-Id: Ie867d19c667c3a7a273d31719161d74137d3cf84
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Tue, 8 Feb 2022 07:19:19 +0000 (16:19 +0900)]
util: gdbus: Rename gdbus-util functions by removing the specific module name
Rename gdbus-util functions by removing the specific module name
without any behavior changes.
Change-Id: I5d0265a985443a628d1265c371c444686ba7d88e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 8 Feb 2022 03:08:46 +0000 (12:08 +0900)]
util: gdbus-util: Fix memory leak issue
Change-Id: I3df1d2edbeec17f14cf87ee55065922e0362ba5f
Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Suggested-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Mon, 7 Feb 2022 05:24:56 +0000 (14:24 +0900)]
monitor: Add monitor module
This introduce the new pass module monitor which provides methods for
accessing or controlling resources in a common way. By just creating
and queuing a request, resource attributes are updated, and we can
exploit it easily. And attributes also can be filtered in order not
to take unnecessary attributes by set interest mask.
How to request resource update:
1) create resource
2) set interest attributes for resource
3) create monitor command
4) bind resource with command
5) submit command (sync or async)
6) if async) wait for done
7) get attributes values by 'get' function as following the
corresponding type
8) PTR_TYPE, STRING_TYPE, ARRAY_TYPE attributes should be call 'put'
function to release memory
Change-Id: I110e46b96691381629b8da619d3519c50e409693
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Mon, 7 Feb 2022 05:19:39 +0000 (14:19 +0900)]
monitor: internal: Add pointer attribute data type
Change-Id: Id4d711e38a036b26a8a24af3b7e92ab4177d8445
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Fri, 4 Feb 2022 07:24:35 +0000 (16:24 +0900)]
resource: Rework attribute value handling
Change-Id: I8777093c47963a84913b9f7388816cd8cd455d58
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Fri, 4 Feb 2022 04:16:20 +0000 (13:16 +0900)]
util: resource: Use internal interest_mask
Since interesting attributes might not be changed usually, it seems
better that each resource has interest_mask internally.
Change-Id: I6276dbb688ee4a3c5f68eff323bce6c5b1e967a1
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Sun, 6 Feb 2022 08:31:16 +0000 (17:31 +0900)]
pass: Add resource_device for each h/w resource
Change-Id: I1b124c8828f05103226d9d84558d45bb397cedba
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Sun, 6 Feb 2022 08:13:48 +0000 (17:13 +0900)]
util: resource: Add resource_device struct and functions
Add resource_device structure for expressing the each h/w resource
such as CPU, GPU, Memory BUS, battery and so on.
Each h/w board has the different h/w resource information
such as the number of h/w resource, name, access path and so on.
PASS daemon has already supported the configuration method to get
the h/w resource information like /hal/etc/pass/pass.json.
Each h/w resource has the unique name, resource type and resource index
because board is able to have the one more same resource like big.LITTLE
cpu cluster.
When creating the instance of struct resource, will use the struct
resource_drvier and resource_device with resource type and index argument
because the user of create_resource() cannot get the unique resource name
which depends on the specific h/w. But the user of create_resource()
can get the available count of specific resource type by get_resource_device_*().
[How to create the instance of struct resource]
1. Find resource_device with resource type and index
2. Find resource_driver with resource type
3. Create the instance of struct resource by using resouce_device/driver info.
And rename from get_resource_driver to find_resource_driver.
Change-Id: I8c2fa6c8d22dcea996a12048fcab7de21eca652d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Sun, 6 Feb 2022 08:18:27 +0000 (17:18 +0900)]
pass: rescon: Move overriable property into pass_rescon struct
The 'overriable' property is used for only rescon module.
It means that be able to move 'overriable' property from struct pass_resource
to struct pass_rescon for more capsulation.
Change-Id: Icd63b1b25fb8dcb64fd1d9fd894d2b604f10ea22
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 4 Feb 2022 04:21:17 +0000 (13:21 +0900)]
lib: tmonitor: Add libpass skeleton package for Tizen Monitor (tmonitor)
Add libpass skelegon packages which contains the shared library and
header files. Initial version just contains the Tizen Monitor's
shared library and header file. But it just defines the tmonitor
interface without any detailed implementation. It shold be implemnted.
[Newlyd Added Packages]
- libpass-1.2.0-1.aarch64.rpm
- libpass-debuginfo-1.2.0-1.aarch64.rpm
- libpass-devel-1.2.0-1.aarch64.rpm
[File Hierarchy]
└── usr
├── include
│ └── pass
│ └── tmonitor.h
├── lib
│ └── debug
│ └── usr
│ └── lib64
│ └── libpass.so.0.1.0.debug
├── lib64
│ ├── libpass.so -> libpass.so.0
│ ├── libpass.so.0 -> libpass.so.0.1.0
│ ├── libpass.so.0.1.0
│ └── pkgconfig
│ └── pass.pc
└── share
└── licenses
└── libpass
└── LICENSE
Change-Id: I28d0e07e70db80471b50e749991f375267c8a0cb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 4 Feb 2022 03:44:59 +0000 (12:44 +0900)]
pass: Move pass.pc.in into packaging and remove unused files
Move pass.pc.in into packaging directory and commit
469051e30f820
("pass: hal: Replace HAL interface with hal-api-power") has removed
the pass-hal-devel package. But, pass-hal-devel.pc.in/.manifest files
were not removed. Remove unused pass-hal-devel related files.
Change-Id: I7d568a8389c35c5d76064fbb844e76bb65a06a52
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 4 Feb 2022 03:28:08 +0000 (12:28 +0900)]
util: resource: Check data type is integer or not when getting value
Each resource_attribute has the only one data type like integer, string
and so on. When using the getter function for specific data type such as
get_resource_attr_integer(), must need to check the data type of
resource attribute.
Change-Id: I868c31011d61efe05ae8a72966db462370408977
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:31:33 +0000 (15:31 +0900)]
util: resource: Enable updating resources with interest mask
Change-Id: I0ea7b2b9bae7ad1c5291307581cbfae78004400f
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:31:21 +0000 (15:31 +0900)]
util: resource: Change resource attribute id
This do refactoring resource attribute ids can be distinguished by
bitfield operation.
Change-Id: I07da21e442f761ffc212cab4507f4d7cd48d73d5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:31:16 +0000 (15:31 +0900)]
monitor: Rename monitor.h to monitor-internal.h
Change-Id: I2a6463736ec92ba808c56d7c1cc0c2f083e4588b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:30:59 +0000 (15:30 +0900)]
util: Add lock-free queue utility
Now lock-free queue for supporting multi-thread without lock
contention will be provided.
Change-Id: I6459e397954c95831ca3b31359cb9136eb59705e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:30:50 +0000 (15:30 +0900)]
util: thread: Let thread use self-allocated memory
Make easy to use thread without concerning about memory using thread
Change-Id: I170fd0afe772f47554dca95f3f61afd6b38e2921
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:30:36 +0000 (15:30 +0900)]
util: thread: Fix to unlock mutex before doing job
Change-Id: I1af301998cdae5c92ffd249b9c61dfb9696e8677
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 3 Feb 2022 06:30:18 +0000 (15:30 +0900)]
util: thread: Fix missing preprocessor
This corrects that thread header is missing preprocessor define to prevent
including it multiple times.
Change-Id: Ic66e09df0759cbd72e03979861485fe1961b80f7
Signed-off-by: Dongwoo Lee <dwlee08@gmail.com>
Sung-hun Kim [Thu, 27 Jan 2022 08:27:30 +0000 (17:27 +0900)]
resource: Add memory resource driver
Change-Id: I74291dac952a7cba3a7c56038081215cb05b7adb
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
Sung-hun Kim [Thu, 27 Jan 2022 08:26:20 +0000 (17:26 +0900)]
util: monitor: Fix a typo
Change-Id: I98c1d0f42073c15fddf460e79701c1a0819eb862
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
Dongwoo Lee [Mon, 24 Jan 2022 12:35:42 +0000 (21:35 +0900)]
util: Add common thread utility
To support multi-thread by common utility, now three types of threads
are provided as like 'daemon', 'worker', and 'timer'.
Change-Id: Ie2ac65187cab0ce9ec41a5610fc0b99d08f9e42a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Mon, 24 Jan 2022 06:47:35 +0000 (15:47 +0900)]
util: common: Move container_of macro to common.h
Change-Id: I02fc5d60110132481719ded0d805dc88e12b9d2a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Tue, 18 Jan 2022 07:26:26 +0000 (16:26 +0900)]
resource: Add CPU/BUS/GPU resource driver
Change-Id: I3aef9258ae02f80b9bf87d438352d57a33411576
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 20 Jan 2022 09:11:26 +0000 (18:11 +0900)]
pass: resmon: Replace timer-related code with timer utility
Change-Id: I30d9f3a8cc37036bb37c350565c6ef2c58f2bdba
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 20 Jan 2022 08:14:01 +0000 (17:14 +0900)]
util: timer: Add timer management
Add internal helper functions of timer and uevent code. It will be used
on multiple point in PASS daemon.
Change-Id: Id9abc31433021eb850ad0529cc1ee6b6fcf31cab
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Tue, 18 Jan 2022 06:32:00 +0000 (15:32 +0900)]
util: resource: Add resource management
Resource Manager provides the template and then each resource
is able to make the their own resource driver under src/resource
directory. Also, each resoruce is able to have the multiple attributes
such as min frequency of CPU, max frequency of CPU, available memory of
Memory and so on. Lastly, each attribute must define the their onw data
type like integer, double, string and so on.
[Example of resource and attribue, data type]
resource A
- attribute A1 with data type
- attribute A2 with data type
resource B
- attribute B1 with data type
- attribute B2 with data type
- attribute B3 with data type
resource C
...
resource D
...
[Newly added functions for resource manager]
- Add/Remove resource driver like resource-cpu.c. resource-memory.c
void add_resource_driver(const struct resource_driver *resource_driver);
void remove_resource_driver(const struct resource_driver *resource_driver);
- Create/Delete resource instance like CPU/BUS/GPU/Battery/Memory/Proc
struct resource *create_resource(int resource_type, char *resource_name);
void delete_resource(struct resource *resource);
- Update the attribute values of each resource
int update_resource_attr(struct resource *resource, int attr_id);
int update_resource_attrs(struct resource *resource);
- Get the attribute values of specific attribute
struct resource_attribute_value *get_resource_attr_value(struct resource *resource, int attr_id);
int get_resource_attr_integer(struct resource *resource, int attr_id);
int get_resource_attr_integer_sync(struct resource *resource, int attr_id);
Change-Id: I45e7ef3e6c8138b49063dd9fc6e84dd8b9448c0a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 18 Jan 2022 08:29:17 +0000 (17:29 +0900)]
monitor: Define resource attribute id and data type
monitor.h header file defines the resource attribute id and data type
of attribute. Resource Manager provides the template and then each resource
is able to make the their own resource driver under src/resource
directory. Also, each resoruce is able to have the multiple attributes
such as min frequency of CPU, max frequency of CPU, available memory of
Memory and so on. Lastly, each attribute must define the their onw data
type like integer, double, string and so on.
Change-Id: I7c869a1db496a78f08f3e735a2319c910af4058c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 19 Jan 2022 10:03:37 +0000 (19:03 +0900)]
util: Change directgory name from include/pass to include/util
Change directory name from include/pass to include/util
because 'include/util' directory declares the utility functions.
Change-Id: Ie3dc727aac7ff4c074bea7ab5bec632685a9685e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 20 Jan 2022 07:01:14 +0000 (16:01 +0900)]
util: devices: Rename to init_devices and exit_devices
Change-Id: Id3dd8898849d0be990a36c305d1c5e1d3a80b7fa
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 19 Jan 2022 09:54:54 +0000 (18:54 +0900)]
pass: Remove unneeded header including
Change-Id: Ie7590805ce3d0b002dd1f67c7fd3dc8e85f1930d
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 12 Jan 2022 06:36:50 +0000 (15:36 +0900)]
pass: resmon: Use monitor id to identify timer instead of monitor type
Support that a pass_resource can register the multiple timers with same
monitor type. If use monitor type as ID, a pass_resource is not able
to use the one more timers with same monitor type. It is wrong
registration.
Change-Id: I8e0d24fe038039076bbd8a9cd47b3dedd54913c5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 13 Jan 2022 05:58:45 +0000 (14:58 +0900)]
pass: resmon: Remove dependency of monitor->result and monitor->ops
Remove dependency of monitor->result and monitor->ops for supporting
the basic timer functionality. If monitor->ops is NULL, pass_resmon.c
just creates the periodic timer and uevent timer.
Change-Id: I43839a1b27f961d933e40177e1b2821b8ce775f0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 10 Jan 2022 08:52:08 +0000 (17:52 +0900)]
pass: resmon: Remove dependnecy of resource type
Change-Id: I966c38bca2b52a40205b13f54db2bf5e4dc5ef49
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Mon, 24 Jan 2022 06:46:33 +0000 (15:46 +0900)]
pass: rescon: Fix missing NULL check
Change-Id: I374f3d608b055ea589d9ed1dbb4ca43d890a3fa3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Thu, 13 Jan 2022 11:57:04 +0000 (20:57 +0900)]
pass: rescon: Fix overridable property
To prevent updating not overridable resources, adds more checks for
overridable, and also set overridable as true by default.
Change-Id: I06802347ca210653dce0e04d78e4cde55df6937f
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Wed, 22 Dec 2021 03:00:38 +0000 (12:00 +0900)]
pass: Change directory name from core to util
Change directory name from core to util because 'src/core' directory
contains the util functions and then move 'src/util/main.c' to src/main.c
in order to improve the readability of PASS daemon starting point.
Change-Id: I26d421d67ff4790c82e2a1af22d208104ad136db
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Wed, 20 Oct 2021 04:19:32 +0000 (21:19 -0700)]
pass: Allow level update only for overridable resources
To prevent unoverridable state such as LimitAction of thermal, this
adds overridable property to resources. Target level of those
resources can be update only overridable is 'true'.
Change-Id: Ia8187b014c1b86fd5d3e3039046cc28c1c48a95b
Signed-off-by: Dongwoo Lee <dwlee08@gmail.com>
Dongwoo Lee [Wed, 20 Oct 2021 03:54:46 +0000 (20:54 -0700)]
pass: thermal: Add overridable property
To represent scenario overridable which means that the resource is
allowed or disallowed to be changed by other modules such as PMQoS.
Change-Id: I8871b013ff93882c8cb0656f94e1e450e864e4ac
Signed-off-by: Dongwoo Lee <dwlee08@gmail.com>
Dongwoo Lee [Mon, 13 Sep 2021 05:18:15 +0000 (14:18 +0900)]
pass: thermal: Fix to copy scenario name for thermal_data
Scenario name in thermal_data can be modified by thermal module, so
it has side-effect intruding supported scenario list. This fixes to
copy scenario instead of assigning pointer to prevent side-effect.
Change-Id: I21fde12fed6bcd72fb83a6171e1b0a6d350261bd
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Tue, 14 Sep 2021 04:22:42 +0000 (13:22 +0900)]
pass: thermal: Set a separate threshold for warning level reduction
To prevent warning level is continuously changing at the edge of the
temperature range, this adds distinct thresholds for warning level
reduction.
Change-Id: I0f0e911c1b3a6ee88fa7b26162d076f811a8ffea
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Tue, 31 Aug 2021 03:40:48 +0000 (12:40 +0900)]
pass: thermal: Determine scenario with range value
To prevent to be confused for determining scenario as following the
temperature, now it is settled with range of temperature.
Change-Id: Ic605a9b629da79129cbac8c5750316e16cc1c47e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Tue, 31 Aug 2021 11:59:30 +0000 (20:59 +0900)]
pass: Add JSON API for getting object from object
Since JSON object can have another object, now pass can parse object
from object.
Change-Id: I962fc8464e6cae895f178d19bcee095178157c08
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Mon, 30 Aug 2021 00:46:21 +0000 (09:46 +0900)]
pass: thermal: Fix build warning
Since the third agrument of strncpy means maximum permitted size of
destination, using length of source string cause warning as like
"specified bound depends on the length of the source argument". This
fixes warning to use NAME_MAX instead of source length.
Change-Id: I07399700ea454100ca0924c93eca6a99cb54b8cd
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Fri, 27 Aug 2021 07:00:25 +0000 (16:00 +0900)]
unittest: power-haltests: Restart PASS daemon when PutResource tc is failed
Even if PutResource tc is failed, need to restore the status of PASS
daemon. So that restart PASS daemon.
Change-Id: I3c4dab4f30a16660f0718bc1cd579afa15f75fbf
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 27 Aug 2021 06:35:02 +0000 (15:35 +0900)]
pass: parser: Fix uninitialized value of number_of_cpus property
If json configuraiton file doesn't contain the 'number_of_cpus'
property, number_of_cpus has the minus value. It causes the problem.
So that fix uninitialized value of number_of_cpus property when value is
out of range.
Change-Id: Ibac93e89b3cd85181287773b0bf0cf7f4aa6f692
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Dongwoo Lee [Fri, 27 Aug 2021 05:49:49 +0000 (14:49 +0900)]
pass: thermal: Fix to handle priority of initial state properly
At first, priority is intended to treat lower value as higher
priority, but it is not handled intentionally when monitoring devices.
So this fixes to handle it properly and to this end it is required to
retrieve highest priority from the corresponding thermal device.
Finally, instead of plain scenario string the notifer_data structure
is passed as THERMAL_GET_SCENARIO parameter to get both scenario and
priority.
Change-Id: I330729be2890cdcb89ee7a677af2c0b8d4905fb0
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Fri, 27 Aug 2021 05:46:45 +0000 (14:46 +0900)]
pass: thermal: Fix invalid return value
This fixes to not return value for void functions.
Change-Id: Ic341a80a69da983ffc5d76905c190957a6148632
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Fri, 20 Aug 2021 02:45:41 +0000 (11:45 +0900)]
pass: thermal: Supprot mupltiple resources for 'thermal_get_scenario'
To response 'getCoolDownStatus' dbus method call during boot, initial
scenario state should be set before thermal monitor works once. When
there are multiple resources which have thermal data, the final state
of thermal scenario should be determined theirs priority. For this,
this enables supporting multiple resources on 'thermal_get_scenario'
handler.
Change-Id: I920de0440efac9706405bcf63b0c110b407ddd60
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Mon, 9 Aug 2021 03:26:26 +0000 (12:26 +0900)]
pass: thermal: Notify scenario only when it changed
Since this, thermal monitor notify scenario when it is different with
previous on. To this end, set callback to thermal_result for notifying
scenario, and it called when the scenario is changed. And this also
enables to do different notification process for both thermal_monitor
and get_scenario handler.
Change-Id: Ib0e7cda2926f4402563b00e94125511954b2a043
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Wed, 4 Aug 2021 06:20:59 +0000 (15:20 +0900)]
pass: thermal: Set priority of thermal device through config file
Now, the priority of each thermal device is can be determined by
configuration file in pass-hal with 'thermal_priority' section.
Change-Id: I677dd719672dea43c6675ccf774e646b492914d5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Tue, 3 Aug 2021 07:44:49 +0000 (16:44 +0900)]
thermal: Support multiple thermal resources
To handle thermal scenario from multiple resources, manage the
thermal data along with its own property.
Change-Id: I933205f17dd7dc2e264fa2322b3a301b8f8e01d5
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Fri, 30 Jul 2021 07:50:28 +0000 (16:50 +0900)]
pass: thermal: Send scenario with additional information
In order to prepare the case that pass can have multiple thermal
monitors, each monitor sends additional information which includes
resource name as a key.
Change-Id: I47b9fca69c9580774ddffd065bf86e4eef09ee56
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Dongwoo Lee [Wed, 11 Aug 2021 02:15:41 +0000 (11:15 +0900)]
pass: thermal: Fix missing unregister operation
DEVICE_NOTIFIER_THERMAL is registered during probe, but it is not
unregistered during exit. So this adds missing unregister to exit.
Change-Id: I035547932abed44a255b0701f2290e3e74d7d3a3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Chanwoo Choi [Fri, 13 Aug 2021 04:23:46 +0000 (13:23 +0900)]
pass: Add support of battery charging properties
In order to control the battery charging status and charging current,
add new properties as following:
[Newly added properties for battery h/w resource]
- 'battery,charging_status' property in 'level_list' section
- 'battery,charging_current_limit' property in 'level_list' section
[Example of charging properties]
In case of scripts/pass-battery.json,
"support" : true,
"init_level" : 0,
"level_list" :
[
{
"level" : 0,
"battery,charging_status" : 0, // POWER_SUPPLY_STATUS_UNKNOWN
"battery_charging_currnt_uA" : 2048000
}, {
"level" : 1,
"battery,charging_status" : 0, // POWER_SUPPLY_STATUS_UNKNOWN
"battery_charging_currnt_uA" : 1024000
}, {
"level" : 2,
"battery,charging_status" : 3, // POWER_SUPPLY_STATUS_NOT_CHARGING
"battery_charging_currnt_uA" : 1024000
}
],
Change-Id: I5a762d3127c2b156be377846a8ab19c4e582b247
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 11 Aug 2021 10:30:37 +0000 (19:30 +0900)]
pass: Update supported module information for PASS_RESOURCE_BATTERY/NONSTANDARD_ID
Update supported module information for both new PASS_RESOURCE_BATTERY_ID type
and PASS_RESOURCE_NONSTANDARD_ID type as following:
[Updated supported module list for each h/w resource type]
1. PASS_RESOURCE_BATTERY_ID (new h/w resoruce type)
- PASS_MODULE_PARSER
- PASS_MODULE_RESCON
- PASS_MODULE_RESMON
- PASS_MODULE_PMQOS
- PASS_MODULE_THERMAL
2. PASS_RESOURCE_NONSTANDARD_ID
- PASS_MODULE_RESMON
- PASS_MODULE_PMQOS
- PASS_MODULE_THERMAL
Change-Id: I9161898b7d9b8b886081eabac3eb91db3fc8b76e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 11 Aug 2021 11:03:43 +0000 (20:03 +0900)]
pass: parser: Don't check resource type when verify pass_level
'struct pass_level' doesn't have the any dependency of h/w resource
type. So that don't check the resource type when verify pass_level.
Change-Id: Ib2aa302f6ed84e741b61e4e6b5b7db895152ba4c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 11 Aug 2021 10:57:09 +0000 (19:57 +0900)]
pass: parser: Remove unnecessary log when PMQOS module is not used
If 'pmqos_property' is false, don't need to print the state of pmqos for
each h/w resource. Remove unnecessary log when PMQOS module is not used.
Change-Id: I09eed2828aa760c57e92bd1bda449e428769983f
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 11 Aug 2021 10:29:54 +0000 (19:29 +0900)]
pass: hal: Add missing save/restore of initdata for cooling-device property
The commit
256425c1250a ("pass: Add support of cooling-device property")
added cooling-device property. But, this commit didn't add the
save/restore of initdata for cooling-device property. In order to
restore the initial value of cooling-device property after finishing
PASS daemon, add missing save/restore of initdata for cooling-device property.
Change-Id: I97317a11613bfc29851ef1eecd7b9d7b531c7578
Fixes:
256425c1250a ("pass: Add support of cooling-device property")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 9 Aug 2021 04:54:26 +0000 (13:54 +0900)]
pass: resmon: Add new power_supply uevent type to catch temperature changes
The power_supply subsystem in Linux kernel provides the temperature information
via POWER_SUPPLY_PROP_TEMP property. In order to catch the temperature changes,
add power_supply uevent subsystem type. When send power_supply uevent to
user-space from kernel space, resource monitor try to get the current
temperature for deciding the proper thermal scenario and then control the h/w
resources.
Change-Id: If5ae48885f2c5b895bf24c5f9da3193fdea85981
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 9 Aug 2021 04:18:51 +0000 (13:18 +0900)]
pass: resmon: Add support of multiple uevent subsystem type by one resource monitor
The an 'struct resmon_ops' instance has supported only one uevent subsystem type.
But, even if subsystems in linux kernel are different, sometimes treats
the same raw data like thermal. For example, both thermal and power_supply
subsystems provides the current temperature to user-space via uevent and sysfs
node. So that Add support of multiple uevent subsystem type by one resource monitor
instance.
Change-Id: I2ad7f25f1a894539ea1e460c4faeb5334acc50b5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 4 Aug 2021 08:56:27 +0000 (17:56 +0900)]
pass: parser: Add missing code for PASS_RESROUCE_BATTERY_ID
When using 'battery' h/w resouce in /hal/etc/pass/pass.conf,
the following error happen. So that add the missing code for PASS_RESROUCE_BATTERY_ID.
[Error log]
pass-parser.c: parse_resource_data(748) > Unknown 'device_type' property value (battery)
Change-Id: I30fb782e4e67b0fbe728201e30e2e4d0a1698c4c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 3 Aug 2021 06:19:23 +0000 (15:19 +0900)]
pass: Add support of cooling-device property
Already thermal monitor in pass get the thermal information with
'thermal_device_name' property. When over-temperature is deteced,
must need to prevent the dangerous situation by using the cooling-device
which is attached to a thermal device.
So that add 'cooling_device_name' property in 'device_list' section
in order to get/set the information of cooling-device.
Also, 'thermal,cooling_device_state' property will be used
when try to change the state of cooling-device if over-temperature is
detected.
Lastly, enable thermal operation for both new PASS_RESOURCE_BATTERY_ID devie type
and PASS_RESOURCE_NONSTANDARD_ID.
[Newly added properties for cooling-device]
- 'cooling_device_name' property in 'device_list' section
- 'thermal,cooling_device_state' property in 'level_list' section
[Example of cooling-device properties]
In case of scripts/pass.json,
"device_name" : "cpu0",
"device_config_path" : "/hal/etc/pass/pass-cpu0.json",
"thermal_device_name" : "thermal_zone0",
"cooling_device_name" : "cooling_device0", <- Added
"cpu,number_of_cpus" : 4,
"cpu,first_cpu" : 0,
In case of scripts/pass-cpu0.json,
{
"level" : 0,
"dvfs,minimum_frequency_khz" : 600000,
"dvfs,maximum_frequency_khz" : 1500000,
"thermal,cooling_device_state" : 0 <- Added
}, {
"level" : 1,
"dvfs,minimum_frequency_khz" : 1500000,
"dvfs,maximum_frequency_khz" : 1500000,
"thermal,cooling_device_state" : 1 <- Added
},
Change-Id: I86bfc5ce2037559e81bbf70567b82457167d4ced
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 2 Aug 2021 10:09:40 +0000 (19:09 +0900)]
pass: rescon: Fix wrong initial value to distinguish either property is added or not
The commit
d54cf9cc4588 ("pass: rescon: Add support for multiple
scenario pass_level") has defined the MIN_INT (zeor) to inialize
the property values in struct pass_level. But, some property values
will have the zero value like cooling_device_state is zero.
In that case, if MIN_INT is zero, cannot separate the following two
cases:
- propery is absence in configuration file -> 0
- property value is zero in configuration file -> 0
In order to separate the above two cases, change the MIN_INT value
from 0 to -1. After changes, can separate the two cases as following:
- propery is absence in configuration file -> -1
- property value is zero in configuration file -> 0
Change-Id: I2ee3fe9372c2deb82018949fc2b4b85eb3bb96ff
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 28 Jul 2021 01:01:07 +0000 (10:01 +0900)]
pass: parser: Convert script format to json to improve readability
The legacy .conf file format is not better on side of readability.
So that change the configuration file format to json style to improve
readability.
Change-Id: I056971e4674ccfee703d3b55636575f8a0d83fbd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 29 Jul 2021 12:44:15 +0000 (21:44 +0900)]
thermal: Convert pass-thermal.conf format to json to improve readability
The legacy pass-thermal.conf file format is not better on side of readability.
So that change the configuration file format to json style to improve
readability.
Change-Id: I228559fbc348b097284263a6bd8c57c1b2e6fa37
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 29 Jul 2021 12:38:13 +0000 (21:38 +0900)]
pmqos: Convert pass-pmqos.conf format to json to improve readability
The legacy pass-pmqos.conf file format is not better on side of readability.
So that change the configuration file format to json style to improve
readability.
Change-Id: I4898d431b1d0f8bc3b50b1d1ea764c87992cdf6c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
INSUN PYO [Wed, 21 Jul 2021 01:05:55 +0000 (10:05 +0900)]
pass: resmon: Remove unused code
Change-Id: I0e4f5e61fe5ed0ab8a58ec69c02f0115b16a247f
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Chanwoo Choi [Thu, 17 Jun 2021 07:34:01 +0000 (16:34 +0900)]
unittest: Replace system command with dbus signal
system() command causes the security issue. So that fix issue
to replace system command with dbus signal.
Change-Id: I83843697c9b64bd1c14fc54d1e9773dcfbdc5a3b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 17 Jun 2021 07:23:14 +0000 (16:23 +0900)]
scripts: dbus: Allow root to use core d-bus interface
Allow 'root' to use core d-bus interface provided by PASS.
The 'root' have to control all d-bus interface without any restrictions.
Change-Id: Ie322e426cbc945209cd9188ffa642444ce69880a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 17 Jun 2021 01:59:01 +0000 (10:59 +0900)]
pass: rescon: Add missing lock for scenario_level_list
scenario_level_list variables should be protected by mutext.
So thath add missing lock for scenario_level_list
Change-Id: Ib4590fd3b76e3e9f6953234cbb1f7b21c7af7520
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 3 Mar 2021 03:56:18 +0000 (12:56 +0900)]
pass: pmqos: Add new Performance mode
Add new 'Performance' mode in order to support the highest performance.
There are always requirements to test the device with high-performance.
Change-Id: I5d2eadefeedd8d0d56e08f37c68fd0664c2ffb8b
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Mon, 1 Feb 2021 04:43:51 +0000 (13:43 +0900)]
pass: unittest: Change install path and test file name
Change install path and test file name. Tizen 6.5 requires the install
and naming format as '/usr/bin/hal/[module name]-haltests'.
[Detailed changes]
- /usr/bin/pass_haltests -> /usr/bin/hal/power-haltests
- /usr/bin/pass_gtest -> /usr/bin/pass-unittests
And replace -ENODEV with -ENOTSUP because hal-api-power uses
the more correct error value of -ENOTSUP.
Change-Id: Ia2c8fd772d10e8b55db4dc66d9ee4f6d2be511e4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
lokilee73 [Thu, 4 Feb 2021 03:57:45 +0000 (12:57 +0900)]
pmqos: add AppLaunchHome and HomeScreen
Two scenarios are added to support C# APIs.
ex) DevicePmQosAppLaunchHome
DevicePmQosHomeScreen
Change-Id: I93ffd4fb0f2e91b00ba3fdaeb7b14b00a4eaa444
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
Chanwoo Choi [Mon, 1 Feb 2021 01:32:35 +0000 (10:32 +0900)]
pass: rescon: Handle -ENOTSUP error instad of -ENODEV
The Power HAL API (hal-api-power) uses the -ENOTSUP error when HAL
function is not implemented instead of -ENODEV error. So that
handle -ENOTSUP error instad of -ENODEV
Change-Id: I7637f78d76e2350d95091cf216757b1ce53416e4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Seung-Woo Kim [Fri, 29 Jan 2021 09:21:15 +0000 (18:21 +0900)]
pass: resmon: Fix memory leak of udev_monitor in error path
The resmon_uevent_add() has memory leak in error path. Fix the
memory leak.
Change-Id: I53c07b891b888cd1bdd596f872dd204f620d5b7c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Chanwoo Choi [Tue, 26 Jan 2021 01:03:35 +0000 (10:03 +0900)]
PASS v1.2.0
- Changes from v1.1.0
1. Use hal-api-power (/platform/hal/api/power) instead of loading
the HAL backend library directly.
Change-Id: I53d30b334e307f3320346114a61d45889e59a104
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 19 Jan 2021 01:59:40 +0000 (10:59 +0900)]
pass: Remove hal-api-common dependency
/etc/ld.so.conf.d/libhal-api.conf contains the '/usr/lib/hal and
/usr/lib64/hal' path for loading the shard library. So that PASS daemon
doesn't need to specify the dependency of hal-api-common.
Change-Id: I56a254f9d4baa3c5f252c99fdf4f4e7bdb0f5307
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 6 Jan 2021 04:55:33 +0000 (13:55 +0900)]
pass: hal: Replace HAL interface with hal-api-power
Tizen 6.5 provides new HAL API layer to make tizen porting easy.
Power HAL API (hal-api-power) provides HAL C API for controlling
the h/w resources such as CPU/GPU/Memory Bus/Memory devices
and provides HAL interface for HAL backend developer for using
Tizen platform on new h/w device. PASS daemon just calls the Power HAL
API without handling the HAL backend anymore.
Describe the detailed changes as following:
1. Remove self-defined HAL functions and don't open HAL backend library
directly. Instead, use hal-api-power to control the h/w resources.
PASS deamon doesn't need to handle the HAL backend library anymore.
2. Remove pass-hal-devel package because of moving HAL interface
defintion (src/hal/hal.h) into hal-api-power (hal-power-interface.h).
3. Change the open path of pass configuration files.
- /etc/pass/ -> /hal/etc/pass/
Change-Id: I73a1c29c7af000335021faac62157b5342065682
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 22 Dec 2020 07:09:00 +0000 (16:09 +0900)]
pass: resmon: Fix memory leak of udev_monitor instance
In order to fix the memory leak, jump exception handling code
when error happen.
Change-Id: I0b288b602d61cab6ebdce3c5e53ff808e0b2d001
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 15 Dec 2020 06:21:52 +0000 (15:21 +0900)]
pass: resmon: Fix memory leak of udev instance
In order to fix the memory leak, call udev_device_unref
when error happen.
Change-Id: Ic5919eeb07c34e564bf5ad7cf357ff8ae35c2733
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 3 Dec 2020 10:00:09 +0000 (19:00 +0900)]
pass: pmqos: Change the log level to debug for removing confusion
When the following case, it is not error. But, need to print
the log message for debugging.
- Unknown scearnio for each h/w resource
- Nost supported scenario for each h/w resource
- The some scenario is already locked.
Change-Id: Ib4280a4feae6d7fdfcc35ca1be89526d42be1d1c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Wed, 25 Nov 2020 05:43:30 +0000 (14:43 +0900)]
pmqos: Edit the unproper expression of pmqos data structure
The pmqos module supports the multiple h/w resources like CPU, GPU, bus
and memory. In order to express the correct meaning, edit the unproper
expression of pmqos data structure from 'pmqos_cpu' and 'pmqos_data'
and change the local variable name from 'cpu' to 'pmqos'.
Change-Id: I25151a22b417c697b74758c531c5d11ab15e5430
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Tue, 28 Apr 2020 01:07:23 +0000 (10:07 +0900)]
PASS v1.1.0
In order to support 'scenario pass_level', the format of pass configuration
are changed. It affects the pass-hal packages. So, it needs to increse
the version up to prevent the confusion between pass and pass-hal packages.
- Changes from v1.0.0
1. Support 'scenario' pass_level' for PMQoS and Thermal Monitor
2. Support 'scenario' with maximum duration and 'mode' without maximum duration
3. Add new 'SetScenario' method
- org.tizen.system.pass.pmqos.SetScenario
4. Add new 'Doze' mode
Change-Id: I429e79171a22f7e1ce7b3248e04a0e1e1fe33f82
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 04:08:23 +0000 (13:08 +0900)]
scripts: pmqos: Add new Doze mode
Add new Doze scenario which handles h/w resources like CPU frequency
when right after LCD off and before entering the suspend-to-RAM
for reducing the idle power-consumption.
[How to hanel 'Doze' mode]
- Enable 'Doze' mode
dbus-send --system --type=method_call --print-reply --reply-timeout=5000 \
--dest=org.tizen.system.pass /Org/Tizen/System/Pass/Pmqos \
org.tizen.system.pass.pmqos.SetScenario \
string:Doze int32:1;
- Disable 'Doze' mode
dbus-send --system --type=method_call --print-reply --reply-timeout=5000 \
--dest=org.tizen.system.pass /Org/Tizen/System/Pass/Pmqos \
org.tizen.system.pass.pmqos.SetScenario \
string:Doze int32:0;
Change-Id: I536acbb36f663e4ad0ffa474f0a0981351428f0e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Fri, 7 Aug 2020 02:16:25 +0000 (11:16 +0900)]
pmqos: Add support of 'mode' like UltraPowerSaving
Priot to that support only 'scenario' with the maximum duration time
in order to prevent the misuse of scenario from client. Additionally,
'mode' is required to change the system status until receiving
the unlock request without any maximum duration time.
So, make 'max_duration_ms' property optional. If some scenario in
/etc/pass/pass-pmqos.conf' don't have the 'max_duration_ms' property
it considers the 'mode'.
Difference of both scenario and mode as following:
1. 'scenario' with the maximum duration time like AppLaunch
- Lock case
a. Client send dbus signal with both 'scenario' name and duration
- Unlock case
a. Client send dbus signal with both 'scenario' name and 0
a. When timer with specific duration from client is expired,
unlock scenario automatically.
a. When timer with maximum duration is expired,
unlock scenario automatically.
2. 'mode' without any duration time like UltraPowerSaving
- Lock case
a. Client send dbus signal with both 'mode' name and 1
- Unlock case
a. Client send dbus signal with both 'mode' name and 0
Change-Id: I02cac0820b3085f7046689aecf8dc679f5f381c4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 6 Aug 2020 09:57:01 +0000 (18:57 +0900)]
pmqos: Add new SetScenario method for pmqos dbus interface
When add new scenario to pmqos, it have to edit the code.
It is not extensible. In order to improve the extensiblity
without code changes, add new SetScenario method for pmqos dbus interface
as following: When need to add new scenario, just add new scenario info.
to scripts/pass-pmqos.conf (/etc/pass/pass-pmqos.conf) without any code
changes.
[Interface for new SetScenario method of pmqos dbus]
- dbus interface : org.tizen.system.pass.pmqos.SetScenario
- parameter 1: scenario name like AppLaunch
- parameter 2: duration time like 3000 means 3 second
Change-Id: I5ee8da4ec62a9cf1d55ea51f6c7fb8ca9ce7b9e7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Chanwoo Choi [Thu, 6 Aug 2020 09:14:27 +0000 (18:14 +0900)]
pass: Adjust indentation to show current resource statues for readability
Adjust indentation to show current resource statues and remove unneeded
blank line for readability. And remove unneeded comment and blank line.
Change-Id: Ibb2e660374626b942a2dd14c3bdb59caa5725162
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>