sdm845-common: power: Use monotonic time for interaction boost
Using the wall clock will cause boosts to be disabled when/if the clock is adjusted backward. Bug: 29191415 Bug: 29208304 Change-Id: I8af5f40b46d996ce7bccb8324fc186e2f3a5b267
This commit is contained in:
parent
9137790aed
commit
842f449872
3 changed files with 23 additions and 11 deletions
|
|
@ -42,6 +42,9 @@
|
|||
#define LOG_TAG "QCOM PowerHAL"
|
||||
#include <utils/Log.h>
|
||||
|
||||
#define USINSEC 1000000L
|
||||
#define NSINUS 1000L
|
||||
|
||||
char scaling_gov_path[4][80] = {"sys/devices/system/cpu/cpu0/cpufreq/scaling_governor",
|
||||
"sys/devices/system/cpu/cpu1/cpufreq/scaling_governor",
|
||||
"sys/devices/system/cpu/cpu2/cpufreq/scaling_governor",
|
||||
|
|
@ -331,3 +334,10 @@ void undo_initial_hint_action() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
long long calc_timespan_us(struct timespec start, struct timespec end) {
|
||||
long long diff_in_us = 0;
|
||||
diff_in_us += (end.tv_sec - start.tv_sec) * USINSEC;
|
||||
diff_in_us += (end.tv_nsec - start.tv_nsec) / NSINUS;
|
||||
return diff_in_us;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue