Commit Graph

339 Commits

Author SHA1 Message Date
Vladimir Mikhailov
7c575afade power: Handle launch and interaction hints
Co-authored-by: dianlujitao <dianlujitao@lineageos.org>
Co-authored-by: Michael Bestas <mkbestas@lineageos.org>
Co-authored-by: Quallenauge <Hamsi2k@freenet.de>
Co-authored-by: tomascus <arbiter1000@gmail.com>
Co-authored-by: Wei Wang <wvw@google.com>
Change-Id: I472a177e0a13b0c4201cf0b1e5ddee18a785b683
2023-10-29 22:13:01 +00:00
Quallenauge
b5dbefb18a power: Reduce log level of setBoost() method to VERBOSE.
This avoids flooding the log, when using the device.
I android.hardware.power-service-qti: Power setBoost: 0, duration: 351
I android.hardware.power-service-qti: Power setBoost: 1, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 1, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 1119
I android.hardware.power-service-qti: Power setBoost: 1, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 0
I android.hardware.power-service-qti: Power setBoost: 1, duration: 0
I android.hardware.power-service-qti: Power setBoost: 0, duration: 1492
I android.hardware.power-service-qti: Power setBoost: 1, duration: 0

Change-Id: I4e3c9ba79412875947593ea49739c3c30eabc429
2023-10-29 22:13:01 +00:00
Corinna Vinschen
da09e1ea1e power: perform_hint_action: return an error code
So far the caller never knows if setting the hint actually worked.
This leads to a potential disconnect between the actual setting and the
UI because set_power_profile simply assumes perform_hint_action worked.

Return an error code or 0, so the callers can check for success.

Change-Id: I180a367e9d8581a63dfa703046b37bc5cae8c6cb
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
2023-10-29 22:13:01 +00:00
Michael Bestas
3b9e68c9a7 power: Use declared enums where possible
Change-Id: I079490f8ff61bf278dd69eb89b9dae5ce42e6052
2023-10-29 22:13:01 +00:00
dianlujitao
8b857ce64a power: Add known perf hint IDs
Author: Zhao Wei Liew <zhaoweiliew@gmail.com>
Date:   Tue Jun 21 10:44:49 2016 +0800

    power: msm8996: Support boost and perf profile hints

    Change-Id: I010d4d1d3fb495e523b065c11ca95c4305530f9f

Author: Zhao Wei Liew <zhaoweiliew@gmail.com>
Date:   Thu Oct 20 21:51:09 2016 +0800

    power: msm8937: Improve boost values

     * Bring boost values more in line with CAF's recommended values
     * Make performance profile values saner

    Change-Id: I9827d25a347a8ab959c766a71e30b3d29267983f

Author: Diogo Ferreira <diogo@underdev.org>
Date:   Sun May 7 11:00:12 2017 +0100

    power: Use the correct opcode for STOR_CLK_SCALE_DIS

    This is actually wrong, 0x42C0C000 is the opcode for SWAP_RATIO and
    0x42C10000 is the correct opcode for storage clock scale disabling.

    Change-Id: I6b1db525acf061ffe419011acd1f91525a27a35d

Author: dianlujitao <dianlujitao@lineageos.org>
Date:   Wed Sep 20 16:40:57 2017 +0800

    power: sdm660: Use declared enums

    Change-Id: I21691f9595f3730b9046012d1cae3951eb9da6a7

Author: dianlujitao <dianlujitao@lineageos.org>
Date:   Sat Sep 23 20:22:17 2017 +0800

    power: sdm660: Support boost and power profiles

     * perfd needs /vendor/etc/appboosts.xml on sdm660 platform.

    Change-Id: I92632da032ebd1a629fcc0b9c7e1811dee9117fe

Author: dianlujitao <dianlujitao@lineageos.org>
Date:   Thu Sep 6 21:43:14 2018 +0800

    power: Clean up hint IDs

     * Group MPCTL v3 opcodes according to major type.
     * Remove some unused/dead opcodes.
     * Rename some misleading/inconsistency names.

    Change-Id: I3a06930c8fff18a50f77cb230951dbd43d62fed3

