Lines Matching defs:freq

162 static int wait_for_act_freq_limit(struct xe_guc_pc *pc, u32 freq)
168 if (xe_guc_pc_get_act_freq(pc) <= freq)
290 static u32 encode_freq(u32 freq)
292 return DIV_ROUND_CLOSEST(freq * GT_FREQUENCY_SCALER,
298 u32 freq;
300 freq = FIELD_GET(SLPC_MIN_UNSLICE_FREQ_MASK,
301 slpc_shared_data_read(pc, task_state_data.freq));
303 return decode_freq(freq);
311 /* Allow/Disallow punit to process software freq requests */
315 static void pc_set_cur_freq(struct xe_guc_pc *pc, u32 freq)
322 /* Req freq is in units of 16.66 Mhz */
323 rpnswreq = REG_FIELD_PREP(REQ_RATIO_MASK, encode_freq(freq));
332 static int pc_set_min_freq(struct xe_guc_pc *pc, u32 freq)
338 if (freq < pc->rpn_freq || freq > pc->rp0_freq)
346 freq < pc->rpe_freq);
350 freq);
355 u32 freq;
357 freq = FIELD_GET(SLPC_MAX_UNSLICE_FREQ_MASK,
358 slpc_shared_data_read(pc, task_state_data.freq));
360 return decode_freq(freq);
363 static int pc_set_max_freq(struct xe_guc_pc *pc, u32 freq)
370 if (freq < pc->rpn_freq || freq > pc->rp0_freq)
375 freq);
475 u32 freq;
479 freq = xe_mmio_read32(&gt->mmio, MTL_MIRROR_TARGET_WP1);
480 freq = REG_FIELD_GET(MTL_CAGF_MASK, freq);
482 freq = xe_mmio_read32(&gt->mmio, GT_PERF_STATUS);
483 freq = REG_FIELD_GET(CAGF_MASK, freq);
486 freq = decode_freq(freq);
488 return freq;
493 u32 freq;
495 freq = xe_mmio_read32(&gt->mmio, RPNSWREQ);
496 freq = REG_FIELD_GET(REQ_RATIO_MASK, freq);
497 return decode_freq(freq);
518 * @freq: A pointer to a u32 where the freq value will be returned
523 int xe_guc_pc_get_cur_freq(struct xe_guc_pc *pc, u32 *freq)
529 * GuC SLPC plays with cur freq request when GuCRC is enabled
538 *freq = get_cur_freq(gt);
545 * xe_guc_pc_get_rp0_freq - Get the RP0 freq
548 * Returns: RP0 freq.
556 * xe_guc_pc_get_rpa_freq - Get the RPa freq
559 * Returns: RPa freq.
569 * xe_guc_pc_get_rpe_freq - Get the RPe freq
572 * Returns: RPe freq.
582 * xe_guc_pc_get_rpn_freq - Get the RPn freq
585 * Returns: RPn freq.
592 static int xe_guc_pc_get_min_freq_locked(struct xe_guc_pc *pc, u32 *freq)
606 *freq = pc_get_min_freq(pc);
614 * @freq: A pointer to a u32 where the freq value will be returned
619 int xe_guc_pc_get_min_freq(struct xe_guc_pc *pc, u32 *freq)
623 return xe_guc_pc_get_min_freq_locked(pc, freq);
626 static int xe_guc_pc_set_min_freq_locked(struct xe_guc_pc *pc, u32 freq)
636 ret = pc_set_min_freq(pc, freq);
640 pc->user_requested_min = freq;
648 * @freq: The selected minimal frequency
654 int xe_guc_pc_set_min_freq(struct xe_guc_pc *pc, u32 freq)
658 return xe_guc_pc_set_min_freq_locked(pc, freq);
661 static int xe_guc_pc_get_max_freq_locked(struct xe_guc_pc *pc, u32 *freq)
675 *freq = pc_get_max_freq(pc);
683 * @freq: A pointer to a u32 where the freq value will be returned
688 int xe_guc_pc_get_max_freq(struct xe_guc_pc *pc, u32 *freq)
692 return xe_guc_pc_get_max_freq_locked(pc, freq);
695 static int xe_guc_pc_set_max_freq_locked(struct xe_guc_pc *pc, u32 freq)
705 ret = pc_set_max_freq(pc, freq);
709 pc->user_requested_max = freq;
717 * @freq: The selected maximum frequency value
723 int xe_guc_pc_set_max_freq(struct xe_guc_pc *pc, u32 freq)
732 return xe_guc_pc_set_max_freq_locked(pc, freq);
939 * xe_guc_pc_apply_flush_freq_limit() - Limit max GT freq during L2 flush
959 xe_gt_err_once(gt, "Failed to cap max freq on flush to %u, %pe\n",
967 * If user has previously changed max freq, stash that value to
978 * Wait for actual freq to go below the flush cap: even if the previous
983 xe_gt_err_once(gt, "Actual freq did not reduce to %u, %pe\n",
988 * xe_guc_pc_remove_flush_freq_limit() - Remove max GT freq limit after L2 flush completes.
1008 xe_gt_err_once(gt, "Failed to restore max freq %u:%d",
1210 /* Request max possible since dynamic freq mgmt is not enabled */
1227 xe_gt_warn(gt, "GuC PC start taking longer than normal [freq = %dMHz (req = %dMHz), perf_limit_reasons = 0x%08X]\n",
1305 /* Bind requested freq to mert_freq_cap before unload */