pass: thermal: Add support for scenario_level for thermal scenario 18/224718/7
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 11 Feb 2020 12:45:12 +0000 (21:45 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 26 Feb 2020 10:22:19 +0000 (19:22 +0900)
commitb37d287b6349b80c4c5a8a13c47681b0483f6bf4
treed3270a9c4b298f82b1ee83533ef40410cdae1037
parentd54cf9cc4588b52f41a420d268e976c35b45f957
pass: thermal: Add support for scenario_level for thermal scenario

Prior to that thermal monitor has been monitoring the temperature
and then decide current thermal scenario like 'Release', 'Warning'.
And send the broadcast dbus message to inform the current thermal scenario
to otther Tizen framework. It didn't support to change the value
of the h/w resource like frequency, the number of online CPU.

Finally, thermal monitor is able to change the value of h/w resource
according to their own 'scenario_level' value on each thermal scenario.

For example with following configuration example,
- If thermal monitor decide the current thermal scenario as 'Release',
  'Release' sceanrio has 'scenario_level=0'. It means that set 'ScenarioLeve0'.
  It allow max_freq as 1.3GHz and max_cpu as 4 core.

- If thermal monitor decide the current thermal scenario as 'Warning',
  'Warning' sceanrio has 'scenario_level=2'. It means that set 'ScenarioLeve2'.
  It allow max_freq as 768MHz and max_cpu as 2 core.

This feature is important for preventing the dangerous overheating of h/w
target and it is very easy to tune up the configuration of thermal monitor
by editing the configuration files under '/etc/pass' path.

[Example of configuraiton file for CPU h/w resource]
(snip)
[ScenarioLevel0]
limit_min_freq=768000
limit_max_freq=1300000
limit_min_cpu=0
limit_max_cpu=4

[ScenarioLevel2]
limit_min_freq=768000
limit_max_freq=768000
limit_min_cpu=0
limit_max_cpu=2

(snip)
[thermal.scenario0]
support=yes
name=Release
temperature=25
timer_interval_ms=5000
scenario_level=0 <- It means 'ScenarioLevel0' is used for 'Release'.
Allow max_freq as 1.3GHz and max_cpu as 4 core.

[thermal.scenario1]
support=yes
name=Warning
temperature=30
timer_interval_ms=3000
scenario_level=2 <- It means 'ScenarioLevel2' is used for 'Warning'.
Allow max_freq as 768MHz and max_cpu as 2 core.

Change-Id: I3a5ff802e68f1452e90d766cfe1f04b4554413fd
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-thermal.c
src/pass/pass.h