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()
550 static u64 measure_frequency_at(struct intel_rps *rps, u32 *cntr, int *freq) in measure_frequency_at() argument
555 *freq = rps_set_check(rps, *freq); in measure_frequency_at()
558 *freq = (*freq + read_cagf(rps)) / 2; in measure_frequency_at()
581 int *freq) in measure_cs_frequency_at() argument
586 *freq = rps_set_check(rps, *freq); in measure_cs_frequency_at()
589 *freq = (*freq + read_cagf(rps)) / 2; in measure_cs_frequency_at()
636 int freq; in live_rps_frequency_cs() member
672 min.freq = rps->min_freq; in live_rps_frequency_cs()
673 min.count = measure_cs_frequency_at(rps, engine, &min.freq); in live_rps_frequency_cs()
675 max.freq = rps->max_freq; in live_rps_frequency_cs()
676 max.count = measure_cs_frequency_at(rps, engine, &max.freq); in live_rps_frequency_cs()
680 min.count, intel_gpu_freq(rps, min.freq), in live_rps_frequency_cs()
681 max.count, intel_gpu_freq(rps, max.freq), in live_rps_frequency_cs()
682 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * max.count, in live_rps_frequency_cs()
683 max.freq * min.count)); in live_rps_frequency_cs()
685 if (!scaled_within(max.freq * min.count, in live_rps_frequency_cs()
686 min.freq * max.count, in live_rps_frequency_cs()
692 max.freq * min.count, in live_rps_frequency_cs()
693 min.freq * max.count); in live_rps_frequency_cs()
696 for (f = min.freq + 1; f <= rps->max_freq; f++) { in live_rps_frequency_cs()
707 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * count, in live_rps_frequency_cs()
775 int freq; in live_rps_frequency_srm() member
810 min.freq = rps->min_freq; in live_rps_frequency_srm()
811 min.count = measure_frequency_at(rps, cntr, &min.freq); in live_rps_frequency_srm()
813 max.freq = rps->max_freq; in live_rps_frequency_srm()
814 max.count = measure_frequency_at(rps, cntr, &max.freq); in live_rps_frequency_srm()
818 min.count, intel_gpu_freq(rps, min.freq), in live_rps_frequency_srm()
819 max.count, intel_gpu_freq(rps, max.freq), in live_rps_frequency_srm()
820 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * max.count, in live_rps_frequency_srm()
821 max.freq * min.count)); in live_rps_frequency_srm()
823 if (!scaled_within(max.freq * min.count, in live_rps_frequency_srm()
824 min.freq * max.count, in live_rps_frequency_srm()
830 max.freq * min.count, in live_rps_frequency_srm()
831 min.freq * max.count); in live_rps_frequency_srm()
834 for (f = min.freq + 1; f <= rps->max_freq; f++) { in live_rps_frequency_srm()
845 (int)DIV64_U64_ROUND_CLOSEST(100 * min.freq * count, in live_rps_frequency_srm()
1107 static u64 measure_power(struct intel_rps *rps, int *freq) in measure_power() argument
1115 *freq = (*freq + intel_rps_read_actual_frequency(rps)) / 2; in measure_power()
1122 static u64 measure_power_at(struct intel_rps *rps, int *freq) in measure_power_at() argument
1124 *freq = rps_set_check(rps, *freq); in measure_power_at()
1125 return measure_power(rps, freq); in measure_power_at()
1161 int freq; in live_rps_power() member
1190 max.freq = rps->max_freq; in live_rps_power()
1191 max.power = measure_power_at(rps, &max.freq); in live_rps_power()
1193 min.freq = rps->min_freq; in live_rps_power()
1194 min.power = measure_power_at(rps, &min.freq); in live_rps_power()
1201 min.power, intel_gpu_freq(rps, min.freq), in live_rps_power()
1202 max.power, intel_gpu_freq(rps, max.freq)); in live_rps_power()
1204 if (10 * min.freq >= 9 * max.freq) { in live_rps_power()
1206 min.freq, intel_gpu_freq(rps, min.freq), in live_rps_power()
1207 max.freq, intel_gpu_freq(rps, max.freq)); in live_rps_power()
1263 u8 freq; in live_rps_dynamic() member
1288 max.freq = wait_for_freq(rps, rps->max_freq, 500); in live_rps_dynamic()
1294 min.freq = wait_for_freq(rps, rps->min_freq, 2000); in live_rps_dynamic()
1299 max.freq, intel_gpu_freq(rps, max.freq), in live_rps_dynamic()
1301 min.freq, intel_gpu_freq(rps, min.freq), in live_rps_dynamic()
1303 if (min.freq >= max.freq) { in live_rps_dynamic()