Lines Matching +full:max +full:- +full:freq
1 /* SPDX-License-Identifier: GPL-2.0 */
14 * struct em_perf_state - Performance state of a performance domain
40 * struct em_perf_domain - Performance domain
51 * must have the same micro-architecture. Performance domains often have
52 * a 1-to-1 mapping with CPUFreq policies. In case of other devices the @cpus
65 * EM_PERF_DOMAIN_MICROWATTS: The power values are in micro-Watts or some
78 #define em_span_cpus(em) (to_cpumask((em)->cpus))
79 #define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
83 * The max power value in micro-Watts. The limit of 64 Watts is set as
106 * e.g. power ~1.3 Watt at max freq, so the 'cost' value > 1mln micro-Watts.
124 * active_power() - Provide power at the next performance state of
129 * @freq : Frequency at the performance state in kHz
133 * 'freq' and update 'power' and 'freq' to the matching active power
137 * expressed in micro-Watts or an abstract scale. It is expected to
143 unsigned long *freq);
146 * get_cost() - Provide the cost at the given performance state of
149 * @freq : Frequency at the performance state in kHz
159 int (*get_cost)(struct device *dev, unsigned long freq,
177 * em_pd_get_efficient_state() - Get an efficient performance state from the EM
179 * @freq : Frequency to map with the EM
184 * Return: An efficient performance state, high enough to meet @freq
189 unsigned long freq) in em_pd_get_efficient_state() argument
194 for (i = 0; i < pd->nr_perf_states; i++) { in em_pd_get_efficient_state()
195 ps = &pd->table[i]; in em_pd_get_efficient_state()
196 if (ps->frequency >= freq) { in em_pd_get_efficient_state()
197 if (pd->flags & EM_PERF_DOMAIN_SKIP_INEFFICIENCIES && in em_pd_get_efficient_state()
198 ps->flags & EM_PERF_STATE_INEFFICIENT) in em_pd_get_efficient_state()
208 * em_cpu_energy() - Estimates the energy consumed by the CPUs of a
221 * a capacity state satisfying the max utilization of the domain.
227 unsigned long freq, ref_freq, scale_cpu; in em_cpu_energy() local
239 * max utilization to the allowed CPU capacity before calculating in em_cpu_energy()
242 cpu = cpumask_first(to_cpumask(pd->cpus)); in em_cpu_energy()
247 freq = map_util_freq(max_util, ref_freq, scale_cpu); in em_cpu_energy()
253 ps = em_pd_get_efficient_state(pd, freq); in em_cpu_energy()
259 * ps->freq * scale_cpu in em_cpu_energy()
260 * ps->cap = -------------------- (1) in em_cpu_energy()
267 * ps->power * cpu_util in em_cpu_energy()
268 * cpu_nrg = -------------------- (2) in em_cpu_energy()
269 * ps->cap in em_cpu_energy()
271 * since 'cpu_util / ps->cap' represents its percentage of busy time. in em_cpu_energy()
278 * By injecting (1) in (2), 'cpu_nrg' can be re-expressed as a product in em_cpu_energy()
281 * ps->power * cpu_max_freq cpu_util in em_cpu_energy()
282 * cpu_nrg = ------------------------ * --------- (3) in em_cpu_energy()
283 * ps->freq scale_cpu in em_cpu_energy()
286 * as 'ps->cost'. in em_cpu_energy()
288 * Since all CPUs of the domain have the same micro-architecture, they in em_cpu_energy()
289 * share the same 'ps->cost', and the same CPU capacity. Hence, the in em_cpu_energy()
293 * ps->cost * \Sum cpu_util in em_cpu_energy()
294 * pd_nrg = ------------------------ (4) in em_cpu_energy()
297 return em_estimate_energy(ps->cost, sum_util, scale_cpu); in em_cpu_energy()
301 * em_pd_nr_perf_states() - Get the number of performance states of a perf.
309 return pd->nr_perf_states; in em_pd_nr_perf_states()
323 return -EINVAL; in em_dev_register_perf_domain()