Commit Graph

105 Commits

Author SHA1 Message Date
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
Jimmy Shiu
3a178070ce power: ADPF: add Early Hint feature
Add Early Hint feature and integrate with Stale Timer

Bug: 198379880
Test: build and manual test

Change-Id: I17009ee5b9ff922a79ccf5cb68be5b959038267d
2022-11-01 11:01:16 +00:00
Jimmy Shiu
52e5ce99b3 power: ADPF: Use Adpf Profile for PID tunnables
1. Use Adpf Profile to replace system-property-based PID tunnables.
2. Add a tunable for switch PID on/off
3. Switch Adpf Profile by hint name (ex: REFRESH_120FPS)

Bug: 202158746
Bug: 204444691
Bug: 206061061
Test: Build
Change-Id: Ia673a6bf64d40128ca1797d1e26fe564b3b35ff1
2022-11-01 11:01:16 +00:00
Jimmy Shiu
5936e4a52e power: ADPF: make uclamp.min stable
Considering the previous uclamp.min value is the base of PID output.
Instead of:
  `next_min = std::min(sUclampMinHighLimit, output);`
We should use:
  `next_min = std::min(sUclampMinHighLimit, current_min + output);`

When session status entered stale state, set the uclamp to 0, but keep
the current_min. That would be helpful for boosting the heavy workload
of the first few frames.

Bug: 204444691
Test: build && manual test

Change-Id: Idb19e2bfd8e9522fae5fd452b1fcc58786e96e65
2022-11-01 11:01:16 +00:00
Jimmy Shiu
c998138db6 power: Make HintManager a singleton class
HintManager is unique and widely used in many different components.
This is for making it easiler to be reloaded for debugging.

Bug: 172285365
Test: adb push \
      out/target/product/raven/data/nativetest64/libperfmgr_test/libperfmgr_test \
      /data/nativetest64/libperfmgr_test/libperfmgr_test && \
      adb shell /data/nativetest64/libperfmgr_test/libperfmgr_test
Change-Id: I3affdfe780073ebbc50fac7bfbdd1530ee9dc8c2
2022-11-01 11:01:16 +00:00
Wei Wang
34cf7df6f0 power: PowerHintSession: do not update PID controller when target changes
There is no history kept in powerhint session, so let us just keep what
we have in the PID controller and let new samples settle.

Bug: 227003278
Test: Build
Change-Id: Ia8b9a0be288389ec36ac35c668aca013d470c257
2022-11-01 11:01:16 +00:00
Jimmy Shiu
ff3b168ea1 power: Fix race condition between Looper and destructor
1. Clean all messages before add new.
2. Insteading of using `this`, use the unique mStaleHandler sp so Looper
   can hold the sp to keep the instance alive until the last message
   done.

Test: Manual Test
Bug: 219965773
Change-Id: Ic039146f0b966c1f27d86b121d4b72b75ff360e5
2022-11-01 11:01:16 +00:00
Wei Wang
1fbcb7d62e power: Add global debug property for override config path properly
An init trigger would restart powerhal as early as the property was
loaded and it is hopefully early than any clients would try to connect.

Also remove the obsolete restart hook with audio.

Bug: 218872105
Test: boot
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: Ib55897f65709a963016b729f213718aae5af8e8c
2022-11-01 11:01:16 +00:00
Jimmy Shiu
3978399d16 power: Add a debug property for switching powerhint.json path
Add a bool property `vendor.powerhal.config.debug`.
Power HAL would use `/data/vendor/etc/powerhint.json` when vendor.powerhal.config.debug = true.

Bug: 218872105
Bug: 206061061
Test: adb wait-for-device root; adb shell mkdir -p /data/vendor/etc/;
      adb push powerhint_mod.json /data/vendor/etc/powerhint.json
Test: adb shell setprop vendor.powerhal.config.debug true && \
      adb shell getprop vendor.powerhal.config.debug && \
      adb shell stop vendor.power-hal-aidl && \
      adb shell start vendor.power-hal-aidl && adb shell stop && adb shell start
Test: adb pull /data/local.prop ; vim local.prop
      + vendor.powerhal.config.debug=true
Test: adb wait-for-device root && adb shell perfetto -o \
      /data/misc/perfetto-traces/trace_file.perfetto-trace -t 20s sched freq \
      idle am wm gfx view power hal && \
      adb pull /data/misc/perfetto-traces/trace_file.perfetto-trace trace_profile_debug.pftrace
