[Nouveau] getMNP_single calculations

Amol suratiamol at gmail.com
Sat Oct 23 01:11:41 UTC 2021


Hello,

I am trying to understand the clock calculations found inside the function
getMNP_single at [1].

Before the loop, there's a check made to see if applying the maximum possible
post-divider (P) to the minimum possible VCO-output-frequency (minvco) still
gives an output resultant frequency that is larger than the required frequency
(clk). If so, the minimum VCO-output-frequency being considered is set to
clk * log2(max-post-divider).

The relevant piece of code:

P = 1 << maxP;
if ((clk * P) < minvco) {
        minvco = clk * maxP;
        maxvco = minvco * 2;
}

Would it not be proper to set minvco to clk * max-post-divider? That is,
minvco = clk * P, or minvco = clk << maxP? That should keep the
VCO-output-frequency closer to the original minvco, whereas
clk * log2(max-post-divider) brings it further down.

Thanks,
Amol

[1] https://lxr.missinglinkelectronics.com/linux+v5.14/drivers/gpu/drm/nouveau/nvkm/subdev/clk/pllnv04.c#L29


More information about the Nouveau mailing list