Lines Matching refs:freq

151 static u8 wait_for_freq(struct intel_rps *rps, u8 freq, int timeout_ms)  in wait_for_freq()  argument
158 memset(history, freq, sizeof(history)); in wait_for_freq()
171 if (act == freq) in wait_for_freq()
188 static u8 rps_set_check(struct intel_rps *rps, u8 freq) in rps_set_check() argument
192 if (wait_for(!intel_rps_set(rps, freq), 50)) { in rps_set_check()
196 GEM_BUG_ON(rps->last_freq != freq); in rps_set_check()
199 return wait_for_freq(rps, freq, 50); in rps_set_check()
552 static u64 measure_frequency_at(struct intel_rps *rps, u32 *cntr, int *freq) in measure_frequency_at() argument
557 *freq = rps_set_check(rps, *freq); in measure_frequency_at()
560 *freq = (*freq + read_cagf(rps)) / 2; in measure_frequency_at()
583 int *freq) in measure_cs_frequency_at() argument
588 *freq = rps_set_check(rps, *freq); in measure_cs_frequency_at()
591 *freq = (*freq + read_cagf(rps)) / 2; in measure_cs_frequency_at()
638 int freq; in live_rps_frequency_cs() member
674 min.freq = rps->min_freq; in live_rps_frequency_cs()
675 min.count = measure_cs_frequency_at(rps, engine, &min.freq); in live_rps_frequency_cs()
677 max.freq = rps->max_freq; in live_rps_frequency_cs()
678 max.count = measure_cs_frequency_at(rps, engine, &max.freq); in live_rps_frequency_cs()
682 min.count, intel_gpu_freq(rps, min.freq), in live_rps_frequency_cs()
683 max.count, intel_gpu_freq(rps, max.freq), in live_rps_frequency_cs()
684 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * max.count, in live_rps_frequency_cs()
685 max.freq * min.count)); in live_rps_frequency_cs()
687 if (!scaled_within(max.freq * min.count, in live_rps_frequency_cs()
688 min.freq * max.count, in live_rps_frequency_cs()
694 max.freq * min.count, in live_rps_frequency_cs()
695 min.freq * max.count); in live_rps_frequency_cs()
698 for (f = min.freq + 1; f <= rps->max_freq; f++) { in live_rps_frequency_cs()
709 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * count, in live_rps_frequency_cs()
777 int freq; in live_rps_frequency_srm() member
812 min.freq = rps->min_freq; in live_rps_frequency_srm()
813 min.count = measure_frequency_at(rps, cntr, &min.freq); in live_rps_frequency_srm()
815 max.freq = rps->max_freq; in live_rps_frequency_srm()
816 max.count = measure_frequency_at(rps, cntr, &max.freq); in live_rps_frequency_srm()
820 min.count, intel_gpu_freq(rps, min.freq), in live_rps_frequency_srm()
821 max.count, intel_gpu_freq(rps, max.freq), in live_rps_frequency_srm()
822 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * max.count, in live_rps_frequency_srm()
823 max.freq * min.count)); in live_rps_frequency_srm()
825 if (!scaled_within(max.freq * min.count, in live_rps_frequency_srm()
826 min.freq * max.count, in live_rps_frequency_srm()
832 max.freq * min.count, in live_rps_frequency_srm()
833 min.freq * max.count); in live_rps_frequency_srm()
836 for (f = min.freq + 1; f <= rps->max_freq; f++) { in live_rps_frequency_srm()
847 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * count, in live_rps_frequency_srm()
1110 static u64 measure_power(struct intel_rps *rps, int *freq) in measure_power() argument
1118 *freq = (*freq + intel_rps_read_actual_frequency(rps)) / 2; in measure_power()
1125 static u64 measure_power_at(struct intel_rps *rps, int *freq) in measure_power_at() argument
1127 *freq = rps_set_check(rps, *freq); in measure_power_at()
1128 return measure_power(rps, freq); in measure_power_at()
1164 int freq; in live_rps_power() member
1193 max.freq = rps->max_freq; in live_rps_power()
1194 max.power = measure_power_at(rps, &max.freq); in live_rps_power()
1196 min.freq = rps->min_freq; in live_rps_power()
1197 min.power = measure_power_at(rps, &min.freq); in live_rps_power()
1204 min.power, intel_gpu_freq(rps, min.freq), in live_rps_power()
1205 max.power, intel_gpu_freq(rps, max.freq)); in live_rps_power()
1207 if (10 * min.freq >= 9 * max.freq) { in live_rps_power()
1209 min.freq, intel_gpu_freq(rps, min.freq), in live_rps_power()
1210 max.freq, intel_gpu_freq(rps, max.freq)); in live_rps_power()
1266 u8 freq; in live_rps_dynamic() member
1291 max.freq = wait_for_freq(rps, rps->max_freq, 500); in live_rps_dynamic()
1297 min.freq = wait_for_freq(rps, rps->min_freq, 2000); in live_rps_dynamic()
1302 max.freq, intel_gpu_freq(rps, max.freq), in live_rps_dynamic()
1304 min.freq, intel_gpu_freq(rps, min.freq), in live_rps_dynamic()
1306 if (min.freq >= max.freq) { in live_rps_dynamic()