[Nouveau] [PATCH v2 6/7] subdev/clk: print the base clocks
Karol Herbst
nouveau at karolherbst.de
Wed Dec 2 08:24:33 PST 2015
---
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 43abca7..7cb9dd8 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>
@@ -565,10 +566,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);
+ }
+
clk->func = func;
INIT_LIST_HEAD(&clk->states);
clk->domains = func->domains;
--
2.6.3
More information about the Nouveau
mailing list