Commit Graph

91 Commits

Author SHA1 Message Date
Jimmy Shiu
26b3be6d67 power: ADPF: limit uclamp high/low values and use I as boost base
1. set uclamp.min high to 384 (from 512)
2. set uclamp.min low to 2 (from 0)
3. set kPo to 2 (from 5)
4. set kPu to 1 (from 3)
5. instead of the previous boost value, use I Error-Integral as the base
   of boost value.
6. add more traces (wakeup, overtime)

Bug: 198708191
Bug: 197586898
Bug: 197540375
Test: build and check trace
      adb shell perfetto -o \
      /data/misc/perfetto-traces/trace_file.perfetto-trace -t 20s sched \
      freq idle am wm gfx view power hal
Change-Id: I35484322a84c2ab19f3024cf6634c1818ba570b0
2022-11-01 11:01:16 +00:00
Wei Wang
fa2b75f268 power: move trace point to libperfmgr.
Test: systrace
Bug: 199776250
Change-Id: I9bb4d5a50faa93e7bc638ef723bdc2662fb63b24
2022-11-01 11:01:14 +00:00
Sebastiano Barezzi
2964a15eb6 aidl: light: Add "backlight" to the list of backlight devices
* Seen on sdm660 4.19

Change-Id: I4cf0cee36fc5d09f65c4709d854ed3cd5d087e68
2022-09-13 22:12:24 +05:30
Sebastiano Barezzi
2686a6a730 aidl: light: Rewrite backlight support
* This properly handles max brightness node

Change-Id: I8afcf4bb7cef9c71d9a03bac7e118b8d9cb0565b
2022-09-13 22:12:20 +05:30
Sebastiano Barezzi
627e6ad184 aidl: light: Make RGB utils rgb_t methods
Change-Id: Iaaa34987c7670077214078169ddeb756a794403b
2022-09-13 22:12:15 +05:30
Sebastiano Barezzi
646127bbc9 aidl: light: Don't store alpha value
* We already apply it to RGB colors, it's not used outside colorToRgb()

Change-Id: Ic683f1355432e17328119f4a4da0f9fe6b5efe71
2022-09-13 22:12:09 +05:30
Sebastiano Barezzi
242aaad5c0 aidl: light: Set color and brightness data size to 8bit
* We're wasting memory

Change-Id: Ie66f504f32b487642c25b104240eaa8fb2df870c
2022-09-13 22:12:02 +05:30
Jiyong Park
00e4c736bf aidl: Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Merged-In: I14a1c57bd06f1f2aa52491f779c7030d4de03547
Change-Id: I7b9055909b901843631314b9577a9e578a739d00
2022-09-12 11:48:10 +02:00
BeYkeRYkt
2d6bc53b95
aidl: light: Don't scale RGB brightness if alpha is 0
* Fixes custom LED colors

Change-Id: I14150292a0a3d8411a26e45f8a4fa4b40f3101b7
2022-02-07 15:47:57 +01:00
Sebastiano Barezzi
f162d20b5b
aidl: light: Wire up
* Merged Xiaomi SM8250, SM8150, SM6250, SDM710 and MSM8953 implementations

Change-Id: I16764ec8676de6c2a9f745876dddab75db6adf35
2022-02-07 15:47:57 +01:00
Sebastiano Barezzi
fecaf7f077
aidl: light: Rebrand to Xiaomi
Change-Id: I68a6ea1ab63a5581fa05e5490ef1cc86cc38741e
2022-02-07 15:47:57 +01:00
Sebastiano Barezzi
5b0631944d
aidl: light: Initial stub service
* Made with aidl-gen

Change-Id: I517ddd2222cb937c02298d0972b8abf0ffc24fd6
2022-02-07 15:47:57 +01:00
Jimmy Shiu
8fb3a9d722
ADPF: fix no boost due to the big negative ILowLimit
Tuning the PID control loop as the below:
ILowLimit: -512 -> -120
kPOver: 2->5
kPunder: 2->3
kDOver: 1->5
kDUnder: 0->0

Bug: 193165816
Test: cuj/youtuble, cuj/facebook, PtsUiBench
Change-Id: Icc1a9a8d04004f60e47cabb7c4131ea67585be53
2021-10-18 23:40:43 +02:00
Jimmy Shiu
0f740ec5ef
ADPF: avoid to call close() twice
To get rid of error logs, avoid to call close() twice.

07-29 17:20:35.341 E powerhal-libperfmgr: Unexpected Error! Failed to
look up tid:2585 in TidRefCountMap
07-29 17:20:35.341 E powerhal-libperfmgr: Unexpected Error! Failed to
look up tid:2586 in TidRefCountMap
07-29 17:20:35.341 E powerhal-libperfmgr: Unexpected Error! Failed to
look up tid:2031 in TidRefCountMap
07-29 17:20:35.341 E powerhal-libperfmgr: Unexpected Error! Failed to
look up tid:2585 in TidRefCountMap