Change-Id: I611ef9651486f6f3caa6a6d6a08434912c114659
2023-10-29 22:13:01 +00:00
dianlujitao
def8f1147b power: msm8996: Support VR + Sustained performance mode
Change-Id: I2eabcf48eac01d2f06050dea2392a8b853fc3129
2023-10-29 22:13:01 +00:00
Michael Bestas
2ab4d32f3d power: Clean up and fix set_interactive_override
* Remove debug logs and useless comments
* Consistent return values
* Check if set_interactive_override handled hints and print
  info message if it didn't

Change-Id: Iff9f7327ba71c282e34ff3143c45a3f40f72fc92
2023-10-29 22:13:01 +00:00
Michael Bestas
1c4f9ef732 power: Clean up and fix video encode/decode hint handling
* Unify code style for non legacy SoCs

Change-Id: Ieb84e6d6c8d762614e21267e81e6057aa64b36dd
2023-10-29 22:13:01 +00:00
nico
39bf21a7c2 power: Find online CPU core and get scaling governor
Change-Id: I90aed1aaee8d3819d1de921674da924efd0a6c4f
2023-10-29 22:13:01 +00:00
Corinna Vinschen
e86755b9fd power: fix sysfs_read/sysfs_write usage
* The incoming path to sysfs_read/sysfs_write should be const, as in
  open(2) call.
* Redefine scaling_gov_path as const pointer array.
* Since sysfs_read works on a simple absolute path anyway, make sure
  the scaling_gov_path paths *are* absolute.  Otherwise the code only
  works if Power HAL has / as CWD, which is a bit fragile.

Change-Id: I70c08f8137842569514bcb3f6e0617d46044e6ab
Signed-off-by: Corinna Vinschen <xda@vinschen.de>
2023-10-29 22:13:01 +00:00
Zhao Wei Liew
d62a558e09 power: Use ARRAY_SIZE macro where possible
Change-Id: Ie47d0e6b91b7bba378b0fdf53a345a021b0c2d48
2023-10-29 22:13:01 +00:00
Zhao Wei Liew
ba1c2a36fc power: Simplify display_hint_sent
Check for whether the display hint has been sent at the start
of the set_interactive() function in the common powerHAL.

This gets rid of the need to replicate the same variable in
every target-specific powerHAL that implements the
set_interactive_override() function.

Change-Id: If7dd11fcb578211f4f83847f9257232c4138ce53
2023-10-29 22:13:01 +00:00
Zhao Wei Liew
f87f9daa0c power: Cache SOC ID checks for future queries
Currently, get_soc_id() is queried on every SOC ID check in the
SDM660, MSM8916, MSM8952, MSM8953 and MSM8974-family HALs.
This results in extraneous file operations on every SOC ID check.

Cache the result of get_soc_id() during the first query to
reduce the number of file operations being made.

This also brings back the behaviour in LineageOS 15.1 when the
HALs were still stored in device/qcom/common.

Change-Id: Ic17dbf12e7f9ecdb47b73a580f467df9ad630aa0
2023-10-29 22:13:01 +00:00
Zhao Wei Liew
7ff6620596 power: Simplify soc_id checks
- Get soc_id in a common util function
 - Return boolean values for the target-specific soc_id checks

Change-Id: I038c435d28855859f36566de7acf881037d070f2
2023-10-29 22:13:01 +00:00
Ethan Chen
3fac864721 power: Use is_interactive_governor/is_schedutil_governor
* Don't copy paste the same governor check code multiple times

Change-Id: I2258553deb02a5ae149b0a96aca5fe5584f0ea14
2023-10-29 22:13:01 +00:00
Michael Bestas
b3a670611c power: Introduce is_schedutil_governor
Change-Id: Ie3cfd0cb11b368cd9399a6dcea6b6cfa1f4d7916
2023-10-29 22:13:01 +00:00
Michael Bestas
4a5a366f21 power: Avoid interaction build errors
Change-Id: I77942f23a9c617abac1a8533cfc1fd7bfa7f66e8
2023-10-29 22:13:01 +00:00
Adrian Salido
d12031bf27 power: Fix power hal compiler warnings
Bug: 30432975
Test: compile power hal for walleye without warnings
Change-Id: I0d90c26462c662690f8a179250000b9a449a109f
Signed-off-by: Arian <arian.kulmer@web.de>
2023-10-29 22:13:01 +00:00
Ethan Chen
48bfafcf39 power: Use log/log.h instead of utils/Log.h
Change-Id: I827c7f5ab27548eec8d6e4ee27a72fa883025002
2023-10-29 22:13:01 +00:00
Michael Bestas
0b6459f08e power: clang-format
* Using AOSP interface .clang-format
* Clean Android.mk while we are at it

