1// Copyright 2020 The ChromiumOS Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto3"; 6 7package chromiumos.config.api; 8 9option go_package = "go.chromium.org/chromiumos/config/go/api"; 10 11// Defines configuration settings for resourced. 12// For more details, see: 13// https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform2/resourced/README.md 14// 15// NEXT ID: 7 16message ResourceConfig { 17 // See https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html 18 message ConservativeGovernor { 19 // TODO: Add conservative specific parameters. 20 } 21 22 message OndemandGovernor { 23 uint32 powersave_bias = 1 [json_name = "powersave-bias"]; 24 25 // This field has a min of 2ms. If this field is set to 0 or unset, 26 // resourced will not update the sampling_rate on the governor. 27 uint32 sampling_rate_ms = 2 [json_name = "sampling-rate-ms"]; 28 } 29 30 message PerformanceGovernor { 31 // No parameter for the performance governor. The CPU frequency is set to 32 // the highest within scalinng_max_freq. 33 } 34 35 message PowersaveGovernor { 36 // No parameter for the powersave governor. The CPU frequency is set to the 37 // lowest within scaling_min_freq. 38 } 39 40 message SchedutilGovernor { 41 // TODO: Add schedutil specific parameters. 42 } 43 44 message UserspaceGovernor { 45 // No parameter for the userspace governor. The user space can set CPU 46 // frequency by writing to scaling_setspeed. 47 } 48 49 50 message Governor { 51 oneof governor { 52 ConservativeGovernor conservative = 2; 53 OndemandGovernor ondemand = 1; 54 PerformanceGovernor performance = 3; 55 PowersaveGovernor powersave = 4; 56 SchedutilGovernor schedutil = 5; 57 UserspaceGovernor userspace = 6; 58 } 59 } 60 61 message DefaultEpp {} 62 63 message PerformanceEpp {} 64 65 message BalancePerformanceEpp {} 66 67 message BalancePowerEpp {} 68 69 message PowerEpp {} 70 71 message EnergyPerformancePreference { 72 oneof epp { 73 DefaultEpp default = 1; 74 PerformanceEpp performance = 2; 75 BalancePerformanceEpp balance_performance = 3 [json_name = "balance-performance"]; 76 BalancePowerEpp balance_power = 4 [json_name = "balance-power"]; 77 PowerEpp power = 5; 78 } 79 } 80 81 message CpuOfflineSmallCore { 82 // The minimum number of online threads the device must have. If not set, 83 // resourced sets default to 2. 84 uint32 min_active_threads = 1 [json_name = "min-active-threads"]; 85 } 86 87 message CpuOfflineSMT { 88 // The minimum number of online threads the device must have. If not set, 89 // resourced sets default to 2. 90 uint32 min_active_threads = 1 [json_name = "min-active-threads"]; 91 } 92 93 message CpuOfflineHalf { 94 // The minimum number of online threads the device must have. If not set, 95 // resourced sets default to 2. 96 uint32 min_active_threads = 1 [json_name = "min-active-threads"]; 97 } 98 99 message CpuOfflinePreference { 100 oneof cpu_offline { 101 CpuOfflineSmallCore small_core = 1 [json_name = "small-core"]; 102 CpuOfflineSMT smt = 2; 103 CpuOfflineHalf half = 3; 104 } 105 } 106 107 message PowerPreferences { 108 Governor governor = 1; 109 EnergyPerformancePreference epp = 2; 110 CpuOfflinePreference cpu_offline = 3 [json_name = "cpu-offline"]; 111 bool cpufreq_disable_boost = 4 [json_name = "cpufreq-disable-boost"]; 112 } 113 114 message PowerSourcePreferences { 115 // If more then one activity is enabled, the following priority list is used 116 // to determine which settings to apply: 117 // 118 // 1) Battery saver 119 // 2) Borealis gaming 120 // 3) ARCVM gaming 121 // 4) WebRTC 122 // 5) Fullscreen Video 123 // 6) VM boot 124 // 125 // Default will be applied when no activity is active. 126 127 // PowerPreferences to apply at boot and when no other activity is active. 128 PowerPreferences default_power_preferences = 1 129 [json_name = "default-power-preferences"]; 130 131 // PowerPreferences to apply when RTC audio is active. 132 PowerPreferences web_rtc_power_preferences = 2 133 [json_name = "web-rtc-power-preferences"]; 134 135 // PowerPreferences to apply when full screen video is active. 136 PowerPreferences fullscreen_video_power_preferences = 3 137 [json_name = "fullscreen-power-preferences"]; 138 139 // PowerPreferences to apply when performance mode is active. 140 PowerPreferences vm_boot_power_preferences = 4 141 [json_name = "vm-boot-power-preferences"]; 142 143 // PowerPreferences to apply when playing a Borealis game. 144 PowerPreferences borealis_gaming_power_preferences = 5 145 [json_name = "borealis-gaming-power-preferences"]; 146 147 // PowerPreferences to apply when playing an ARCVM game. 148 PowerPreferences arcvm_gaming_power_preferences = 6 149 [json_name = "arcvm-gaming-power-preferences"]; 150 151 // PowerPreferences to apply when Battery Saver mode is on. 152 PowerPreferences battery_saver_power_preferences = 7 153 [json_name = "battery-saver-power-preferences"]; 154 } 155 156 // Power Preferences to apply when the device is on AC power (Plugged-in). 157 PowerSourcePreferences ac = 5; 158 159 // Power Preferences to apply when the device is on DC power (Battery). 160 PowerSourcePreferences dc = 6; 161} 162