[Nouveau] [PATCH 5/9] clk: print the base clocks

Karol Herbst nouveau at karolherbst.de
Mon Feb 29 12:42:14 UTC 2016


Signed-off-by: Karol Herbst <nouveau at karolherbst.de>
---
 drm/nouveau/nvkm/subdev/clk/base.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c
index 0ef371b..0f9b8c5 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,24 @@ 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_subdev *subdev = &clk->subdev;
+	struct nvkm_bios *bios = device->bios;
 	int ret, idx, arglen;
 	const char *mode;
+	struct nvbios_baseclk_header h;
+
+	nvkm_subdev_ctor(&nvkm_clk, device, index, 0, subdev);
+
+	if (bios && !nvbios_baseclock_parse(bios, &h)) {
+		struct nvbios_baseclk_entry base, boost;
+		if (!nvbios_baseclock_entry(bios, &h, h.boost, &boost))
+			nvkm_info(subdev, "boost: %i MHz\n",
+				  boost.clock_mhz / 2);
+		if (!nvbios_baseclock_entry(bios, &h, h.base, &base))
+			nvkm_info(subdev, "base: %i MHz\n",
+				  base.clock_mhz / 2);
+	}
 
-	nvkm_subdev_ctor(&nvkm_clk, device, index, 0, &clk->subdev);
 	clk->func = func;
 	INIT_LIST_HEAD(&clk->states);
 	clk->domains = func->domains;
-- 
2.7.2



More information about the Nouveau mailing list