Change-Id: I630f72e3dffb676ca1930e72945e897f62103ada
Signed-off-by: Arian <arian.kulmer@web.de>
2023-10-29 22:13:01 +00:00
Michael Bestas
39e18570bf power: Compile with -Wall -Wextra -Werror
* And fix the build errors

Change-Id: I183203edfd92d4672893d74aa7428bc9f5e17772
2023-10-29 22:13:01 +00:00
Paul Keith
0c54d07956 power: Fix a few compiler warnings
* And unify styling a little bit

Change-Id: I7f9bb43a534e352fdd7693ff975749864f8addb3
2023-10-29 22:13:01 +00:00
Michael Bestas
2759522e9d power: msm8996: Remove dead code
Change-Id: Ia26e5989a7063baad048e017715fe0f31332fb75
2023-10-29 22:13:01 +00:00
Michael Bestas
ab79ce0757 power: Remove unused list utils
* They were added in 6ec1206b246a164acfb0aa7b43af9b04c759063e
  but never used

Change-Id: I0f0d0336cd91715eb8aa4dcb42ae1e449da8603b
2023-10-29 22:13:01 +00:00
Michael Bestas
37e4bc88e6 power: Remove leftover support for ondemand governor
Change-Id: Id4c2aa5efa7101535a7311e34529e0b90c7491f1
2023-10-29 22:13:01 +00:00
Michael Bestas
1361eb5186 power: Remove leftover support for msm-dcvs governor
* This is not used by any recent qcom SoC
  and not used by any SoC using this HAL.

Change-Id: If9b2997104bcd5e3ff27fc39c75590d07e813f85
2023-10-29 22:13:01 +00:00
Michael Bestas
2b371015ef power: Remove unused camera_hint_ref_count
* These were part of the commit that added mutex locks
  for camera hints. We have now removed the locks so
  this is no longer necessary

Change-Id: I38b91ce4e8fc811b8d9a04e6ec20521adde1b264
2023-10-29 22:13:01 +00:00
dianlujitao
1c368078d1 power: Remove mutex to hints
* No longer needed.

Change-Id: I09fc90b4e5399b3f3b8a409edf3f57361da90100
2023-10-29 22:13:01 +00:00
Rashed Abdel-Tawab
cd6e36030a power: Remove unused arg from power_hint_override/set_interactive_override
Change-Id: If45b59915022b563d4c5c9bf454b02b431a97833
2023-10-29 22:13:01 +00:00
Michael Bestas
069801dcb7 power: Remove HBTP support
* Not used

Change-Id: Ib8e9f51fe92c0bce8cde3ee7c7960c1dac740d35
2023-10-29 22:13:01 +00:00
nico
5908501290 power: Remove SCALING_MIN_FREQ that was used for 8939
Change-Id: I57545364ab331f171d1ee1c26787189668c60a91
2023-10-29 22:13:01 +00:00
Michael Bestas
cbf3615141 power: Remove powerhintparser
* The usage of this code was removed in commit
  0c226b7921b421dd24363f15aefef1236aa25287
* powerhint.xml is now read by libqti-perfd

Change-Id: I498ad19d0bb43124e4518c5a4f20191a2c122997
2023-10-29 22:13:01 +00:00
Michael Bestas
d526c7c49c power: Rename power-8952.c to power-8937.c
* Latest power-8952.c is used for msm8937 with mpctl V3.
  Rename the file to reflect msm8952 is no longer supported.

