1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <string> 20 #include <unordered_map> 21 #include <vector> 22 23 namespace aidl { 24 namespace google { 25 namespace hardware { 26 namespace power { 27 namespace impl { 28 namespace pixel { 29 30 enum class ThrottleDecision { 31 NO_THROTTLE = 0, 32 THROTTLE_50 = 1, 33 THROTTLE_60 = 2, 34 THROTTLE_70 = 3, 35 THROTTLE_80 = 4, 36 THROTTLE_90 = 5, 37 FIRST = NO_THROTTLE, 38 LAST = THROTTLE_90, 39 }; 40 41 std::string ThrottleString(ThrottleDecision throttleDecision); 42 43 static const std::unordered_map<ThrottleDecision, std::vector<std::string>> 44 THROTTLE_DECISION_TO_HINT_NAMES = { 45 {ThrottleDecision::NO_THROTTLE, {}}, 46 {ThrottleDecision::THROTTLE_50, 47 {"LOW_POWER_LITTLE_CLUSTER_50", "LOW_POWER_MID_CLUSTER_50", "LOW_POWER_CPU_50"}}, 48 {ThrottleDecision::THROTTLE_60, 49 {"LOW_POWER_LITTLE_CLUSTER_60", "LOW_POWER_MID_CLUSTER_60", "LOW_POWER_CPU_60"}}, 50 {ThrottleDecision::THROTTLE_70, 51 {"LOW_POWER_LITTLE_CLUSTER_70", "LOW_POWER_MID_CLUSTER_70", "LOW_POWER_CPU_70"}}, 52 {ThrottleDecision::THROTTLE_80, 53 {"LOW_POWER_LITTLE_CLUSTER_80", "LOW_POWER_MID_CLUSTER_80", "LOW_POWER_CPU_80"}}, 54 {ThrottleDecision::THROTTLE_90, 55 {"LOW_POWER_LITTLE_CLUSTER_90", "LOW_POWER_MID_CLUSTER_90", "LOW_POWER_CPU_90"}}}; 56 57 } // namespace pixel 58 } // namespace impl 59 } // namespace power 60 } // namespace hardware 61 } // namespace google 62 } // namespace aidl 63