class PowerState

Defined at line 115 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

void PowerState ()

Defined at line 117 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

void ~PowerState ()

Defined at line 118 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

void PowerState (const PowerState & )

Defined at line 120 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

PowerState & operator= (const PowerState & )

Defined at line 121 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 124 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 128 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 131 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 141 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

bool scheduler_control_enabled ()

Returns whether the kernel scheduler should send power level update requests through the

control interface to handle utilization changes.

Defined at line 145 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 150 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 159 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 168 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

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 178 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 184 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 190 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 199 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 204 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 208 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 216 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<uint8_t> target_active_power_level ()

Returns the targeted active power level (the in-flight desired level if set,

otherwise the current active level).

Defined at line 222 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

ProcessingRate target_processing_rate ()

Returns the processing rate of the targeted active power level (the in-flight

desired level if set, otherwise the current active level).

Defined at line 232 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

ProcessingRate preceding_target_processing_rate ()

Returns the processing rate of the active power level immediately preceding

the targeted active power level (i.e. the lower bound of the targeted active

power level).

Defined at line 239 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

bool has_preceding_target_power_level ()

Returns true if the targeted active power level has an active power level

preceding it (i.e. is not the lowest active power level).

Defined at line 245 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 250 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 255 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

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 261 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

const PowerDomainSet & power_domain_set ()

Defined at line 266 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

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 277 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 288 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 293 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h