Currently, all sessions get boosted any time DISPLAY_UPDATE_IMMINENT is
sent from SurfaceFlinger which can lead to large, unnecessary boosts.
This patch aims to change that by removing the wakeup behavior, relying
instead on sessions to boost themselves with new load change hints.
* Remove wakeup() from PowerHintSession
* Remove wakeSessions from PowerSessionManager
* Remove related timers and message handlers
* Remove DISPLAY_UPDATE_IMMINENT behavior entirely
Test: manual
Bug: b/260136431
Change-Id: I4610edfefe8fcbef7d4cdbf5768830a9392a54f7
Reset traced hint value to -1 on reportActualWorkDuration or stale
timeout, and rewrite existing tracing for readability.
Bug: b/243973548
Test: manual
Change-Id: I135ec5f8971a9902d880e4089b0df746f5b917e2
To send ADPF_FIRST_FRAME hint when reportWorkDurations was called first
time after stale state.
Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: I4377b1f549646bcf44bdf26b2657b7bc0646f9a4
Merged-In: I4377b1f549646bcf44bdf26b2657b7bc0646f9a4
Send a hint only when the system can support the hint.
Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Merged-In: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
The main problem is the timer thread could be woken after the session
was destroyed. We did have a closed flag which was set in destructor and the flag would be checked before handleMessage accessing the session
instance. To fix the problem, the operations of flag checking and session instance accessing should be guarded by the lock.
Bug: 236674672
Test: manual test
Change-Id: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
(cherry picked from commit 5c75978f530b27bd976d8695ed79acd336c24776)
Merged-In: I49a18efbc135b1bc070b101038a8a0bcc6e19fec
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
For DISPLAY_UPDATE_IMMINENT wakeup signal, non-stale
session's timer should be also extended. This resolves
the performance issue caused those sessions to go stale
prematurely.
Bug: 241621485
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I06330e064060248bb556ae35e0cb8fd302cef231
* use standard sensor type
* ignore non-wakeup sensor variant
* ignore events that do not properly match a pickup
Change-Id: I32bb097afb33603190dfd00a21202301a56bda08
* use standard sensor type
* ignore non-wakeup sensor variant
* ignore events that do not properly match a pickup
Change-Id: I6acff9154d4c8d12adbf4ca22729ebf7f60afa5f
post the task into a looper thread.
Bug: 232992641
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: Ibd241834f904b4c87a51363e766e110d2818d496
Separate Stale and EarlyBoost handlers and refine the code.
Test: adb shell dumpsys android.hardware.power.IPower/default
Test: Manual
Bug: 232992641
Change-Id: I81a4fd96fb7311ae5bbb7cbabe72378c9cad4aa3
We need to be holding the session lock when we dereference mDescriptor
since mDescriptor is destroyed when the session is closed. This patch
takes the session lock and verifies if it's still open during wakeup.
Test: vts run -m VtsHalGraphicsComposerV2_4TargetTest
Bug: 232992641
Change-Id: I4000a85bf2932cfdcddd3006d671a3c91ed32c48
Integrate the uclamp.min across sessions.
Add UClampMininit as the display update boost
Bug: 232313238
Test: Manual test
Change-Id: I601f407b0b5383a1e39eac448d45cbaaeb7788fb
This is causing session update skipped and stuck.
Bug: 232336917
Test: /data/nativetest64/libperfmgr_test/libperfmgr_test
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I8928b6f6a60dcf8d21e60228a74d3aa0ab792eff
Currently PowerHAL does not distinguish between system processes and
apps when deciding whether to apply universal boost. This patch
distinguishes system sessions and app sessions and ignores system ones,
making the disabling of universal boost dependent on the presence of app
hint sessions.
Bug: b/230511824
Test: manual
Change-Id: I08dea29b3a45f2ba69ed99a9f188fa83ba143423