diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2019-10-06 01:34:17 +0300 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:57 +0300 |
commit | 43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f (patch) | |
tree | a5e102806cc781d39a35512d47c0b1a0781d3391 /power-660.c | |
parent | 7af0fea40b41e90123908e0ea104f70dfc370edb (diff) | |
download | vendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.tar.gz vendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.tar.bz2 vendor_qcom_opensource_power-43b9e3524f90a59e59f4d6a1f0e7f6629e4d029f.zip |
power: Clean up and fix set_interactive_override
* Remove debug logs and useless comments
* Consistent return values
* Add back display hints for legacy platforms, they used to live in
power-common.c but removed in commit 561cffcbfa66192e839e040d2da3bff2ecf8dcac
* Check if set_interactive_override handled hints and print
info message if it didn't
Change-Id: Iff9f7327ba71c282e34ff3143c45a3f40f72fc92
Diffstat (limited to 'power-660.c')
-rw-r--r-- | power-660.c | 64 |
1 files changed, 28 insertions, 36 deletions
diff --git a/power-660.c b/power-660.c index 23a91b6..e246f3b 100644 --- a/power-660.c +++ b/power-660.c @@ -49,8 +49,6 @@ #include "power-common.h" #include "utils.h" -#define MIN_VAL(X, Y) ((X > Y) ? (Y) : (X)) - static int video_encode_hint_sent; /** @@ -153,52 +151,46 @@ int power_hint_override(power_hint_t hint, void* data) { int set_interactive_override(int on) { char governor[80]; - int resource_values[20]; - int num_resources; - - ALOGI("Got set_interactive hint"); if (get_scaling_governor(governor, sizeof(governor)) == -1) { ALOGE("Can't obtain scaling governor."); - return HINT_HANDLED; + return HINT_NONE; } if (!on) { - /* Display off. */ + /* Display off */ if (is_interactive_governor(governor)) { - /* - 1. CPUfreq params - - hispeed freq for big - 1113Mhz - - go hispeed load for big - 95 - - above_hispeed_delay for big - 40ms - 2. BusDCVS V2 params - - Sample_ms of 10ms - */ if (is_target_SDM630()) { - int res[] = {0x41414000, 0x459, 0x41410000, 0x5F, 0x41400000, 0x4, 0x41820000, 0xA}; - memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = ARRAY_SIZE(res); - } - /* - 1. CPUfreq params - - hispeed freq for little - 902Mhz - - go hispeed load for little - 95 - - above_hispeed_delay for little - 40ms - 2. BusDCVS V2 params + /* + 1. CPUfreq params + - hispeed freq for big - 1113Mhz + - go hispeed load for big - 95 + - above_hispeed_delay for big - 40ms + 2. BusDCVS V2 params - Sample_ms of 10ms - 3. Sched group upmigrate - 500 - */ - else { - int res[] = {0x41414100, 0x386, 0x41410100, 0x5F, 0x41400100, - 0x4, 0x41820000, 0xA, 0x40C54000, 0x1F4}; - memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - num_resources = ARRAY_SIZE(res); + */ + int resource_values[] = {0x41414000, 0x459, 0x41410000, 0x5F, + 0x41400000, 0x4, 0x41820000, 0xA}; + perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, + ARRAY_SIZE(resource_values)); + } else { + /* + 1. CPUfreq params + - hispeed freq for little - 902Mhz + - go hispeed load for little - 95 + - above_hispeed_delay for little - 40ms + 2. BusDCVS V2 params + - Sample_ms of 10ms + 3. Sched group upmigrate - 500 + */ + int resource_values[] = {0x41414100, 0x386, 0x41410100, 0x5F, 0x41400100, + 0x4, 0x41820000, 0xA, 0x40C54000, 0x1F4}; + perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, + ARRAY_SIZE(resource_values)); } - perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, num_resources); } - } else { - /* Display on. */ + /* Display on */ if (is_interactive_governor(governor)) { undo_hint_action(DISPLAY_STATE_HINT_ID); } |