Change-Id: Ibaf5df280b989a8268efce1e3ab9a3f1e5510800
2022-11-01 11:01:16 +00:00
Jimmy Shiu
445137072b power: ADPF: fix stale trace status
Bug: 196192645
Test: Manual
Change-Id: Ibdbb8f47a16032ce3249aa667fa0c11e7869748f
2022-11-01 11:01:16 +00:00
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
Bruno Martins
42538d39b2 sensors: udfps_hal: Extend the list of supported paths
Change-Id: Iff7936763ff184e85eb7ff91407270122e7cd15c
2022-09-17 16:05:39 +01:00
Ivan Vecera
d71fbe08ac sensors: Implement UDFPS sensors 1.0 sub-HAL
* Implement minimalistic UDFPS sensors sub-HAL for Xiaomi devices
  that implement Sensors HAL 1.
* It uses sysfs attribute /sys/touchpanel/fp_state exported by
  touchscreen drivers but list of supported paths can be extended.

Change-Id: I5c7653bfbbed20b2f3e00fd8a32cb1277b753b4b
2022-09-17 15:27:17 +01: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
Arian
c08b665831 hidl: biometrics: Extend UdfpsHandler with onAcquired and cancel methods
These methods can be used to handle vendor acquired messages and disable
fod listening on cancelled and successful unlocks.

Change-Id: Ie6a8d24840b0b6c34527f863a6052f789200a79f
2022-09-09 14:01:31 +02:00
Tim Schumacher
5f0d7bbbe8
megvii: Return a char pointer for some stubs instead
`mg_facepp[3]` and `mg_facepp[4]` seem to return version strings, which
occasionally get logged if the return value is non-zero.

Return a dummy string for those functions to avoid crashing in strlen.

Change-Id: Icc5d2ab2f72c480f03e652e3849aceaf4cfb498b
2022-06-21 18:33:32 +02:00
Sebastiano Barezzi
ec5d5b0a98
Reland "megvii: Initial stub libraries"
* We can't provide the original libs anymore, thus making the duplicated targets not an issue anymore

This reverts commit c6a4249c37.

Change-Id: Id987607b73ca0d8e9fd944518442f8cdffd0ce2a
2022-06-21 18:33:13 +02:00
Arian
9976b3f15b
hidl: biometrics: fingerprint: Add support for device specific UDFPS libs
Change-Id: I8f29d58b178aa8ff420204f790c6952fdf4ade58
2022-05-13 18:02:35 +02:00
LuK1337
3f1a8dbfe8
hidl: biometrics: fingerprint: Make fingerprint HIDL fully treble compliant
This is more like a hack, also observed in the stock HAL, for pre-P shipped devices
because those have fpdata store path set to /data/system/users/ by the FingerprintService.

Force treble compliant path and thus avoid using data_between_core_and_vendor_violators
attribute:

 > typeattribute hal_fingerprint_default data_between_core_and_vendor_violators;
 > # access to /data/system/users/[0-9]+/fpdata
 > allow hal_fingerprint_default fingerprintd_data_file:dir rw_dir_perms;
 > allow hal_fingerprint_default fingerprintd_data_file:file create_file_perms;

Change-Id: I388f993de7f95fc68007d945f5a9cc975afde120
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
d6951615ae
hidl: biometrics: fingerprint: Set properties for IFAA
Change-Id: I0b1786721c951cd833d3c20f58cd0c8a70c08fae
2022-05-13 18:02:35 +02:00
LuK1337
873c871046
hidl: biometrics: fingerprint: Fix sde_drm.h include path on 5.4+ kernel
Change-Id: Idac59471ae329eabf8484cc1238c35dabaa64827
2022-05-13 18:02:35 +02:00
Abhishek Aggarwal
06a86b7809
hidl: biometrics: fingerprint: Add surfaceflinger extension lib
Change-Id: I51fb56c0a20e3cac83afb46ed6a6e2f967159d18
2022-05-13 18:02:35 +02:00
C457
cd3f74f3d0
hidl: biometrics: fingerprint: Add support for extCmd
* Xiaomi extends fingerprint_device_t by adding a new method called extCmd used to send vendor specific commands

Change-Id: Ic94f7b3fd28f7db81695e47f54ce6fa89248bde9
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
39bd52cad5
hidl: biometrics: fingerprint: Add multiple HAL loading support
* Support for sm8450, sm8350, sm6375, sm7325, sm7350, sm8250, sm7250, sm8150, sm6250, sm6150, sdm845, sdm710, msm8998, sdm660

Change-Id: I114640c8520c73213390ad35fa29d218e1852757
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
c3f110d5f8
hidl: biometrics: fingerprint: Move fingerprint HIDL to 2.3
Change-Id: I2e5ed64ac7ae2f1003503072666204c0788a003a
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
3c98e02fe1
hidl: biometrics: fingerprint: Drop LOG_VERBOSE
* It's useless since it's the same as LOG_TAG

