Commit Graph

200 Commits

Author SHA1 Message Date
Michael Bestas
44cf4e0f85 Move to common power-libperfmgr
Change-Id: Icaa3b265fbc0fb71ae57a5cbde1654f62d07aef8
2024-05-18 13:18:30 +01:00
basamaryan
1bdeed2029
hidl: biometrics: Add support for the fortsense fingerprint hal
Change-Id: Ia311cf3f77290f33fc2dc0eb79de435d92d2c0f8
2024-05-16 16:30:25 +04:00
Matt Buckley
4453055456 power: Remove wakeup behavior from PowerHintSession and PowerSessionManager
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
2024-03-21 13:05:52 +00:00
Matt Buckley
035ad6c78d power: Add better tracing for sendHint and refactor existing tracing
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
2024-03-21 13:05:52 +00:00
Jimmy Shiu
f2c8c33939 ADPF: refine StaleTimeHandler
Bug: 256515601
Test: build
Change-Id: Ia7f80c838961b837733c457b189f16c6433cf3c3
2024-03-21 13:05:52 +00:00
Jimmy Shiu
773630adc8 ADPF: remove unused EarlyBoostHandler
Bug: 256515601
Test: build
Change-Id: I9b63c6ee3decaa4c70f38bcc66a0e9e1de464ad6
2024-03-21 13:05:52 +00:00
Arian
e5a9512985 vintf: Add fpc and goodix 1.0 extensions to fcm
Change-Id: I6b678c39535cdf76c7fc5bef419bc9f1dd2281cf
2024-03-07 19:46:40 +01:00
Jens Reidel
c682da8098 vintf: Add fingerprint extension to common fcm
Change-Id: I7485d6424e6e840623e7a9b8a6131feb0b7c8501
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2024-03-07 19:39:46 +01:00
Giovanni Ricca
5f0a38d22e interfaces: fingerprints: extension: 1.0: Reverse the remaining interfaces
Change-Id: I53175dc6125b485c6007685938181a169f4d3b87
2024-02-20 21:30:53 +00:00
Erfan Abdi
3a14026963 interfaces: fingerprints: Initial reverse engineered 1.0 extension
Change-Id: I19d4736a01604b354e43029ea77e54b698517954
2024-02-20 21:30:53 +00:00
bengris32
5ffacf20ed interfaces: goodix: Initial reserve engineered 1.0 fingerprintextension
Change-Id: Ie5dba919dd7dcd78030ac936649a97ac1b7854e3
2024-02-20 21:30:53 +00:00
Giovanni Ricca
e0d1ecf861
interfaces: goodix: Reverse the remaining calls
* Inline with curtana goodix impl

Co-authored-by: bengris32 <bengris32@protonmail.ch>
Change-Id: I05972ba7c023a000c853c96c518aaf82e3c25a92
2024-02-15 12:55:55 +01:00
Arian
cf41643853 vintf: Add common xiaomi framework compatibility matrix
Change-Id: I532563e4f427bfe58b4b07e34afce6a7d264ac0c
2024-01-20 12:02:36 +01:00
Arian
2f5513decb vibrator: effect: Read vibration fifo data from vendor
Change-Id: I58c74f01d75e8616fdb03c27e3dc4c4df6838faa
2023-12-19 17:27:07 +01:00
Arian
b9f555e557 Import qti vibrator effect and rename
Change-Id: I27052df302674122ba90d665875b384ea0cfa7be
2023-12-14 17:22:27 +01:00
Jimmy Shiu
d2c0e46e16 power-libperfmgr: ADPF: send ADPF_FIRST_FRAME hint
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
2023-11-24 16:37:12 +00:00
Jimmy Shiu
cec3b97eda power-libperfmgr: ADPF: support sending power hint
Send a hint only when the system can support the hint.

Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Merged-In: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
2023-11-24 16:36:58 +00:00
Jimmy Shiu
e69da0c258 power-libperfmgr: ADPF: fix use-after-free crash
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
2023-11-24 16:31:32 +00:00
jimmyshiu
6ab718385b power-libperfmgr: ADPF: 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
2023-11-24 16:31:32 +00:00
Wei Wang
dada1040af power-libperfmgr: ADPF: extend non-stale session timer in wakeup
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
2023-11-24 16:31:32 +00:00
Sebastiano Barezzi
9cbf7b03e3
aidl: light: Implement attention light type
Change-Id: Ia7fff2a4374ad4d05718909000dc2fd99b9264f0
2023-11-13 15:36:27 +01:00
Luca Stefani
69f546cc9b
aidl: light: Make rgb a normal struct
No need to typedef in C++