Bug: 194775170
Test: build and check log.
Change-Id: I91adf907b837382f68935b9054e19465a499049c
2021-10-18 23:40:43 +02:00
Jimmy Shiu
fe6cde1c96
ADPF: fix abnormal high uclamp
"GPU completion" task inherits a high uclamp value from RenderThread.
But it's not in the ADPF thread list, so it remains a high uclamp value.
Use SetTaskProfiles("ResetUclampGrp") and
SetTaskProfiles("NoResetUclampGrp") to manage the uclamp_fork_reset for
tasks.

Bug: 191973176
Bug: 192149875
Test: vendor/google_testing/pts/tests/common/utils/perf/run_pts/jank_test.sh
Test: adb shell cat /proc/vendor_sched/dump_task
Change-Id: I6aed171e88c0a6db5f762e7c791344bb3f4b7a90
2021-10-18 23:40:43 +02:00
Jimmy Shiu
a9e7626ffb
Adpf: set uclamp when session is created
When seesion is created, set uclamp to boost CPU for top-app.

Bug: 192143316
Test: Build and run UiBenchSlowNestedRecyclerViewInitialFlingMicrobenchmark test
Change-Id: I748037019fae439ab1863a5ed21aa98b9d26e0dc
2021-10-18 23:40:43 +02:00
Wei Wang
3f7fdd8623
Add PID tunables for sample window
Bug: 191480755
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Id559796ee4a423410148b8c2df0524909658af82
2021-10-18 23:40:43 +02:00
Jimmy Shiu
d3bc3b8b6f
adpf: clean up ADPF trace points
clean up ADPF trace points and use vendor.powerhal.adpf.uclamp.boost_cap
instead of vendor.powerhal.adpf.uclamp.cap_ratio.

Bug: 191551452
Test: build
Change-Id: I457710b1bd9a7adbb55749d7bb915c736dde2751
2021-10-18 23:40:43 +02:00
Wei Wang
63fca5e797
Adpf: honor window setting for P,D caculation
Also change default window setting to 0

Bug: 191409203
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Ieadf50a64e795d9942373c411189adf9daaee779
2021-10-18 23:40:43 +02:00
Wei Wang
7c42612574
power-libperfmgr: improve adpf logic
Cache active state and reduce log spam
Add value tracing into libperfmgr
Use adaptive stale timeout based on rate limit

Bug: 191331719
Bug: 191296994
Bug: 177493042
Test: boot
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I1c1484c9277209bf68bd287ceae83e2b37684c62
2021-10-18 23:40:43 +02:00
Wei Wang
b3ea64c377
Fix objects that are derived from refbase
Fixes: ag/14313466
Bug: 177493042
Bug: 191163855
Test: Build
Change-Id: I94812997a8214b77a2e1d0bcf90ef62205c5adf6
Signed-off-by: Wei Wang <wvw@google.com>
2021-10-18 23:40:43 +02:00
Jimmy Shiu
8a20bda9e4
ADPF: use PID algorithm to control cpu resource
The patch includes:
1. Move from folder adpf to aidl.
2. Add PowerSessionManager class to maintain hint status.
   And PowerHintMointor looper thread for monitoring or updating
   PowerHintSession status.
3. Use PID algorithm to replace the step-wise alogrithm for cpu resource
   control.

Test: build, boot to home, trace analysis
Bug: 177493042
Change-Id: Ib7d3f414225b18954350341ca22b7be87a6202e7
2021-10-18 23:40:43 +02:00
Wei Wang
9fd3926d5f
power: reduce log spam and refine trace title
Add bunch of TODO for team as well.

Test: build
Bug: 177492680
Bug: 185368789
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Ic1d5ecea10a60b23343866cd62519fda37bd6ec5
2021-10-18 23:40:43 +02:00
Jimmy Shiu
3a50977117
power: add PowerHintSession for ADPF implementation
Adapted from PoC from ag/13100800

Added more ATRACE for further tuning and debug

Test: APPPID=$(adb shell pidof com.prefabulated.touchlatency); watch -n
      1 adb shell grep uclamp /proc/${APPPID}/sched
Test: atest VtsHalPowerTargetTest
Bug: 177492680
Change-Id: I6bfd61b21dc1cde04f6ba9ae8d3533cd263ad814
Signed-off-by: Wei Wang <wvw@google.com>
2021-10-18 23:40:43 +02:00
Jeongik Cha
9cdb8059e5
Specify version for aidl_interface explicitly
Bug: 150578172
Test: m
Change-Id: I4a9bf218b92252403e9ebbe8f89b10ee1899283f
2021-10-18 23:40:43 +02:00
Wei Wang
8960cfb7b5
power: add a property for config file
Test: build
Bug: 173222103
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I14e7e0aa349e446f6889cbfc9a914f5314438e6b
2021-10-18 23:40:43 +02:00
Wei Wang
6dd09e9ded
Power: advertise power headers are deprecated
Test: Build
Bug: 169065024
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I3cef3aff4bb2394571a3de13e535283722c308ed
2021-10-18 23:40:43 +02:00
Wei Wang
b51c3e681f
Power: add support for devices without display idle signals
To workaround b/141025174, adding support for devices without display
idle signals. Also added a property to override idle display function.

