/* * Note that on gen11+, the clock frequency may be reconfigured. * We do not, and we assume nobody else does. * * First figure out the reference frequency. There are 2 ways * we can compute the frequency, either through the * TIMESTAMP_OVERRIDE register or through RPM_CONFIG. CTC_MODE * tells us which one we should use.
*/ if ((ctc_reg & CTC_SOURCE_PARAMETER_MASK) == CTC_SOURCE_DIVIDE_LOGIC) {
freq = read_reference_ts_freq(uncore);
} else {
u32 c0 = intel_uncore_read(uncore, RPM_CONFIG0);
freq = gen11_get_crystal_clock_freq(uncore, c0);
/* * Now figure out how the command stream's timestamp * register increments from this frequency (it might * increment only every few clock cycle).
*/
freq >>= 3 - REG_FIELD_GET(GEN10_RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK, c0);
}
/* * Now figure out how the command stream's timestamp * register increments from this frequency (it might * increment only every few clock cycle).
*/
freq >>= 3 - REG_FIELD_GET(CTC_SHIFT_PARAMETER_MASK, ctc_reg);
}
return freq;
}
static u32 gen6_read_clock_frequency(struct intel_uncore *uncore)
{ /* * PRMs say: * * "The PCU TSC counts 10ns increments; this timestamp * reflects bits 38:3 of the TSC (i.e. 80ns granularity, * rolling over every 1.5 hours).
*/ return 12500000;
}
static u32 gen4_read_clock_frequency(struct intel_uncore *uncore)
{ /* * PRMs say: * * "The value in this register increments once every 16 * hclks." (through the “Clocking Configuration” * (“CLKCFG”) MCHBAR register) * * Testing on actual hardware has shown there is no /16.
*/ return DIV_ROUND_CLOSEST(i9xx_fsb_freq(uncore->i915), 4) * 1000;
}
/* Icelake appears to use another fixed frequency for CTX_TIMESTAMP */ if (GRAPHICS_VER(gt->i915) == 11)
gt->clock_period_ns = NSEC_PER_SEC / 13750000; elseif (gt->clock_frequency)
gt->clock_period_ns = intel_gt_clock_interval_to_ns(gt, 1);
/* * Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS * 8300) freezing up around GPU hangs. Looks as if even * scheduling/timer interrupts start misbehaving if the RPS * EI/thresholds are "bad", leading to a very sluggish or even * frozen machine.
*/
val = div_u64_roundup(intel_gt_ns_to_clock_interval(gt, ns), 16); if (GRAPHICS_VER(gt->i915) == 6)
val = div_u64_roundup(val, 25) * 25;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.