summaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
authorBeYkeRYkt <beykerykt@gmail.com>2018-12-13 06:42:35 +0900
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:57 +0300
commitef7a7ed7e04d113afdbe96ca07f55dd74111cc3c (patch)
tree7b2fac246a8614a6deda51eaacc7d5c8d77ee063 /utils.c
parent2c5b2b8afe66195d926adc0e4085b36625f2f4b0 (diff)
downloadvendor_qcom_opensource_power-ef7a7ed7e04d113afdbe96ca07f55dd74111cc3c.tar.gz
vendor_qcom_opensource_power-ef7a7ed7e04d113afdbe96ca07f55dd74111cc3c.tar.bz2
vendor_qcom_opensource_power-ef7a7ed7e04d113afdbe96ca07f55dd74111cc3c.zip
power: Handle launch and interaction hints for perf HAL platforms
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
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 38b5803..2ad301f 100644
--- a/utils.c
+++ b/utils.c
@@ -256,6 +256,20 @@ int perf_hint_enable(int hint_id, int duration) {
return lock_handle;
}
+// Same as perf_hint_enable, but with the ability to
+// choose the type
+int perf_hint_enable_with_type(int hint_id, int duration, int type) {
+ int lock_handle = 0;
+
+ if (qcopt_handle) {
+ if (perf_hint) {
+ lock_handle = perf_hint(hint_id, NULL, duration, type);
+ if (lock_handle == -1) ALOGE("Failed to acquire lock.");
+ }
+ }
+ return lock_handle;
+}
+
void release_request(int lock_handle) {
if (qcopt_handle && perf_lock_rel) perf_lock_rel(lock_handle);
}