Lines Matching full:freq
243 static u32 encode_freq(u32 freq) in encode_freq() argument
245 return DIV_ROUND_CLOSEST(freq * GT_FREQUENCY_SCALER, in encode_freq()
251 u32 freq; in pc_get_min_freq() local
253 freq = FIELD_GET(SLPC_MIN_UNSLICE_FREQ_MASK, in pc_get_min_freq()
254 slpc_shared_data_read(pc, task_state_data.freq)); in pc_get_min_freq()
256 return decode_freq(freq); in pc_get_min_freq()
264 /* Allow/Disallow punit to process software freq requests */ in pc_set_manual_rp_ctrl()
268 static void pc_set_cur_freq(struct xe_guc_pc *pc, u32 freq) in pc_set_cur_freq() argument
275 /* Req freq is in units of 16.66 Mhz */ in pc_set_cur_freq()
276 rpnswreq = REG_FIELD_PREP(REQ_RATIO_MASK, encode_freq(freq)); in pc_set_cur_freq()
285 static int pc_set_min_freq(struct xe_guc_pc *pc, u32 freq) in pc_set_min_freq() argument
291 if (freq < pc->rpn_freq || freq > pc->rp0_freq) in pc_set_min_freq()
299 freq < pc->rpe_freq); in pc_set_min_freq()
303 freq); in pc_set_min_freq()
308 u32 freq; in pc_get_max_freq() local
310 freq = FIELD_GET(SLPC_MAX_UNSLICE_FREQ_MASK, in pc_get_max_freq()
311 slpc_shared_data_read(pc, task_state_data.freq)); in pc_get_max_freq()
313 return decode_freq(freq); in pc_get_max_freq()
316 static int pc_set_max_freq(struct xe_guc_pc *pc, u32 freq) in pc_set_max_freq() argument
323 if (freq < pc->rpn_freq || freq > pc->rp0_freq) in pc_set_max_freq()
328 freq); in pc_set_max_freq()
391 u32 freq; in xe_guc_pc_get_act_freq() local
395 freq = xe_mmio_read32(gt, MTL_MIRROR_TARGET_WP1); in xe_guc_pc_get_act_freq()
396 freq = REG_FIELD_GET(MTL_CAGF_MASK, freq); in xe_guc_pc_get_act_freq()
398 freq = xe_mmio_read32(gt, GT_PERF_STATUS); in xe_guc_pc_get_act_freq()
399 freq = REG_FIELD_GET(CAGF_MASK, freq); in xe_guc_pc_get_act_freq()
402 freq = decode_freq(freq); in xe_guc_pc_get_act_freq()
404 return freq; in xe_guc_pc_get_act_freq()
410 * @freq: A pointer to a u32 where the freq value will be returned
415 int xe_guc_pc_get_cur_freq(struct xe_guc_pc *pc, u32 *freq) in xe_guc_pc_get_cur_freq() argument
421 * GuC SLPC plays with cur freq request when GuCRC is enabled in xe_guc_pc_get_cur_freq()
428 *freq = xe_mmio_read32(gt, RPNSWREQ); in xe_guc_pc_get_cur_freq()
430 *freq = REG_FIELD_GET(REQ_RATIO_MASK, *freq); in xe_guc_pc_get_cur_freq()
431 *freq = decode_freq(*freq); in xe_guc_pc_get_cur_freq()
438 * xe_guc_pc_get_rp0_freq - Get the RP0 freq
441 * Returns: RP0 freq.
449 * xe_guc_pc_get_rpe_freq - Get the RPe freq
452 * Returns: RPe freq.
462 * xe_guc_pc_get_rpn_freq - Get the RPn freq
465 * Returns: RPn freq.
475 * @freq: A pointer to a u32 where the freq value will be returned
480 int xe_guc_pc_get_min_freq(struct xe_guc_pc *pc, u32 *freq) in xe_guc_pc_get_min_freq() argument
493 * GuC SLPC plays with min freq request when GuCRC is enabled in xe_guc_pc_get_min_freq()
504 *freq = pc_get_min_freq(pc); in xe_guc_pc_get_min_freq()
516 * @freq: The selected minimal frequency
522 int xe_guc_pc_set_min_freq(struct xe_guc_pc *pc, u32 freq) in xe_guc_pc_set_min_freq() argument
533 ret = pc_set_min_freq(pc, freq); in xe_guc_pc_set_min_freq()
537 pc->user_requested_min = freq; in xe_guc_pc_set_min_freq()
547 * @freq: A pointer to a u32 where the freq value will be returned
552 int xe_guc_pc_get_max_freq(struct xe_guc_pc *pc, u32 *freq) in xe_guc_pc_get_max_freq() argument
567 *freq = pc_get_max_freq(pc); in xe_guc_pc_get_max_freq()
577 * @freq: The selected maximum frequency value
583 int xe_guc_pc_set_max_freq(struct xe_guc_pc *pc, u32 freq) in xe_guc_pc_set_max_freq() argument
594 ret = pc_set_max_freq(pc, freq); in xe_guc_pc_set_max_freq()
598 pc->user_requested_max = freq; in xe_guc_pc_set_max_freq()
971 /* Request max possible since dynamic freq mgmt is not enabled */ in xe_guc_pc_start()
1048 /* Bind requested freq to mert_freq_cap before unload */ in xe_guc_pc_fini_hw()