Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 3 | * Copyright (C) 2018 The LineageOS Project |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions are |
| 7 | * met: |
| 8 | * * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above |
| 11 | * copyright notice, this list of conditions and the following |
| 12 | * disclaimer in the documentation and/or other materials provided |
| 13 | * with the distribution. |
| 14 | * * Neither the name of The Linux Foundation nor the names of its |
| 15 | * contributors may be used to endorse or promote products derived |
| 16 | * from this software without specific prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 25 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 27 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 28 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 30 | |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 31 | #define LOG_NIDEBUG 0 |
| 32 | |
| 33 | #include <errno.h> |
Craig Tatlor | adf8a1c | 2018-05-21 17:22:31 +0100 | [diff] [blame] | 34 | #include <time.h> |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 35 | #include <string.h> |
| 36 | #include <sys/types.h> |
| 37 | #include <sys/stat.h> |
| 38 | #include <fcntl.h> |
| 39 | #include <dlfcn.h> |
| 40 | #include <stdlib.h> |
| 41 | |
| 42 | #define LOG_TAG "QCOM PowerHAL" |
Ethan Chen | a42f4a8 | 2018-03-01 21:31:15 -0800 | [diff] [blame] | 43 | #include <log/log.h> |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 44 | #include <hardware/hardware.h> |
| 45 | #include <hardware/power.h> |
| 46 | |
| 47 | #include "utils.h" |
| 48 | #include "metadata-defs.h" |
| 49 | #include "hint-data.h" |
| 50 | #include "performance.h" |
| 51 | #include "power-common.h" |
| 52 | |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 53 | static int first_display_off_hint; |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 54 | |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 55 | static int current_power_profile = PROFILE_BALANCED; |
| 56 | |
Corinna Vinschen | 8169e39 | 2018-08-09 12:51:12 +0200 | [diff] [blame] | 57 | /* power save mode: max 2 CPUs, max 1.2 GHz */ |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 58 | static int profile_power_save[] = { |
| 59 | 0x0A03, |
| 60 | CPUS_ONLINE_MAX_LIMIT_2, |
Stefan Assmann | 651aa0f | 2018-07-23 18:42:02 +0200 | [diff] [blame] | 61 | CPU0_MAX_FREQ_NONTURBO_MAX + 1, |
| 62 | CPU1_MAX_FREQ_NONTURBO_MAX + 1, |
| 63 | CPU2_MAX_FREQ_NONTURBO_MAX + 1, |
| 64 | CPU3_MAX_FREQ_NONTURBO_MAX + 1 |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 65 | }; |
| 66 | |
Corinna Vinschen | 8169e39 | 2018-08-09 12:51:12 +0200 | [diff] [blame] | 67 | /* efficiency mode: max 2 CPUs, max 2.4 GHz */ |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 68 | static int profile_bias_power[] = { |
| 69 | 0x0A03, |
Stefan Assmann | 651aa0f | 2018-07-23 18:42:02 +0200 | [diff] [blame] | 70 | CPUS_ONLINE_MAX_LIMIT_2, |
| 71 | CPU0_MAX_FREQ_NONTURBO_MAX + 14, |
| 72 | CPU1_MAX_FREQ_NONTURBO_MAX + 14, |
| 73 | CPU2_MAX_FREQ_NONTURBO_MAX + 14, |
| 74 | CPU3_MAX_FREQ_NONTURBO_MAX + 14, |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 75 | }; |
| 76 | |
Corinna Vinschen | 8169e39 | 2018-08-09 12:51:12 +0200 | [diff] [blame] | 77 | /* quick mode: min 2 CPUs, min 1.1 GHz */ |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 78 | static int profile_bias_performance[] = { |
Stefan Assmann | 651aa0f | 2018-07-23 18:42:02 +0200 | [diff] [blame] | 79 | CPUS_ONLINE_MIN_2, |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 80 | CPU0_MIN_FREQ_NONTURBO_MAX + 1, |
| 81 | CPU1_MIN_FREQ_NONTURBO_MAX + 1, |
| 82 | CPU2_MIN_FREQ_NONTURBO_MAX + 1, |
Stefan Assmann | 651aa0f | 2018-07-23 18:42:02 +0200 | [diff] [blame] | 83 | CPU3_MIN_FREQ_NONTURBO_MAX + 1 |
| 84 | }; |
| 85 | |
Corinna Vinschen | 8169e39 | 2018-08-09 12:51:12 +0200 | [diff] [blame] | 86 | /* performance mode: min 4 CPUs, min 1.5 GHz */ |
Stefan Assmann | 651aa0f | 2018-07-23 18:42:02 +0200 | [diff] [blame] | 87 | static int profile_high_performance[] = { |
| 88 | 0x0901, |
| 89 | CPUS_ONLINE_MIN_4, |
| 90 | CPU0_MIN_FREQ_NONTURBO_MAX + 5, |
| 91 | CPU1_MIN_FREQ_NONTURBO_MAX + 5, |
| 92 | CPU2_MIN_FREQ_NONTURBO_MAX + 5, |
| 93 | CPU3_MIN_FREQ_NONTURBO_MAX + 5 |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | #ifdef INTERACTION_BOOST |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 97 | int get_number_of_profiles() |
| 98 | { |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 99 | return 5; |
| 100 | } |
| 101 | #endif |
| 102 | |
dianlujitao | 8780cb7 | 2019-02-23 20:24:57 +0800 | [diff] [blame] | 103 | static int set_power_profile(void *data) |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 104 | { |
dianlujitao | 8780cb7 | 2019-02-23 20:24:57 +0800 | [diff] [blame] | 105 | int profile = data ? *((int*)data) : 0; |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 106 | int ret = -EINVAL; |
| 107 | const char *profile_name = NULL; |
| 108 | |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 109 | if (profile == current_power_profile) |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 110 | return 0; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 111 | |
| 112 | ALOGV("%s: Profile=%d", __func__, profile); |
| 113 | |
| 114 | if (current_power_profile != PROFILE_BALANCED) { |
| 115 | undo_hint_action(DEFAULT_PROFILE_HINT_ID); |
| 116 | ALOGV("%s: Hint undone", __func__); |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 117 | current_power_profile = PROFILE_BALANCED; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | if (profile == PROFILE_POWER_SAVE) { |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 121 | ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_power_save, |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 122 | ARRAY_SIZE(profile_power_save)); |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 123 | profile_name = "powersave"; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 124 | |
| 125 | } else if (profile == PROFILE_HIGH_PERFORMANCE) { |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 126 | ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, |
| 127 | profile_high_performance, ARRAY_SIZE(profile_high_performance)); |
| 128 | profile_name = "performance"; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 129 | |
| 130 | } else if (profile == PROFILE_BIAS_POWER) { |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 131 | ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_power, |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 132 | ARRAY_SIZE(profile_bias_power)); |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 133 | profile_name = "bias power"; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 134 | |
| 135 | } else if (profile == PROFILE_BIAS_PERFORMANCE) { |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 136 | ret = perform_hint_action(DEFAULT_PROFILE_HINT_ID, |
| 137 | profile_bias_performance, ARRAY_SIZE(profile_bias_performance)); |
| 138 | profile_name = "bias perf"; |
| 139 | } else if (profile == PROFILE_BALANCED) { |
| 140 | ret = 0; |
| 141 | profile_name = "balanced"; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 142 | } |
| 143 | |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 144 | if (ret == 0) { |
| 145 | current_power_profile = profile; |
| 146 | ALOGD("%s: Set %s mode", __func__, profile_name); |
| 147 | } |
| 148 | return ret; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 149 | } |
| 150 | |
Corinna Vinschen | e7505c5 | 2019-10-25 23:17:56 +0200 | [diff] [blame] | 151 | /* fling boost: min 3 CPUs, min 1.5 GHz */ |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 152 | static int resources_interaction_fling_boost[] = { |
| 153 | CPUS_ONLINE_MIN_3, |
Corinna Vinschen | e7505c5 | 2019-10-25 23:17:56 +0200 | [diff] [blame] | 154 | CPU0_MIN_FREQ_NONTURBO_MAX + 5, |
| 155 | CPU1_MIN_FREQ_NONTURBO_MAX + 5, |
Corinna Vinschen | 591f590 | 2018-10-12 21:40:24 +0200 | [diff] [blame] | 156 | CPU2_MIN_FREQ_NONTURBO_MAX + 5, |
| 157 | CPU3_MIN_FREQ_NONTURBO_MAX + 5 |
| 158 | }; |
| 159 | |
Corinna Vinschen | e7505c5 | 2019-10-25 23:17:56 +0200 | [diff] [blame] | 160 | /* interactive boost: min 2 CPUs, min 1.5 GHz */ |
| 161 | static int resources_interaction_boost[] = { |
| 162 | CPUS_ONLINE_MIN_2, |
| 163 | CPU0_MIN_FREQ_NONTURBO_MAX + 5, |
| 164 | CPU1_MIN_FREQ_NONTURBO_MAX + 5, |
| 165 | CPU2_MIN_FREQ_NONTURBO_MAX + 5, |
| 166 | CPU3_MIN_FREQ_NONTURBO_MAX + 5 |
| 167 | }; |
| 168 | |
| 169 | /* lauch boost: min 3 CPUs, full power */ |
| 170 | static int resources_launch[] = { |
| 171 | CPUS_ONLINE_MIN_3, |
| 172 | CPU0_MIN_FREQ_TURBO_MAX, |
| 173 | CPU1_MIN_FREQ_TURBO_MAX, |
| 174 | CPU2_MIN_FREQ_TURBO_MAX, |
| 175 | CPU3_MIN_FREQ_TURBO_MAX |
| 176 | }; |
| 177 | |
Corinna Vinschen | f23b333 | 2018-08-06 10:58:20 +0200 | [diff] [blame] | 178 | const int DEFAULT_INTERACTIVE_DURATION = 200; /* ms */ |
Corinna Vinschen | 7dd0696 | 2018-08-06 21:14:12 +0200 | [diff] [blame] | 179 | const int MIN_FLING_DURATION = 1500; /* ms */ |
| 180 | const int MAX_INTERACTIVE_DURATION = 5000; /* ms */ |
tomascus | 8b038b1 | 2019-02-19 17:15:58 +1100 | [diff] [blame] | 181 | const int MAX_LAUNCH_DURATION = 5000; /* ms */ |
| 182 | |
| 183 | static int process_activity_launch_hint(void *data) |
| 184 | { |
| 185 | static int launch_handle = -1; |
| 186 | static int launch_mode = 0; |
| 187 | |
| 188 | // release lock early if launch has finished |
| 189 | if (!data) { |
| 190 | if (CHECK_HANDLE(launch_handle)) { |
| 191 | release_request(launch_handle); |
| 192 | launch_handle = -1; |
| 193 | } |
| 194 | launch_mode = 0; |
| 195 | return HINT_HANDLED; |
| 196 | } |
| 197 | |
| 198 | if (!launch_mode) { |
| 199 | launch_handle = interaction_with_handle(launch_handle, MAX_LAUNCH_DURATION, |
| 200 | ARRAY_SIZE(resources_launch), resources_launch); |
| 201 | if (!CHECK_HANDLE(launch_handle)) { |
| 202 | ALOGE("Failed to perform launch boost"); |
| 203 | return HINT_NONE; |
| 204 | } |
| 205 | launch_mode = 1; |
| 206 | } |
| 207 | return HINT_HANDLED; |
| 208 | } |
Corinna Vinschen | 7dd0696 | 2018-08-06 21:14:12 +0200 | [diff] [blame] | 209 | |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 210 | int power_hint_override(power_hint_t hint, void *data) |
| 211 | { |
| 212 | static struct timespec s_previous_boost_timespec; |
| 213 | struct timespec cur_boost_timespec; |
| 214 | long long elapsed_time; |
| 215 | static int s_previous_duration = 0; |
| 216 | int duration; |
| 217 | |
| 218 | if (hint == POWER_HINT_SET_PROFILE) { |
dianlujitao | 8780cb7 | 2019-02-23 20:24:57 +0800 | [diff] [blame] | 219 | if (set_power_profile(data) < 0) |
Corinna Vinschen | 8599e3c | 2018-08-26 22:11:49 +0200 | [diff] [blame] | 220 | ALOGE("Setting power profile failed. mpdecision not started?"); |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 221 | return HINT_HANDLED; |
| 222 | } |
| 223 | |
| 224 | // Skip other hints in high/low power modes |
| 225 | if (current_power_profile == PROFILE_POWER_SAVE || |
| 226 | current_power_profile == PROFILE_HIGH_PERFORMANCE) { |
| 227 | return HINT_HANDLED; |
| 228 | } |
| 229 | |
| 230 | switch (hint) { |
| 231 | case POWER_HINT_INTERACTION: |
Corinna Vinschen | 7dd0696 | 2018-08-06 21:14:12 +0200 | [diff] [blame] | 232 | duration = DEFAULT_INTERACTIVE_DURATION; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 233 | if (data) { |
| 234 | int input_duration = *((int*)data); |
| 235 | if (input_duration > duration) { |
Corinna Vinschen | 7dd0696 | 2018-08-06 21:14:12 +0200 | [diff] [blame] | 236 | duration = (input_duration > MAX_INTERACTIVE_DURATION) ? |
| 237 | MAX_INTERACTIVE_DURATION : input_duration; |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 238 | } |
| 239 | } |
| 240 | |
| 241 | clock_gettime(CLOCK_MONOTONIC, &cur_boost_timespec); |
| 242 | |
| 243 | elapsed_time = calc_timespan_us(s_previous_boost_timespec, cur_boost_timespec); |
| 244 | // don't hint if previous hint's duration covers this hint's duration |
| 245 | if ((s_previous_duration * 1000) > (elapsed_time + duration * 1000)) { |
| 246 | return HINT_HANDLED; |
| 247 | } |
| 248 | s_previous_boost_timespec = cur_boost_timespec; |
| 249 | s_previous_duration = duration; |
| 250 | |
Corinna Vinschen | 7dd0696 | 2018-08-06 21:14:12 +0200 | [diff] [blame] | 251 | if (duration >= MIN_FLING_DURATION) { |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 252 | interaction(duration, ARRAY_SIZE(resources_interaction_fling_boost), |
| 253 | resources_interaction_fling_boost); |
| 254 | } else { |
| 255 | interaction(duration, ARRAY_SIZE(resources_interaction_boost), |
| 256 | resources_interaction_boost); |
| 257 | } |
| 258 | return HINT_HANDLED; |
Corinna Vinschen | 591f590 | 2018-10-12 21:40:24 +0200 | [diff] [blame] | 259 | case POWER_HINT_LAUNCH: |
tomascus | 8b038b1 | 2019-02-19 17:15:58 +1100 | [diff] [blame] | 260 | return process_activity_launch_hint(data); |
Michael Bestas | 32ae7b0 | 2018-03-26 01:52:03 +0300 | [diff] [blame] | 261 | default: |
| 262 | break; |
| 263 | } |
| 264 | return HINT_NONE; |
| 265 | } |
| 266 | |
Rashed Abdel-Tawab | a2a7071 | 2017-12-31 01:21:40 +0200 | [diff] [blame] | 267 | int set_interactive_override(int on) |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 268 | { |
| 269 | char governor[80]; |
| 270 | |
| 271 | if (get_scaling_governor(governor, sizeof(governor)) == -1) { |
| 272 | ALOGE("Can't obtain scaling governor."); |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 273 | return HINT_NONE; |
| 274 | } |
| 275 | |
| 276 | if (!on) { |
| 277 | /* Display off. */ |
| 278 | /* |
| 279 | * We need to be able to identify the first display off hint |
| 280 | * and release the current lock holder |
| 281 | */ |
Zhao Wei Liew | be1a5d5 | 2016-07-19 20:01:01 +0800 | [diff] [blame] | 282 | if (!first_display_off_hint) { |
| 283 | undo_initial_hint_action(); |
| 284 | first_display_off_hint = 1; |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 285 | } |
Zhao Wei Liew | be1a5d5 | 2016-07-19 20:01:01 +0800 | [diff] [blame] | 286 | /* Used for all subsequent toggles to the display */ |
| 287 | undo_hint_action(DISPLAY_STATE_HINT_ID_2); |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 288 | |
Michael Bestas | fc62e7c | 2018-03-25 23:14:21 +0300 | [diff] [blame] | 289 | if (is_ondemand_governor(governor)) { |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 290 | int resource_values[] = { |
| 291 | MS_500, SYNC_FREQ_600, OPTIMAL_FREQ_600, THREAD_MIGRATION_SYNC_OFF |
| 292 | }; |
Zhao Wei Liew | 5a81c9a | 2016-06-26 21:29:34 +0800 | [diff] [blame] | 293 | perform_hint_action(DISPLAY_STATE_HINT_ID, |
| 294 | resource_values, ARRAY_SIZE(resource_values)); |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 295 | } |
| 296 | } else { |
| 297 | /* Display on */ |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 298 | int resource_values2[] = { |
| 299 | CPUS_ONLINE_MIN_2 |
| 300 | }; |
Zhao Wei Liew | be1a5d5 | 2016-07-19 20:01:01 +0800 | [diff] [blame] | 301 | perform_hint_action(DISPLAY_STATE_HINT_ID_2, |
| 302 | resource_values2, ARRAY_SIZE(resource_values2)); |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 303 | |
Michael Bestas | fc62e7c | 2018-03-25 23:14:21 +0300 | [diff] [blame] | 304 | if (is_ondemand_governor(governor)) { |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 305 | undo_hint_action(DISPLAY_STATE_HINT_ID); |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 306 | } |
| 307 | } |
Michael Bestas | 47636f6 | 2018-05-25 21:30:28 +0300 | [diff] [blame] | 308 | return HINT_HANDLED; |
Dilip Gudlur | 4eca13c | 2014-01-14 15:34:46 -0800 | [diff] [blame] | 309 | } |