Change-Id: Iccd2a3c0abed2ef10d5f6c2182c0509a2fbe611d
2023-10-26 16:40:36 +03:00
Michael Bestas
dbaf7b3edb power: Drop unsupported platforms
Change-Id: I757c0810ae24eb36bbd1a8c02108f111d96c1eca
2023-10-26 16:40:10 +03:00
LuK1337
de33daea0c power: Allow device specific hooks for setMode, isModeSupported
* Some devices may want to implement custom hooks

Change-Id: Icb2d66471ec649a69b1e69849fd86282775052cb
2023-10-26 16:39:26 +03:00
Christopher R. Palmer
a7fabc8b44 power: Allow devices to write their own platform specific bits
Using this hook, any device should be able to reuse the majority of the
powerhal and fork only power-<platform>.c if they feel that they need
the ability to provide more specific tuning of the hints/etc. for
their device.

Change-Id: I013a3ec3ddccbe6f74f3dacf456cc6e8b3ab3430
2023-10-26 16:39:26 +03:00
Steve Kondik
e2732b782f power: Allow device specific hooks for set_interactive
* Some devices may want to implement custom hooks

Change-Id: I9be8023c8134b3c262f27b43a28bec0e14c0fd7f
2023-10-26 16:39:26 +03:00
Steve Kondik
6b46a293df power: Add support for tap-to-wake feature control
Co-authored-by: Arian <arian.kulmer@web.de>
Co-authored-by: LuK1337 <priv.luk@gmail.com>
Change-Id: I545902b29f4828c127bc32def6e30b67ce4a3aa7
2023-10-26 16:38:59 +03:00
Michael Bestas
9df9caa266 power: Add -qti suffix to module name
* Prevent conflict with other HALs

Change-Id: Icf1216410db26c3bb811d7aedde03e6d2f87e3cc
Signed-off-by: Sebastiano Barezzi <barezzisebastiano@gmail.com>
2023-10-26 16:36:36 +03:00
Michael Bestas
da9c55ae81 Merge tag 'LA.UM.9.12.r1-16200-SMxx50.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power into lineage-21.0
"LA.UM.9.12.r1-16200-SMxx50.QSSI12.0"

* tag 'LA.UM.9.12.r1-16200-SMxx50.QSSI12.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power:
  power: Modify powerhint for encode case
  power: Enable powerhint for khaje
  Power: Specify stable AIDL version number
  Power:Changes made for Bengal powerhint.xml
  Power: Correcting target name in powerhint.xml
  Power : Clean up of opcodes in powerhints
  power: add check for shared pointer
  Kona Powerhint: Change the VR hints
  qvr powerhints
  Power: update powerhint for Single rank DDR
  Power : Modified make file to include Trinket
  Power : AIDL support for Trinket
  power: update power hint data for lagoon
  Power: Tuned  scheduler for  480FPS use-case
  Power : Modified make file to include Bengal
  power: update power hint data for lagoon
  Power: Updating camera settings
  Power: Updating camera settings
  power : Modified make file to include Talos
  power: Add supported modes
  power: Add supported modes
  power: Added copyrights info in xml.
  power: conversion from hidl to aidl.
  power: Added copyrights info in xml
  Power: Up/down scheduler Tuning for  480FPS use-case
  power : opcode for sample_ms

 Conflicts:
	Android.mk
	Power.cpp
	power-vendor-product.mk
	power.xml

Change-Id: Ic5b9e4380c940cacf06183b3613a60e2b3404d6f
2023-10-24 16:21:55 +03:00
Michael Bestas
5f06927aa5 Merge tag 'LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power into lineage-21.0
"LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0"

* tag 'LA.UM.9.14.r1-22900.01-LAHAINA.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power:
  power: Modify powerhint for Camera cases
  Holi: Powerhint changes to meet camera FPS
  Blair: Powerhint changes to meet camera FPS
  Power : Adding blair target hints in powerhint.xml
  Power : Add power tuning  for sHDR encode use case
  Power : Adding powerhint.xml for blair target
  Power : Add power tuning  for sHDR encode use case
  power: update powerhint for yupik
  power: Update powerhint for yupik
  Power: Modify powerhint for cedros
  power: add check for shared pointer
  Revert "power: Add supported modes"
  power: Add supported modes
  Revert "power : Modified make file to include Lahaina"
  power : Modified make file to include Lahaina Addition of powerhint.xml for the product Lahaina