Besides the idle signal support, this CL also makes touch boost duration
tunable through several new vendor properties. It also named display
idle monitor thread and cleans out the obsolete HIDL Power HAL
implementation.

Bug: 168080943
Bug: 169065024
Bug: 171494137
Test: Boot and trace
Change-Id: I76067d10958654d539624ec4cac8f346103e67bc
2021-10-18 23:40:43 +02:00
Arian
4ae5975c9a
Revert "power-libperfmgr: simply wait if idle state node is not present"
This reverts commit 297888275a.

Change-Id: Iefee44a1f407729e76cb693832bad4998141c42b
2021-10-18 23:40:31 +02:00
Stefanie Kondik
d865b86327 power-libperfmgr: Add support for tap-to-wake feature control
[wight554] Enable DOUBLE_TAP_TO_WAKE mode explicitly and move dt2w mode on top of setMode switch: when LAUNCH hint is received, if mSustainedPerfModeOn is not true, it will not break, leading to the case switch going through all the next labels without interrupting until the end, also hitting DT2W one, leading to DT2W always toggling when you launch an app
[SebaUbuntu] Don't break devices using hint manager for DT2W toggle

Change-Id: Ib6e1e010834b1b16668d52db79b26804fe0e1671
2021-06-23 16:36:32 +02:00
LuK1337
f05aff1088 power-libperfmgr: Guard it
This is needed so that other devices not using the power AIDL HAL
(read: not importing relevant Pixel namespaces) can still be buildable.

Change-Id: I089df179c882450281e73c4ce0f8cabb7018ab0d
2021-04-20 09:41:50 +01:00
LuK1337
2182dd8add power-libperfmgr: Allow device specific hooks for setMode, isModeSupported
* Some devices may want to implement custom hooks

Change-Id: Icb2d66471ec649a69b1e69849fd86282775052cb
2021-04-18 22:39:12 +01:00
Jesse Chan
0cc25a1b4f power-libperfmgr: remove Google-specific VR and camera hints
Change-Id: Iac0e65a16f660583d3400a35622113d35d8d1d27
2021-04-18 22:39:12 +01:00
Jesse Chan
297888275a power-libperfmgr: simply wait if idle state node is not present
Change-Id: I93dd97e5437761d2d969f93a5af0cae864fd0a65
Signed-off-by: Jesse Chan <jc@lineageos.org>
2021-04-18 22:39:12 +01:00
Kyle Lin
317828378a libperfmgr.rc: let power hal start early
Bug: 162791243
Bug: 72471476
Test: build and using emul temp/running burn8 to verify it
Change-Id: I5ca475be8b73b940e4858634595a7918ae92f6ef
2021-04-18 22:39:12 +01:00
Kyle Lin
b0464fceaf libperfmgr.rc: let perfmgr can change dex2oat priorities
Because perfmgr is a vendor process, it cannot adjust system priority
directly.

Bug: 162791243

Test: build and using emul temp/running burn8 to verify it
Change-Id: I55e49cb7d0b2d4c0e42dff8398b5d42c6546cafa
2021-04-18 22:39:12 +01:00
Wei Wang
8e41597e83 power-libperfmgr: rename namespace for Pixel power HAL
Bug: 152811907
Test: Build
Change-Id: I6848e929d8a26b540fcee9145376b896c3cd9799
2021-04-18 22:38:42 +01:00
Wei Wang
9e3e1e7bc8 power-libperfmgr: allow powerhint calls as soon as service starts
Bug: 147840817
Test: boot
Change-Id: Ic1d6e04109683b999bb99484930e95dc9813fc59
2021-04-18 22:38:42 +01:00
Wei Wang
18e667e58c power-libperfmgr: add aidl extension server
Bug: 151896829
Test: boot flame
Change-Id: Ie951008cabe2a5680fbc546a21bdc9a428864ef9
2021-04-18 22:38:42 +01:00
Wei Wang
3762d10196 power-libperfmgr: Hook with display handler
Bug: 147840817
Test: boot and check power hint
Change-Id: I9c0c98e76ef4b5f4756f63ed5122efc366737869
2021-04-18 22:38:42 +01:00
Bruno Martins
289283e2f8 power-libperfmgr: Import power HAL AIDL implementation
Based on implementation from hardware/google/pixel as of commit 0338a0e.

Change-Id: I3df57bd3e8298141272add55c911fb5eece9aebe
2021-04-18 22:38:40 +01:00