1/* 2 * Copyright (C) 2016 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 */ 16package android.hardware.power@1.0; 17 18/** Power hint identifiers passed to powerHint() */ 19enum PowerHint : uint32_t { 20 /** 21 * Foreground app has started or stopped requesting a VSYNC pulse 22 * from SurfaceFlinger. If the app has started requesting VSYNC 23 * then CPU and GPU load is expected soon, and it may be appropriate 24 * to raise speeds of CPU, memory bus, etc. The data parameter is 25 * non-zero to indicate VSYNC pulse is now requested, or zero for 26 * VSYNC pulse no longer requested. 27 */ 28 VSYNC = 0x00000001, 29 30 31 /** 32 * User is interacting with the device, for example, touchscreen 33 * events are incoming. CPU and GPU load may be expected soon, 34 * and it may be appropriate to raise speeds of CPU, memory bus, 35 * etc. The data parameter is the estimated length of the interaction 36 * in milliseconds, or 0 if unknown. 37 */ 38 INTERACTION = 0x00000002, 39 40 41 /** 42 * DO NOT USE VIDEO_ENCODE/_DECODE! They will be removed in 43 * KLP. 44 */ 45 VIDEO_ENCODE = 0x00000003, 46 VIDEO_DECODE = 0x00000004, 47 48 /** 49 * Low power mode is activated or deactivated. Low power mode 50 * is intended to save battery at the cost of performance. The data 51 * parameter is non-zero when low power mode is activated, and zero 52 * when deactivated. 53 */ 54 LOW_POWER = 0x00000005, 55 56 /** 57 * Sustained Performance mode is actived or deactivated. Sustained 58 * performance mode is intended to provide a consistent level of 59 * performance for a prolonged amount of time. The data parameter is 60 * non-zero when sustained performance mode is activated, and zero 61 * when deactivated. 62 */ 63 SUSTAINED_PERFORMANCE = 0x00000006, 64 65 /** 66 * VR Mode is activated or deactivated. VR mode is intended to 67 * provide minimum guarantee for performance for the amount of time the 68 * device can sustain it. The data parameter is non-zero when the mode 69 * is activated and zero when deactivated. 70 */ 71 VR_MODE = 0x00000007, 72 73 /** 74 * This hint indicates that an application has been launched. Can be used 75 * for device specific optimizations during application launch. The data 76 * parameter is non-zero when the application starts to launch and zero when 77 * it has been launched. 78 */ 79 LAUNCH = 0x00000008, 80}; 81 82enum Feature : uint32_t { 83 /** 84 * Enabling/Disabling this feature will allow/disallow the system 85 * to wake up by tapping the screen twice. 86 */ 87 POWER_FEATURE_DOUBLE_TAP_TO_WAKE = 0x00000001 88}; 89 90enum Status : uint32_t { 91 SUCCESS = 0, 92 FILESYSTEM_ERROR = 1 93}; 94/** 95 * Platform-level sleep state stats: 96 * PowerStateVoter struct is useful for describing the individual voters 97 * when a Platform-level sleep state is chosen by aggregation of votes from 98 * multiple clients/system conditions. 99 * 100 * This helps in attirbuting what in the device is blocking the device from 101 * entering the lowest Platform-level sleep state. 102 */ 103struct PowerStateVoter { 104 /** 105 * Name of the voter. 106 */ 107 string name; 108 109 /** 110 * Total time in msec the voter voted for the platform sleep state since 111 * boot. 112 */ 113 uint64_t totalTimeInMsecVotedForSinceBoot; 114 115 /** 116 * Number of times the voter voted for the platform sleep state since boot. 117 */ 118 uint64_t totalNumberOfTimesVotedSinceBoot; 119}; 120 121/** 122 * Platform-level sleep state stats: 123 * PowerStatePlatformSleepState represents the Platform-level sleep state 124 * the device is capable of getting into. 125 * 126 * SoCs usually have more than one Platform-level sleep state. 127 */ 128struct PowerStatePlatformSleepState { 129 /** 130 * Platform-level Sleep state name. 131 */ 132 string name; 133 134 /** 135 * Time spent in msec at this platform-level sleep state since boot. 136 */ 137 uint64_t residencyInMsecSinceBoot; 138 139 /** 140 * Total number of times system entered this state. 141 */ 142 uint64_t totalTransitions; 143 144 /** 145 * This platform-level sleep state can only be reached during system suspend 146 */ 147 bool supportedOnlyInSuspend; 148 149 /** 150 * voters is useful if the Platform-level sleep state 151 * is chosen by aggregation votes from multiple clients/system conditions. 152 * All the voters have to say yes or all the system conditions need to be 153 * met to enter a platform-level sleep state. 154 * 155 * Vector of size zero implies either the info is not available 156 * or the system does not follow a voting mechanism to choose this 157 * Platform-level sleep state. 158 */ 159 vec<PowerStateVoter> voters; 160}; 161