Change-Id: I2fabc727559f68765986e5480a6f075ed67d81bd
2023-10-24 16:20:14 +03:00
Michael Bestas
754aa42a6a Merge tag 'LA.VENDOR.1.0.r1-23800-WAIPIO.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power into lineage-21.0
"LA.VENDOR.1.0.r1-23800-WAIPIO.QSSI14.0"

* tag 'LA.VENDOR.1.0.r1-23800-WAIPIO.QSSI14.0' of https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/power:
  power: Replace library name with ndk from ndk_platform for upgrade sdk version
  Power: Modifying powerhint.xml for Halliday target
  power: adjust powerhint for halliday
  power: added power hint for sHDR case to support parrot and ravelin
  power: modify tunings for camera close hint
  Power : Add power tuning  for sHDR encode use case
  Power: Modifying powerhint.xml for Halliday Target
  Powerhint file for Ravelin
  Power: tuning of 30fps use case
  power: modified powerhint file for ravelin
  Power : Set minCpu freq for preview to meet FPS
  Power: Adding powerhint.xml for Halliday target
  power: updated power for ravelin
  power: improve silver capped freq for taro
  Power: tuning of snapshot, 30fps and ZSL use cases
  power : revised tunings for parrot
  power: update power hint for ukee.
  power: add powerhint for video decode 30 fps secure/non-secure tunning
  power: Add support for EXPENSIVE_RENDERING
  Power : Modify powerhint file for tofino target
  power: tuning of camera open and close
  Power : Modify powerhint file for parrot target
  power : Modify powerhint file for parrot target
  power : Modify powerhint file for parrot target
  power: added powerhint.xml for neo target
  Revert "Power:Replace library name from ndk_platform to ndk"
  power : add powerhint file for parrot target
  Revert "Power : Add tunings for 240FPS decode cases."
  Power : Add tunings for 240FPS decode cases.
  Revert "Power: Update powerhint with CPU,Bus DCVS settings"
  Revert "[Waipio] Update CPU and DDR settimgs for camera cases"
  [Waipio] Update CPU and DDR settimgs for camera cases
  Power: Update powerhint with CPU,Bus DCVS settings
  Power: Add powerhint.xml for waipio
  Specify stable AIDL version number.

 Conflicts:
	Android.mk
	Power.cpp
	power-common.c
	power-common.h
	power-vendor-product.mk

Change-Id: Ide4d0b357670adaec4ce47b13dee0e393b8c08b4
2023-10-24 16:19:45 +03:00
Chirayu Desai
57558152f0 Add .gitupstream file
Change-Id: I3ff3abff393fce530e09c9dcb2e4d56ef5cd5ed5
2023-10-24 16:15:46 +03:00
Linux Build Service Account
2ed06189df Merge 6766a136c3 on remote branch
Change-Id: I4fb9352327ca2866ae023acdb39de3f1a1f6e7b1
2023-09-09 00:29:11 -07:00
Linux Build Service Account
bd7b462ccd Merge 091da968f5 on remote branch
Change-Id: I6f3f839d5cda23a281b09c3a8f91fd00c6f3ac66
2023-08-30 23:26:27 -07:00
Surya Prakash
d8acd62f9d power: modified powerhint file for crow
powerhint changes for crow

Change-Id: I4a3cc5db73fa975453e4409672457954c05d657a
2023-08-15 05:10:57 -07:00
Linux Build Service Account
d9f3f77c97 Merge 1053b923c5 on remote branch
Change-Id: I6f9bcce6f95d9dcf2920c67174da47f9fa097bb8
2023-08-11 04:07:51 -07:00
Linux Build Service Account
091da968f5 Merge "power: Add powerhint.xml for trinket" into power.lnx.6.0 2023-08-10 23:24:12 -07:00
Linux Build Service Account
0a0093dbcb Merge "Power: Using only v3 powerhal version for this branch" into power.lnx.6.0 2023-08-10 23:23:13 -07:00
Surya Prakash
451dff40fc power: modified powerhint file for crow
powerhint changes for crow

Change-Id: I4a3cc5db73fa975453e4409672457954c05d657a
2023-08-10 11:19:06 +05:30