class PowerState
Defined at line 49 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
PowerState encapsulates the current power level, power domain, and energy model for an individual
processor.
Instances of PowerState are not safe for concurrent use and must be protected by an external lock
associated with the owning processor.
Public Methods
PowerDomainSet UpdatePowerDomainSet (PowerDomainSet power_domain_set, uint32_t cpu_num)
Updates the power domain set and associates this power state with the domain in the set
matching the given CPU number. Returns the previous power domain set.
Defined at line 21 of file ../../zircon/kernel/lib/power-management/power-state.cc
std::optional<PowerLevelUpdateRequest> RequestTransition (uint32_t cpu_num, uint8_t active_power_level)
Posts a request to transition the power domain associated with this power state to a given
active power level from the current energy model.
Ignored when no domain is set. Asserts that the requested power level is an active power level.
`cpu_num` is the CPU associated with this power state.
`level` is the desired power level.
Defined at line 50 of file ../../zircon/kernel/lib/power-management/power-state.cc
void PowerState ()
Defined at line 51 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
bool is_enabled ()
Returns true if the power domain is set.
Defined at line 54 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
const fbl::RefPtr<PowerDomain> & domain ()
Domain the PowerState is being modeled after. Returns nullptr is there is
no power domain configured for processor owning this power state.
Defined at line 58 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
std::optional<uint32_t> domain_id ()
Returns the id of the domain this power state belongs to.
Defined at line 61 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
bool is_serving ()
Returns whether the domain's controller is serving requests. Returns false if there is no
domain.
Defined at line 70 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
std::optional<uint8_t> active_power_level ()
Returns the active power level when device is not idle.
Defined at line 73 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
std::optional<uint8_t> desired_active_power_level ()
Returns the active power level the device is in the processo of transitioning to.
Defined at line 76 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
std::optional<uint8_t> max_idle_power_level ()
Returns the maximum (i.e. highest power, lowest latency) idle power level.
Defined at line 81 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
zx::result<> UpdateActivePowerLevel (uint8_t active_power_level)
Updates the active power level of this power state. Typically called in response to the power
level controller completing a power level transition request.
Defined at line 86 of file ../../zircon/kernel/lib/power-management/power-state.cc
uint64_t active_power_coefficient_nw ()
Returns the power coefficient of the current active power level. Returns zero if there is no
active power level or no domain is set.
Defined at line 90 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
uint64_t max_idle_power_coefficient_nw ()
Returns the power coefficient of the maximum idle power level. Returns zero if there is no
idle power level or no domain is set.
Defined at line 99 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
std::optional<ControlInterface> max_idle_power_level_interface ()
Returns the control interface of the maximum idle power level. Returns nullopt if there is no
idle power level or no domain is set.
Defined at line 108 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
bool IsValidActivePowerLevel (uint8_t power_level)
Returns true if the given power level is valid active power level.
Defined at line 116 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
ProcessingRate max_processing_rate ()
Returns the processing rate of the fastest power level in this domain.
Defined at line 125 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
ProcessingRate active_processing_rate ()
Returns the processing rate of the current active power level. Returns zero if there is no
active power level or no domain is set.
Defined at line 134 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
ProcessingRate preceding_active_processing_rate ()
Returns the processing rate of the preceding active power level (i.e. the
lower bound of the current active power level). Returns zero if there is no
preceding active power level, no active power level is set, or no domain
is set.
Defined at line 145 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
Utilization normalized_utilization ()
Returns the current utilization of the processor.
Defined at line 156 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
Utilization total_normalized_utilization ()
Returns the total normalized utilization of the domain this processor belongs to.
Defined at line 159 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
const PowerDomainSet & power_domain_set ()
Defined at line 170 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h
Utilization UpdateUtilization (Utilization utilization_delta)
Update the utilization of this processor and the total utilization of its domain.
Defined at line 188 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h