Change-Id: I949c4319eb8f116d6cd2903a294757bacc7751a7
2023-11-13 01:39:53 +01:00
Sebastiano Barezzi
2154cee0ec
aidl: light: Reformat with clang-format
Change-Id: Iee8f2dc3777a95df827f33ad1f4e37f7d0f48eed
2023-11-13 01:39:53 +01:00
Luca Stefani
5981d19419
aidl: light: Construct HwLight in place
They aren't used outside the ctor, let's
inline their construction.

Change-Id: Ic4f2afb24caabc42a95f94c8c150fa028975c8a5
2023-11-13 01:39:53 +01:00
Sebastiano Barezzi
ad315044e4
aidl: light: Use const on getLights' foreach loop
Change-Id: I00570c7315ef31e20c8265650025b4969e2d98af
2023-11-13 01:39:53 +01:00
Sebastiano Barezzi
481f209d2a
aidl: light: Fix a bug where breath wouldn't be disabled when not needed
Change-Id: I65c84c845fe8fb514d6b8345013077e3d0946972
2023-11-13 01:39:53 +01:00
Sebastiano Barezzi
d71257fb4a
aidl: light: Uprev to V2
Change-Id: I69ce3c31c63ed5316fec295bc2d79e060f43093b
2023-11-13 01:39:53 +01:00
Sebastiano Barezzi
6386a23aa1
xiaomi: Keep a single clang-format in rootdir
Change-Id: Iffe5b37c311dc0ed0c9b5c91a2f94e9ff72f4a8a
2023-11-13 01:39:53 +01:00
Cosmin Tanislav
3d946592e6
hidl: sensors: 1.0: Standardize xiaomi pickup sensor
* use standard sensor type
 * ignore non-wakeup sensor variant
 * ignore events that do not properly match a pickup

Change-Id: I32bb097afb33603190dfd00a21202301a56bda08
2023-04-14 01:12:52 +02:00
Bruno Martins
004947ec9f
hidl: sensors: 1.0: Use pragma once
Change-Id: Icab086b90c016dc4cdaa2bf145145de27d6f5ef7
2023-04-13 17:15:30 +02:00
LuK1337
eed8c0648b
hidl: sensors: 1.0: Add (and run) clang-format file
Change-Id: I88beb777f386cdfadc1d39be3a36a1c3ebdee06a
2023-04-13 17:13:10 +02:00
Sebastiano Barezzi
61c7f9360d
hidl: sensors: 1.0: Rebrand to Xiaomi
Change-Id: I970b0c14a90dbe703c47148ce09654beb8de6774
2023-04-13 16:43:55 +02:00
Sebastiano Barezzi
2e85d44338
hidl: sensors: 1.0: Directly build convert.cpp with the impl
* Since we'll only use it here, we don't need to export it as a separate
  module

Change-Id: Ia7056fe6462cbd624d89db62fd239b6709862198
2023-04-13 16:43:07 +02:00
Arian
287f8d49e4
hidl: sensors: 1.0: Change default applicable license to Android-Apache-2.0
hardware_interfaces_license is not available here.