Change-Id: I1a15ea85f840b7af6d41b59cf01b0ec3c2457705
2022-05-13 18:02:35 +02:00
Jake Weinstein
3b0420cf72
hidl: biometrics: fingerprint: Revert "fpc: keep fpc in system-background"
While Google found that fingerprint HAL is insensitive to
increased CPU throughput, we have not found that to be the
case. Allowing more CPUs makes fingerprint unlock up to
2x faster in some tests.

SM8250 device with fingerprint on display:
- Before: 3128ms
- After: 944ms

SDM845 device with fingerprint on the power button:
- Before: 1146ms
- After: 688ms

This reverts commit d0fdb4431d26e4f257b8867f67ffd9b4a9818d9e.

Change-Id: I7a28d82caee2b8503b974a8226b29240eb072ceb
2022-05-13 18:02:35 +02:00
Bruno Martins
3067c23575
hidl: biometrics: fingerprint: Use pragma once
Change-Id: I335b0a1b73effa6f9c0b0866052d74dc524ad99b
2022-05-13 18:02:35 +02:00
LuK1337
f5895272f6
hidl: biometrics: fingerprint: Add (and run) clang-format file
Change-Id: Ibb4a56ef02a404717512d7a7f99bc31e2ce442a4
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
a1c2889d31
hidl: biometrics: fingerprint: Update licensing
Change-Id: I3c4b6f9cac9c560b592bda2d2b662f59024f5202
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
5ca97f754e
hidl: biometrics: fingerprint: Rebrand to Xiaomi
Change-Id: Icd5dfab05ca571ef36e8b2b1ce1bad9239877282
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
285a312393
hidl: biometrics: fingerprint: Import AOSP fingerprint hardware header
This will be customized with Xiaomi changes further down the line.

Based off 1ae7379baa

Change-Id: I9fff79d0052c09bc17fcd58489c828cb435c7498
2022-05-13 18:02:35 +02:00
Sebastiano Barezzi
104de29895
hidl: biometrics: fingerprint: Import AOSP 2.1 HIDL service
Change-Id: I585fa0469e5186a86f29a11aa35aed2c25e78b55
2022-05-13 18:02:35 +02:00
luk1337
8a55af6b3c
touch: Make HIGH_TOUCH_POLLING_PATH configurable via Soong flag
Change-Id: I7649e084b2604c46f47c07c355913720935e1298
2022-05-13 18:02:35 +02:00
Ramii Ahmed
b1f26c0899
hidl: Implement vendor.lineage.touch@1.0 HAL for Xiaomi
* This can be used by any Xiaomi device that has a touch display that supports multiple sample rates and Xiaomi touch.
* Most newer Xiaomi phones with high screen refresh rates fit this category:
* e.g. Mi 10/Pro/Ultra/T/T Pro, Xiaomi SM8350 platform phones & Xiaomi SM6375 phones

Change-Id: Iaf956420157bbc978690fac9053d507ccaea847a
2022-05-13 18:02:35 +02:00
LuK1337
9291711cb7
powershare: Change fallback enable value to 0
Some variants don't support wireless charging, thus this file is
missing. Ideally we wouldn't run powershare at all on them, but this is
still an improvement.

Change-Id: Ie58aaac2a73055d8d2cfe7a73b9b479493eb2bcf
2022-05-13 18:02:35 +02:00
Bruno Martins
7168cbff7f
hidl: powershare: Use pragma once
Change-Id: I9cfeed5e79c35139f7532c522dad0ca25ed35fe1
2022-05-13 18:02:35 +02:00
LuK1337
8a05be348b
powershare: Treat non-zero value as enabled
On SM8350, we use trx_online to determine whether PowerShare is enabled.

Change-Id: I62d7448e6337696867a264cfd521379b53fe61f9
2022-05-13 18:02:35 +02:00
LuK1337
04053365b2
powershare: Make WIRELESS_TX_ENABLE_PATH configurable via Soong flag
Change-Id: I73a42f167c9d332f05e23bd00db19c0a1f9fe672
2022-05-13 18:02:35 +02:00
LuK1337
ac68cfefd7
hidl: Implement vendor.lineage.powershare@1.0 HAL for Xiaomi
* This feature is present in Xiaomi Mi 10/Pro/Ultra and for the Xiaomi
   family of SM8350, LAHAINA devices.

Change-Id: Icabcee87980611d97a837f86a52d94033de337ef
2022-05-13 18:02:35 +02:00