[Nouveau] [PATCH 11/11] nvkm/bios/perf: Retreive pointer to unk1c script
Roy Spliet
nouveau at spliet.org
Mon Apr 10 19:37:28 UTC 2017
Signed-off-by: Roy Spliet <nouveau at spliet.org>
---
drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c | 14 ++++++++++++++
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c | 1 +
3 files changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
index 478b1c0..28555d6 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
@@ -40,4 +40,5 @@ struct nvbios_perf_fan {
};
int nvbios_perf_fan_parse(struct nvkm_bios *, struct nvbios_perf_fan *);
+u16 nvbios_perf_script_unk1c(struct nvkm_bios *bios);
#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
index c306835..55c1f36 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c
@@ -213,3 +213,17 @@ nvbios_perf_fan_parse(struct nvkm_bios *bios,
return 0;
}
+
+u16
+nvbios_perf_script_unk1c(struct nvkm_bios *bios)
+{
+ struct bit_entry bit_P;
+
+ if (!bit_entry(bios, 'P', &bit_P)) {
+ if (bit_P.version == 2) {
+ return nvbios_rd16(bios, bit_P.offset + 0x1c);
+ }
+ }
+
+ return 0x0000;
+}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c
index eebd20b..def119c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c
@@ -31,6 +31,7 @@
#include <subdev/bios/M0205.h>
#include <subdev/bios/rammap.h>
#include <subdev/bios/timing.h>
+#include <subdev/bios/perf.h>
#include <subdev/clk.h>
#include <subdev/clk/pll.h>
#include <subdev/ltc.h>
--
2.9.3
More information about the Nouveau
mailing list