Lines Matching refs:r2
430 unsigned p, n2, r2;
508 unsigned r2, unsigned n2, unsigned p,
517 best->r2 = r2;
526 * abs(freq2k - (LC_FREQ_2K * n2/(p * r2))) /
535 a = freq2k * budget * p * r2;
536 b = freq2k * budget * best->p * best->r2;
537 diff = ABS_DIFF((freq2k * p * r2), (LC_FREQ_2K * n2));
538 diff_best = ABS_DIFF((freq2k * best->p * best->r2),
545 if (best->p * best->r2 * diff < p * r2 * diff_best) {
548 best->r2 = r2;
554 best->r2 = r2;
556 /* Both are below the limit, so pick the higher n2/(r2*r2) */
557 if (n2 * best->r2 * best->r2 > best->n2 * r2 * r2) {
560 best->r2 = r2;
571 unsigned p, n2, r2;
594 * REF_MAX * r2 > LC_FREQ * 2 and
595 * REF_MIN * r2 < LC_FREQ * 2
597 * Which means the desired boundaries for r2 are:
598 * LC_FREQ * 2 / REF_MAX < r2 < LC_FREQ * 2 / REF_MIN
601 for (r2 = LC_FREQ * 2 / REF_MAX + 1;
602 r2 <= LC_FREQ * 2 / REF_MIN;
603 r2++) {
610 * VCO_MAX * r2 > n2 * LC_FREQ and
611 * VCO_MIN * r2 < n2 * LC_FREQ)
614 * VCO_MIN * r2 / LC_FREQ < n2 < VCO_MAX * r2 / LC_FREQ
616 for (n2 = VCO_MIN * r2 / LC_FREQ + 1;
617 n2 <= VCO_MAX * r2 / LC_FREQ;
622 r2, n2, p, &best);
628 *r2_out = best.r2;
630 DRM_DEBUG_KMS("WRPLL: %dHz refresh rate with p=%d, n2=%d r2=%d\n",
673 unsigned p, n2, r2;
695 intel_ddi_calculate_wrpll(clock * 1000, &r2, &n2, &p);
698 WRPLL_DIVIDER_REFERENCE(r2) | WRPLL_DIVIDER_FEEDBACK(n2) |