power-libperfmgr: Optimize the wakeup performance and fix unstable boost

Optimize boost:
A more efficient way is to trigger the wakeup boost through mTidSessionListMap, so the time
   complexity reduce from O(n^3) to O(n^2).

The original code path:
  PSM:wakeSessions() contains a loop that is O(n),
  inside the loop, it calls to PHS::wakeup() which call to
  PSM::setUclampMinLocked(), and
  PSM::setUclampMinLocked() contains two loops O(n^2)

The new code path:
  PSM::wakeSessions() directly checks all the ADPF tasks O(n) and
  get the wakeup boost value O(n), then directly set the uclamp.min
  The time complexity lower to O(n^2).

Fix unstable boost:
The original flow is to find max boost and wake it up from stale state
one by one. But the previous woken ones would not be counted when the later ones finding their max boost value.
The new flow boost all the tasks first, then wake up all those sessions.

Bug: 235510337
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: I995673b74401e198eb72188134ba1ebc134f971c
2 files changed
tree: b06ee5056031e6a3063670ba1640829133855f7b
  1. aidl/
  2. alsa_utils_legacy/
  3. BesLoudness/
  4. bootctrl/
  5. hidl/
  6. interfaces/
  7. libmtk_bsg/
  8. libmtkperf_client/
  9. Android.bp
  10. Android.mk
  11. README.md
README.md

Common hardware components for MediaTek devices