Change-Id: I7431f8b8f126aae12f82a8ead01b77801c888d91
2023-04-13 16:42:06 +02:00
Sebastiano Barezzi
7ae480b63e
hidl: sensors: Import 1.0 sensors impl
Change-Id: I18b77c5fa0a14c466a2d672b47713201057087f7
2023-04-13 16:37:16 +02:00
Sebastiano Barezzi
be702650a2
hidl: sensors: Move to 2.1 subdir
Change-Id: Ic6c5de0015ed46bc15b6ee119c690d4728249914
2023-04-13 16:23:29 +02:00
Cosmin Tanislav
40dd2e4672 hidl: sensors: Standardize xiaomi pickup sensor
* use standard sensor type
 * ignore non-wakeup sensor variant
 * ignore events that do not properly match a pickup

Change-Id: I6acff9154d4c8d12adbf4ca22729ebf7f60afa5f
2022-11-17 00:14:37 +01:00
Cosmin Tanislav
1b15de13fd hidl: sensors: Avoid target name conflicts
Change-Id: I7e9695d75fe92748ac889cd8daeebf34141b9fa9
2022-11-17 00:13:04 +01:00
Cosmin Tanislav
76aed62120 hidl: sensors: Import 2.X sensors hal proxy
Change-Id: I07e3c75992b68d299d9986ca0f9647f47ad8706e
2022-11-17 00:12:58 +01:00
Arian
54180f7643 hidl: sensors: Change default applicable license to Android-Apache-2.0
hardware_interfaces_license is not available here.

Change-Id: I67d3cf3651f772c3a6463b75ca9ba449c5cad9c9
2022-11-17 00:12:02 +01:00
Cosmin Tanislav
6bf5e5c37f hidl: sensors: Import 2.1 sensors multihal
Change-Id: Icdcd8a4f131ffa0bfd1bb7f38b9258c8306b17ee
2022-11-17 00:11:54 +01:00
jimmyshiu
47d31efd43 power: ADPF: Fix updateHintBoost blocks the binder thread
post the task into a looper thread.

Bug: 232992641
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: Ibd241834f904b4c87a51363e766e110d2818d496
2022-11-01 11:01:16 +00:00
jimmyshiu
43c9b76b8a power: Fix uclamp_min stuck at high freq
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
2022-11-01 11:01:16 +00:00
Will McVicker
4ad8e47249 power: Fix race between closing a session and receiving a boost
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
2022-11-01 11:01:16 +00:00
jimmyshiu
4cace0eb8a power: ADPF: dump ADPF session info
Dump current ADPF profile and ADPF session list into bugreport.

Bug: 204444691
Test: adb root && adb shell dumpsys android.hardware.power.IPower/default
Test: gpaste/6469309887938560
Change-Id: I17c0d615051f5e51c2e1fe99d17c402f9a65679a
2022-11-01 11:01:16 +00:00
jimmyshiu
cf51b4aa5f power: ADPF: uclamp.min integration
Integrate the uclamp.min across sessions.
Add UClampMininit as the display update boost

Bug: 232313238
Test: Manual test
Change-Id: I601f407b0b5383a1e39eac448d45cbaaeb7788fb
2022-11-01 11:01:16 +00:00
Wei Wang
5b35105303 power: PowerHAL: remove UclampMinGranularity
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
2022-11-01 11:01:16 +00:00
Matt Buckley
895962ed16 power: Ignore system hint sessions for universal boost
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
2022-11-01 11:01:16 +00:00
jimmyshiu
295d5f53ed power: ADPF: log clean up
Remove ALOGD logs.

Bug: 230205812
Test: adb shell logcat -b all | grep libperf
Change-Id: I4125afec526b76e3905e75c22fc2bfb555810fa8
2022-11-01 11:01:16 +00:00
Wei Wang
b4fb26bc8a power: Add minimal binder thread prio as -20 to match process prio
Bug: 227811781
Test: Build
Change-Id: I94670429ede032703661ee8eb8b1ea6456f5cbd5
Signed-off-by: Wei Wang <wvw@google.com>
2022-11-01 11:01:16 +00:00