[Nouveau] [RFC PATCH 4/5] subdev/clk: print the base clocks

Emil Velikov emil.l.velikov at gmail.com
Wed Dec 2 04:29:44 PST 2015


On 2 December 2015 at 12:21, Karol Herbst <nouveau at karolherbst.de> wrote:
>> Pierre Moreau <pierre.morrow at free.fr> hat am 2. Dezember 2015 um 02:34
>> geschrieben:
>>
>> Hi,
>>
>> On 05:42 PM - Dec 01 2015, Karol Herbst wrote:
>> > this is just a nice thing to know and there is no harm in printing them
>> > ---
>> > drm/nouveau/nvkm/subdev/clk/base.c | 16 ++++++++++++++++
>> > 1 file changed, 16 insertions(+)
>> >
>> > diff --git a/drm/nouveau/nvkm/subdev/clk/base.c
>> > b/drm/nouveau/nvkm/subdev/clk/base.c
>> > index d731bc3..df9173e 100644
>> > --- a/drm/nouveau/nvkm/subdev/clk/base.c
>> > +++ b/drm/nouveau/nvkm/subdev/clk/base.c
>> > @@ -24,6 +24,7 @@
>> > #include "priv.h"
>> >
>> > #include <subdev/bios.h>
>> > +#include <subdev/bios/baseclock.h>
>> > #include <subdev/bios/boost.h>
>> > #include <subdev/bios/cstep.h>
>> > #include <subdev/bios/perf.h>
>> > @@ -562,10 +563,25 @@ int
>> > nvkm_clk_ctor(const struct nvkm_clk_func *func, struct nvkm_device *device,
>> > int index, bool allow_reclock, struct nvkm_clk *clk)
>> > {
>> > + struct nvkm_bios *bios;
>> > int ret, idx, arglen;
>> > const char *mode;
>> > + struct nvbios_baseclock_header header;
>> >
>> > nvkm_subdev_ctor(&nvkm_clk, device, index, 0, &clk->subdev);
>> > + bios = device->bios;
>> > +
>> > + if (bios && !nvbios_baseclock_parse(bios, &header)) {
>> > + struct nvbios_baseclock_entry base_entry, boost_entry;
>> > + if (nvbios_baseclock_get_entry(bios, &header, header.base_entry,
>> > &base_entry))
>> > + nvkm_error(&clk->subdev, "couldn't parse base clock\n");
>> > + else if (nvbios_baseclock_get_entry(bios, &header, header.boost_entry,
>> > &boost_entry))
>> > + nvkm_error(&clk->subdev, "couldn't parse boost clock\n");
>> > + else
>> > + nvkm_info(&clk->subdev, "base: %i MHz, boost: %i MHz\n",
>> > + base_entry.clock_mhz / 2, boost_entry.clock_mhz / 2);
>>
>> This is probably just me missing some elementary electronic knowledge about
>> clocks, but why do you divide the clock frequency by two?
>>
> This is because if the card was sold with 800/850 MHz the table contains
> 1600/1700. And because I don't want that confusion I stick with the "halfed"
> clocks.
> I don't know why they are doubled though or the marketing ones halfed.
>
A short (and not 100% accurate) description comes from DDR - double
data rate. I.e. effective = 2x actual clock rate.

In some cases the vbios use(d) to store the actual, while in other
cases the effective rate.

-Emil


More information about the Nouveau mailing list