summaryrefslogtreecommitdiffstats
path: root/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* power: Handle launch and interaction hints for perf HAL platformsBeYkeRYkt2019-10-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: BeYkeRYkt <beykerykt@gmail.com> Date: Thu Dec 13 06:42:35 2018 +0900 power: Handle launch and interaction hints for perf HAL platforms * MP-CTL does not handle POWER_HINT_INTERACTION and POWER_HINT_LAUNCH directly. Requests for processing are sent by Qualcomm BoostFramework (QPerformance) at the framework service level. Since we do not have BoostFramework, process POWER_HINT_INTERACTION and POWER_HINT_LAUNCH in PowerHAL to ensure a sufficient level of performance. * For proper operation, perfboostsconfig.xml file is required. Change-Id: I4c67d886c9dd74ae07094d32bdffc8ef403e04e7 Author: tomascus <arbiter1000@gmail.com> Date: Wed Feb 13 14:42:27 2019 +1100 power: don't use SCROLL_PREFILING The current use of the SCROLL_PREFILING hint hurts scroll performance and results in a lot of dropped frames. The hint ID corresponding to SCROLL_PREFILING only takes into effect for a default timeout value of 80 ms (as found in perfboostsconfig.xml), while the duration value in the process_interaction_hint function runs for a much longer time, from 1500 ms up to 5000 ms (bounds of kMinFlingDuration and kMaxInteractiveDuration). During the period of time, when the timeout value has elapsed and current time is less than duration, another interaction hint cannot be processed. Therefore, if the user decides to scroll during this period, high frame drops can be experienced as the CPU freq isn't raised by processing another hint to account for this additional scrolling. By only using SCROLL_VERTICAL, fluidity can be maintained, improving user experience. Furthmore, kMinInteractiveDuration has been lowered to 400 ms for some platforms as it is more than sufficient to maintain fluidity (minimal frames dropped) while scrolling. Change-Id: I42edd07a67c7dca43a10ae2fa1b44b64b7794b43 commit e9063a6956974a2e33652e2df0ecac991ee84c80 Author: tomascus <arbiter1000@gmail.com> Date: Tue Feb 19 17:15:58 2019 +1100 power: Release launch boost perflock when launch is completed Currently, the launch boost perflock is held for a fixed duration, either specified in perfboostsconfig.xml for perf HAL platforms or hardcoded in the powerHAL for non-perf HAL platforms. Using a fixed duration for this perflock has two shortcomings: * perflock can be held for too long, causing the CPU freq and other resources to be boosted for too long even if the application has finished launching, resulting in excessive battery drainage * perflock can be held not long enough if it takes more than the timeout time to finish launch The framework sends out a powerhint for both when launch starts and when launch ends. The launch finish hint can be used to signal when to release the perflock. Reference: Wahoo power-libperfmgr Change-Id: I405cc453c5f58d9fb2583b9c6017f3964a0ce024 Change-Id: I8ef6a890bc191f9504980707107750a720b50da3
* power: Use monotonic time for interaction boostWei Wang2019-10-231-0/+10
| | | | | | | | | | Using the wall clock will cause boosts to be disabled when/if the clock is adjusted backward. Bug: 29191415 Bug: 29208304 Change-Id: I8af5f40b46d996ce7bccb8324fc186e2f3a5b267 (cherry picked from commit 2bf13f822cf39123ee0e97e40caf1288ba4f457a)
* power: perform_hint_action: return an error codeCorinna Vinschen2019-10-231-34/+34
| | | | | | | | | | | 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>
* power: Find online CPU core and get scaling governornico2019-10-231-13/+12
| | | | Change-Id: I90aed1aaee8d3819d1de921674da924efd0a6c4f
* power: fix sysfs_read/sysfs_write usageCorinna Vinschen2019-10-231-6/+6
| | | | | | | | | | | | * 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>
* power: add back check for ro.vendor.extension_libraryCorinna Vinschen2019-10-231-2/+11
| | | | | | | | | | | | | | This partially reverts I0ce40bbefb8c867dda8ee5eb1f948af2106e692d, "power: Using PerfHAL API". Especially older systems don't provide libqti-perfd-client.so but this is hardcoded since the aforementioned change. Use the former code checking for ro.vendor.extension_library and try to load that library if the property exists before falling back to loading libqti-perfd-client.so. Change-Id: If89e3b88062be10af7cfd43b6ba92a22fda32754 Signed-off-by: Corinna Vinschen <xda@vinschen.de>
* power: Simplify soc_id checksZhao Wei Liew2019-10-231-0/+24
| | | | | | | - Get soc_id in a common util function - Return boolean values for the target-specific soc_id checks Change-Id: I038c435d28855859f36566de7acf881037d070f2
* power: Introduce is_schedutil_governorMichael Bestas2019-10-231-0/+5
| | | | Change-Id: Ie3cfd0cb11b368cd9399a6dcea6b6cfa1f4d7916
* power: clang-formatMichael Bestas2019-10-231-96/+54
| | | | | | | * Using AOSP interface .clang-format * Clean Android.mk while we are at it Change-Id: I630f72e3dffb676ca1930e72945e897f62103ada
* power: Use log/log.h instead of utils/Log.hEthan Chen2019-10-231-1/+1
| | | | Change-Id: I827c7f5ab27548eec8d6e4ee27a72fa883025002
* power: Fix a few compiler warningsPaul Keith2019-10-231-3/+6
| | | | | | * And unify styling a little bit Change-Id: I7f9bb43a534e352fdd7693ff975749864f8addb3
* power: Modify definitions of Perf client callsAnanth Raghavan Subramanian2019-05-281-4/+5
| | | | | | Now conforms to the exact definition in the shared perf library Change-Id: I6f92140b42800072283c2f3a52e6814fc0f1d5d2
* Clean up code and add generic hint handlingAnanth Raghavan Subramanian2018-12-181-2/+2
| | | | | | | Removed unused code and added generic hint handling to power.c file, does not need to be device specific anymore. Change-Id: I0d4e2a73de0ce4d3735314d2e49ba58c23eb313c
* power: Fix VNDK Compilation ErrorsVinay Verma2018-06-041-0/+1
| | | | | | | VNDK restrictions doesn't includes standard headers by default, add them explicitly. Change-Id: I4c72a28ffa141ecadcfe47cc7c1f62f2a0c8576e
* Relocate power HAL from device/qcom/commonDavid Ng2018-05-241-0/+361
Split module from combined device/qcom/common project into its own project. Relocation of some files from device/qcom/common at b5ce80cb1f60759a142a9338104d3adf3303ec0c. Change-Id: I6c13729a822f6fb9b5574b759ae9ec12154be464