All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Add pdaemon load counters
@ 2015-10-26 18:13 Karol Herbst
       [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Karol Herbst @ 2015-10-26 18:13 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

this series makes use of the load counters we can use to get information about
the current load of the gpu.

This series includes the needed pmu bits and a debugfs interface to read them
out. Currently the values are between 0 and 255, because it is much easier to
implement it this way on the pmu.

Karol Herbst (4):
  subdev/pmu/fuc: add gk104
  pmu/fuc: add macros for pdaemon pwr counters
  subdev/pmu/fuc: implement perf
  nouveau/debugfs: add interface for current load

 drm/nouveau/include/nvif/device.h            |    1 +
 drm/nouveau/include/nvkm/subdev/pmu.h        |   10 +
 drm/nouveau/nouveau_debugfs.c                |   23 +
 drm/nouveau/nvkm/subdev/pmu/base.c           |   18 +
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h |  788 ++++++-----
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h |  740 +++++-----
 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4   |   70 +
 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 1869 ++++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h |  710 ++++++----
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h |  755 ++++++-----
 drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc   |   24 +
 drm/nouveau/nvkm/subdev/pmu/fuc/os.h         |    4 +
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc     |  148 ++
 drm/nouveau/nvkm/subdev/pmu/gk104.c          |    4 +-
 drm/nouveau/nvkm/subdev/pmu/gk110.c          |    6 +-
 15 files changed, 3879 insertions(+), 1291 deletions(-)
 create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4
 create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h

-- 
2.6.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] subdev/pmu/fuc: add gk104
       [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2015-10-26 18:13   ` Karol Herbst
       [not found]     ` <1445883189-4407-2-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 18:13   ` [PATCH 2/4] pmu/fuc: add macros for pdaemon pwr counters Karol Herbst
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Karol Herbst @ 2015-10-26 18:13 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

From: Karol Herbst <git@karolherbst.de>

we need this, because since kepler there is PCOPY2 and this is needed for the
counters later in this series
---
 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4   |   70 +
 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 1795 ++++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc   |    1 +
 drm/nouveau/nvkm/subdev/pmu/gk104.c          |    4 +-
 drm/nouveau/nvkm/subdev/pmu/gk110.c          |    6 +-
 5 files changed, 1870 insertions(+), 6 deletions(-)
 create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4
 create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4 b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4
new file mode 100644
index 0000000..01e37ce
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2013 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Ben Skeggs
+ */
+
+#define NVKM_PPWR_CHIPSET GK104
+#define HW_TICKS_PER_US 324
+
+//#define NVKM_FALCON_PC24
+#define NVKM_FALCON_UNSHIFTED_IO
+//#define NVKM_FALCON_MMIO_UAS
+//#define NVKM_FALCON_MMIO_TRAP
+
+#include "macros.fuc"
+
+.section #gk104_pmu_data
+#define INCLUDE_PROC
+#include "kernel.fuc"
+#include "arith.fuc"
+#include "host.fuc"
+#include "memx.fuc"
+#include "perf.fuc"
+#include "i2c_.fuc"
+#include "test.fuc"
+#include "idle.fuc"
+#undef INCLUDE_PROC
+
+#define INCLUDE_DATA
+#include "kernel.fuc"
+#include "arith.fuc"
+#include "host.fuc"
+#include "memx.fuc"
+#include "perf.fuc"
+#include "i2c_.fuc"
+#include "test.fuc"
+#include "idle.fuc"
+#undef INCLUDE_DATA
+.align 256
+
+.section #gk104_pmu_code
+#define INCLUDE_CODE
+#include "kernel.fuc"
+#include "arith.fuc"
+#include "host.fuc"
+#include "memx.fuc"
+#include "perf.fuc"
+#include "i2c_.fuc"
+#include "test.fuc"
+#include "idle.fuc"
+#undef INCLUDE_CODE
+.align 256
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
new file mode 100644
index 0000000..ca7f2b8
--- /dev/null
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
@@ -0,0 +1,1795 @@
+uint32_t gk104_pmu_data[] = {
+/* 0x0000: proc_kern */
+	0x52544e49,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x0058: proc_list_head */
+	0x54534f48,
+	0x0000049d,
+	0x00000446,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x584d454d,
+	0x0000068b,
+	0x0000067d,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x46524550,
+	0x0000068f,
+	0x0000068d,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x5f433249,
+	0x00000aaa,
+	0x0000094d,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x54534554,
+	0x00000acd,
+	0x00000aac,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x454c4449,
+	0x00000ad9,
+	0x00000ad7,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x0268: proc_list_tail */
+/* 0x0268: time_prev */
+	0x00000000,
+/* 0x026c: time_next */
+	0x00000000,
+/* 0x0270: fifo_queue */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x02f0: rfifo_queue */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x0370: memx_func_head */
+	0x00000001,
+	0x00000000,
+	0x000004d3,
+/* 0x037c: memx_func_next */
+	0x00000002,
+	0x00000000,
+	0x00000554,
+	0x00000003,
+	0x00000002,
+	0x000005d8,
+	0x00040004,
+	0x00000000,
+	0x000005f4,
+	0x00010005,
+	0x00000000,
+	0x0000060e,
+	0x00010006,
+	0x00000000,
+	0x000005d3,
+	0x00000007,
+	0x00000000,
+	0x00000619,
+/* 0x03c4: memx_func_tail */
+/* 0x03c4: memx_ts_start */
+	0x00000000,
+/* 0x03c8: memx_ts_end */
+	0x00000000,
+/* 0x03cc: memx_data_head */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x0bcc: memx_data_tail */
+/* 0x0bcc: memx_train_head */
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+/* 0x0ccc: memx_train_tail */
+/* 0x0ccc: i2c_scl_map */
+	0x00000400,
+	0x00000800,
+	0x00001000,
+	0x00002000,
+	0x00004000,
+	0x00008000,
+	0x00010000,
+	0x00020000,
+	0x00040000,
+	0x00080000,
+/* 0x0cf4: i2c_sda_map */
+	0x00100000,
+	0x00200000,
+	0x00400000,
+	0x00800000,
+	0x01000000,
+	0x02000000,
+	0x04000000,
+	0x08000000,
+	0x10000000,
+	0x20000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+};
+
+uint32_t gk104_pmu_code[] = {
+	0x034d0ef5,
+/* 0x0004: rd32 */
+	0x07a007f1,
+	0xbd000ed0,
+	0x01d7f004,
+	0xf101d3f0,
+	0xd007ac07,
+	0x04bd000d,
+/* 0x001c: rd32_wait */
+	0x07acd7f1,
+	0xf100ddcf,
+	0xf47000d4,
+	0xd7f1f51b,
+	0xddcf07a4,
+/* 0x0033: wr32 */
+	0xf100f800,
+	0xd007a007,
+	0x04bd000e,
+	0x07a407f1,
+	0xbd000dd0,
+	0x02d7f004,
+	0xf0f0d5f0,
+	0x07f101d3,
+	0x0dd007ac,
+/* 0x0057: wr32_wait */
+	0xf104bd00,
+	0xcf07acd7,
+	0xd4f100dd,
+	0x1bf47000,
+/* 0x0067: nsec */
+	0xf900f8f5,
+	0xf080f990,
+	0x88cf2c87,
+/* 0x0071: nsec_loop */
+	0x2c97f000,
+	0xbb0099cf,
+	0x9eb80298,
+	0xf41ef406,
+	0x90fc80fc,
+/* 0x0086: wait */
+	0x90f900f8,
+	0x87f080f9,
+	0x0088cf2c,
+/* 0x0090: wait_loop */
+	0xf402eeb9,
+	0xdab90421,
+	0x04adfd02,
+	0xf406acb8,
+	0x97f0120b,
+	0x0099cf2c,
+	0xb80298bb,
+	0x1ef4069b,
+/* 0x00b1: wait_done */
+	0xfc80fce2,
+/* 0x00b7: intr_watchdog */
+	0x9800f890,
+	0x96b003e9,
+	0x2a0bf400,
+	0xbb9a0a98,
+	0x1cf4029a,
+	0x01d7f00f,
+	0x028c21f5,
+	0x0ef494bd,
+/* 0x00d5: intr_watchdog_next_time */
+	0x9b0a9815,
+	0xf400a6b0,
+	0x9ab8090b,
+	0x061cf406,
+/* 0x00e4: intr_watchdog_next_time_set */
+/* 0x00e7: intr_watchdog_next_proc */
+	0x809b0980,
+	0xe0b603e9,
+	0x68e6b158,
+	0xc61bf402,
+/* 0x00f6: intr */
+	0x00f900f8,
+	0x80f904bd,
+	0xa0f990f9,
+	0xc0f9b0f9,
+	0xe0f9d0f9,
+	0xf7f0f0f9,
+	0x0188fe00,
+	0x87f180f9,
+	0x88cf05d0,
+	0x0180b600,
+	0x05d007f1,
+	0xbd0008d0,
+	0x0887f004,
+	0xc40088cf,
+	0x0bf40289,
+	0x9b008020,
+	0xf458e7f0,
+	0x0998b721,
+	0x0096b09b,
+	0xf00e0bf4,
+	0x09d03407,
+	0x8004bd00,
+/* 0x014e: intr_skip_watchdog */
+	0x89e49a09,
+	0x0bf40800,
+	0x8897f13c,
+	0x0099cf06,
+	0xf4029ac4,
+	0xc7f1260b,
+	0xcccf04c0,
+	0xf1c0f900,
+	0xf14f48e7,
+	0xf05453e3,
+	0x21f500d7,
+	0xc0fc02f1,
+	0x04c007f1,
+	0xbd000cd0,
+/* 0x0185: intr_subintr_skip_fifo */
+	0x8807f104,
+	0x0009d006,
+/* 0x018e: intr_skip_subintr */
+	0x89c404bd,
+	0x070bf420,
+	0xffbfa4f1,
+/* 0x0198: intr_skip_pause */
+	0xf44089c4,
+	0xa4f1070b,
+/* 0x01a2: intr_skip_user0 */
+	0x07f0ffbf,
+	0x0008d004,
+	0x80fc04bd,
+	0xfc0088fe,
+	0xfce0fcf0,
+	0xfcc0fcd0,
+	0xfca0fcb0,
+	0xfc80fc90,
+	0x0032f400,
+/* 0x01c6: ticks_from_ns */
+	0xc0f901f8,
+	0xd7f1b0f9,
+	0xd3f00144,
+	0xb321f500,
+	0xe8ccec03,
+	0x00b4b003,
+	0xec120bf4,
+	0xf103e8ee,
+	0xf00144d7,
+	0x21f500d3,
+/* 0x01ee: ticks_from_ns_quit */
+	0xceb903b3,
+	0xfcb0fc02,
+/* 0x01f7: ticks_from_us */
+	0xf900f8c0,
+	0xf1b0f9c0,
+	0xf00144d7,
+	0x21f500d3,
+	0xceb903b3,
+	0x00b4b002,
+	0xbd050bf4,
+/* 0x0211: ticks_from_us_quit */
+	0xfcb0fce4,
+/* 0x0217: ticks_to_us */
+	0xf100f8c0,
+	0xf00144d7,
+	0xedff00d3,
+/* 0x0223: timer */
+	0xf900f8ec,
+	0xf480f990,
+	0xf8981032,
+	0x0086b003,
+	0xbd531cf4,
+	0x3807f084,
+	0xbd0008d0,
+	0x3487f004,
+	0x980088cf,
+	0x98bb9a09,
+	0x00e9bb02,
+	0xf003fe80,
+	0x88cf0887,
+	0x0284f000,
+	0xf0201bf4,
+	0x88cf3487,
+	0x06e0b800,
+	0xb8090bf4,
+	0x1cf406e8,
+/* 0x026d: timer_reset */
+	0x3407f00e,
+	0xbd000ed0,
+	0x9a0e8004,
+/* 0x0278: timer_enable */
+	0xf00187f0,
+	0x08d03807,
+/* 0x0283: timer_done */
+	0xf404bd00,
+	0x80fc1031,
+	0x00f890fc,
+/* 0x028c: send_proc */
+	0x90f980f9,
+	0x9805e898,
+	0x86f004e9,
+	0x0689b804,
+	0xc42a0bf4,
+	0x88940398,
+	0x1880b604,
+	0x98008ebb,
+	0x8a8000fa,
+	0x018d8000,
+	0x80028c80,
+	0x90b6038b,
+	0x0794f001,
+	0xf404e980,
+/* 0x02c6: send_done */
+	0x90fc0231,
+	0x00f880fc,
+/* 0x02cc: find */
+	0x87f080f9,
+	0x0131f458,
+/* 0x02d4: find_loop */
+	0xb8008a98,
+	0x0bf406ae,
+	0x5880b610,
+	0x026886b1,
+	0xf4f01bf4,
+/* 0x02ea: find_done */
+	0x8eb90132,
+	0xf880fc02,
+/* 0x02f1: send */
+	0xcc21f500,
+	0x9701f402,
+/* 0x02fa: recv */
+	0x90f900f8,
+	0xe89880f9,
+	0x04e99805,
+	0xb80132f4,
+	0x0bf40689,
+	0x0389c43d,
+	0xf00180b6,
+	0xe8800784,
+	0x02ea9805,
+	0x8ffef0f9,
+	0xb9f0f901,
+	0x999402ef,
+	0x00e9bb04,
+	0x9818e0b6,
+	0xec9803eb,
+	0x01ed9802,
+	0xf900ee98,
+	0xfef0fca5,
+	0x31f400f8,
+/* 0x0347: recv_done */
+	0xfcf0fc01,
+	0xf890fc80,
+/* 0x034d: init */
+	0x0817f100,
+	0x0011cf01,
+	0x010911e7,
+	0xfe0814b6,
+	0x17f10014,
+	0x13f000e0,
+	0x1c07f000,
+	0xbd0001d0,
+	0xff17f004,
+	0xd01407f0,
+	0x04bd0001,
+	0xf10217f0,
+	0xf0080015,
+	0x01d01007,
+	0xf104bd00,
+	0xf000f617,
+	0x10fe0013,
+	0x1031f400,
+	0xf00117f0,
+	0x01d03807,
+	0xf004bd00,
+/* 0x03a2: init_proc */
+	0xf19858f7,
+	0x0016b001,
+	0xf9fa0bf4,
+	0x58f0b615,
+/* 0x03b3: mulu32_32_64 */
+	0xf9f20ef4,
+	0xf920f910,
+	0x9540f930,
+	0xd29510e1,
+	0xbdc4bd10,
+	0xc0edffb4,
+	0xb9301dff,
+	0x34f10234,
+	0x34b6ffff,
+	0x1045b610,
+	0xbb00c3bb,
+	0xe2ff01b4,
+	0x0234b930,
+	0xffff34f1,
+	0xb61034b6,
+	0xc3bb1045,
+	0x01b4bb00,
+	0xbb3012ff,
+	0x40fc00b3,
+	0x20fc30fc,
+	0x00f810fc,
+/* 0x0404: host_send */
+	0x04b017f1,
+	0xf10011cf,
+	0xcf04a027,
+	0x12b80022,
+	0x2f0bf406,
+	0x94071ec4,
+	0xe0b704ee,
+	0xeb980270,
+	0x02ec9803,
+	0x9801ed98,
+	0x21f500ee,
+	0x10b602f1,
+	0x0f1ec401,
+	0x04b007f1,
+	0xbd000ed0,
+	0xc30ef404,
+/* 0x0444: host_send_done */
+/* 0x0446: host_recv */
+	0x17f100f8,
+	0x13f14e49,
+	0xe1b85254,
+	0xb30bf406,
+/* 0x0454: host_recv_wait */
+	0x04cc17f1,
+	0xf10011cf,
+	0xcf04c827,
+	0x16f00022,
+	0x0612b808,
+	0xc4ec0bf4,
+	0x34b60723,
+	0xf030b704,
+	0x033b8002,
+	0x80023c80,
+	0x3e80013d,
+	0x0120b600,
+	0xf10f24f0,
+	0xd004c807,
+	0x04bd0002,
+	0xf04027f0,
+	0x02d00007,
+	0xf804bd00,
+/* 0x049d: host_init */
+	0x8017f100,
+	0x1014b600,
+	0x027015f1,
+	0x04d007f1,
+	0xbd0001d0,
+	0x8017f104,
+	0x1014b600,
+	0x02f015f1,
+	0x04dc07f1,
+	0xbd0001d0,
+	0x0117f004,
+	0x04c407f1,
+	0xbd0001d0,
+/* 0x04d3: memx_func_enter */
+	0xf100f804,
+	0xf1162067,
+	0xf1f55d77,
+	0xb9ffff73,
+	0x21f4026e,
+	0x02d8b904,
+	0xf90487fd,
+	0xfc80f960,
+	0xf4e0fcd0,
+	0x77f13321,
+	0x73f1fffe,
+	0x6eb9ffff,
+	0x0421f402,
+	0xfd02d8b9,
+	0x60f90487,
+	0xd0fc80f9,
+	0x21f4e0fc,
+	0xf067f133,
+	0x026eb926,
+	0xb90421f4,
+	0x87fd02d8,
+	0xf960f904,
+	0xfcd0fc80,
+	0x3321f4e0,
+	0xf10467f0,
+	0xd007e007,
+	0x04bd0006,
+/* 0x053c: memx_func_enter_wait */
+	0x07c067f1,
+	0xf00066cf,
+	0x0bf40464,
+	0x2c67f0f6,
+	0x800066cf,
+	0x00f8f106,
+/* 0x0554: memx_func_leave */
+	0xcf2c67f0,
+	0x06800066,
+	0x0467f0f2,
+	0x07e407f1,
+	0xbd0006d0,
+/* 0x0569: memx_func_leave_wait */
+	0xc067f104,
+	0x0066cf07,
+	0xf40464f0,
+	0x67f1f61b,
+	0x77f126f0,
+	0x73f00001,
+	0x026eb900,
+	0xb90421f4,
+	0x87fd02d8,
+	0xf960f905,
+	0xfcd0fc80,
+	0x3321f4e0,
+	0x162067f1,
+	0xf4026eb9,
+	0xd8b90421,
+	0x0587fd02,
+	0x80f960f9,
+	0xe0fcd0fc,
+	0xf13321f4,
+	0xf00aa277,
+	0x6eb90073,
+	0x0421f402,
+	0xfd02d8b9,
+	0x60f90587,
+	0xd0fc80f9,
+	0x21f4e0fc,
+/* 0x05d3: memx_func_wait_vblank */
+	0xb600f833,
+	0x00f80410,
+/* 0x05d8: memx_func_wr32 */
+	0x98001698,
+	0x10b60115,
+	0xf960f908,
+	0xfcd0fc50,
+	0x3321f4e0,
+	0xf40242b6,
+	0x00f8e91b,
+/* 0x05f4: memx_func_wait */
+	0xcf2c87f0,
+	0x1e980088,
+	0x011d9800,
+	0x98021c98,
+	0x10b6031b,
+	0x8621f410,
+/* 0x060e: memx_func_delay */
+	0x1e9800f8,
+	0x0410b600,
+	0xf86721f4,
+/* 0x0619: memx_func_train */
+/* 0x061b: memx_exec */
+	0xf900f800,
+	0xb9d0f9e0,
+	0xb2b902c1,
+/* 0x0625: memx_exec_next */
+	0x00139802,
+	0xe70410b6,
+	0xe701f034,
+	0xb601e033,
+	0x30f00132,
+	0xde35980c,
+	0x12b855f9,
+	0xe41ef406,
+	0x98f10b98,
+	0xcbbbf20c,
+	0xc4b7f102,
+	0x00bbcf07,
+	0xe0fcd0fc,
+	0x02f121f5,
+/* 0x065e: memx_info */
+	0xc67000f8,
+	0x0e0bf401,
+/* 0x0664: memx_info_data */
+	0x03ccc7f1,
+	0x0800b7f1,
+/* 0x066f: memx_info_train */
+	0xf10b0ef4,
+	0xf10bccc7,
+/* 0x0677: memx_info_send */
+	0xf50100b7,
+	0xf802f121,
+/* 0x067d: memx_recv */
+	0x01d6b000,
+	0xb09b0bf4,
+	0x0bf400d6,
+/* 0x068b: memx_init */
+	0xf800f8d8,
+/* 0x068d: perf_recv */
+/* 0x068f: perf_init */
+	0xf800f800,
+/* 0x0691: i2c_drive_scl */
+	0x0036b000,
+	0xf10e0bf4,
+	0xd007e007,
+	0x04bd0001,
+/* 0x06a2: i2c_drive_scl_lo */
+	0x07f100f8,
+	0x01d007e4,
+	0xf804bd00,
+/* 0x06ad: i2c_drive_sda */
+	0x0036b000,
+	0xf10e0bf4,
+	0xd007e007,
+	0x04bd0002,
+/* 0x06be: i2c_drive_sda_lo */
+	0x07f100f8,
+	0x02d007e4,
+	0xf804bd00,
+/* 0x06c9: i2c_sense_scl */
+	0x0132f400,
+	0x07c437f1,
+	0xfd0033cf,
+	0x0bf40431,
+	0x0131f406,
+/* 0x06dc: i2c_sense_scl_done */
+/* 0x06de: i2c_sense_sda */
+	0x32f400f8,
+	0xc437f101,
+	0x0033cf07,
+	0xf40432fd,
+	0x31f4060b,
+/* 0x06f1: i2c_sense_sda_done */
+/* 0x06f3: i2c_raise_scl */
+	0xf900f801,
+	0x9847f140,
+	0x0137f008,
+	0x069121f5,
+/* 0x0700: i2c_raise_scl_wait */
+	0x03e8e7f1,
+	0xf56721f4,
+	0xf406c921,
+	0x42b60901,
+	0xef1bf401,
+/* 0x0714: i2c_raise_scl_done */
+	0x00f840fc,
+/* 0x0718: i2c_start */
+	0x06c921f5,
+	0xf50d11f4,
+	0xf406de21,
+	0x0ef40611,
+/* 0x0729: i2c_start_rep */
+	0x0037f030,
+	0x069121f5,
+	0xf50137f0,
+	0xbb06ad21,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x06f321f5,
+	0xf40464b6,
+/* 0x0756: i2c_start_send */
+	0x37f01f11,
+	0xad21f500,
+	0x88e7f106,
+	0x6721f413,
+	0xf50037f0,
+	0xf1069121,
+	0xf41388e7,
+/* 0x0772: i2c_start_out */
+	0x00f86721,
+/* 0x0774: i2c_stop */
+	0xf50037f0,
+	0xf0069121,
+	0x21f50037,
+	0xe7f106ad,
+	0x21f403e8,
+	0x0137f067,
+	0x069121f5,
+	0x1388e7f1,
+	0xf06721f4,
+	0x21f50137,
+	0xe7f106ad,
+	0x21f41388,
+/* 0x07a7: i2c_bitw */
+	0xf500f867,
+	0xf106ad21,
+	0xf403e8e7,
+	0x76bb6721,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb606f321,
+	0x11f40464,
+	0x88e7f118,
+	0x6721f413,
+	0xf50037f0,
+	0xf1069121,
+	0xf41388e7,
+/* 0x07e6: i2c_bitw_out */
+	0x00f86721,
+/* 0x07e8: i2c_bitr */
+	0xf50137f0,
+	0xf106ad21,
+	0xf403e8e7,
+	0x76bb6721,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb606f321,
+	0x11f40464,
+	0xde21f51b,
+	0x0037f006,
+	0x069121f5,
+	0x1388e7f1,
+	0xf06721f4,
+	0x31f4013c,
+/* 0x082d: i2c_bitr_done */
+/* 0x082f: i2c_get_byte */
+	0xf000f801,
+	0x47f00057,
+/* 0x0835: i2c_get_byte_next */
+	0x0154b608,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0xe821f550,
+	0x0464b607,
+	0xfd2b11f4,
+	0x42b60553,
+	0xd81bf401,
+	0xbb0137f0,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x07a721f5,
+/* 0x087f: i2c_get_byte_done */
+	0xf80464b6,
+/* 0x0881: i2c_put_byte */
+	0x0847f000,
+/* 0x0884: i2c_put_byte_next */
+	0xff0142b6,
+	0x76bb3854,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb607a721,
+	0x11f40464,
+	0x0046b034,
+	0xbbd81bf4,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x07e821f5,
+	0xf40464b6,
+	0x76bb0f11,
+	0x0136b000,
+	0xf4061bf4,
+/* 0x08da: i2c_put_byte_done */
+	0x00f80132,
+/* 0x08dc: i2c_addr */
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x1821f550,
+	0x0464b607,
+	0xe72911f4,
+	0xb6012ec3,
+	0x53fd0134,
+	0x0076bb05,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b60881,
+/* 0x0921: i2c_addr_done */
+/* 0x0923: i2c_acquire_addr */
+	0xc700f804,
+	0xe4b6f8ce,
+	0x14e0b705,
+/* 0x092f: i2c_acquire */
+	0xf500f8d0,
+	0xf4092321,
+	0xd9f00421,
+	0x3321f403,
+/* 0x093e: i2c_release */
+	0x21f500f8,
+	0x21f40923,
+	0x03daf004,
+	0xf83321f4,
+/* 0x094d: i2c_recv */
+	0x0132f400,
+	0xb6f8c1c7,
+	0x16b00214,
+	0x3a1ff528,
+	0xf413a001,
+	0x0032980c,
+	0x0ccc13a0,
+	0xf4003198,
+	0xd0f90231,
+	0xd0f9e0f9,
+	0x000067f1,
+	0x100063f1,
+	0xbb016792,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x092f21f5,
+	0xfc0464b6,
+	0x00d6b0d0,
+	0x00b31bf5,
+	0xbb0057f0,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x08dc21f5,
+	0xf50464b6,
+	0xc700d011,
+	0x76bbe0c5,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb6088121,
+	0x11f50464,
+	0x57f000ad,
+	0x0076bb01,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b608dc,
+	0x8a11f504,
+	0x0076bb00,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b6082f,
+	0x6a11f404,
+	0xbbe05bcb,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x077421f5,
+	0xb90464b6,
+	0x74bd025b,
+/* 0x0a53: i2c_recv_not_rd08 */
+	0xb0430ef4,
+	0x1bf401d6,
+	0x0057f03d,
+	0x08dc21f5,
+	0xc73311f4,
+	0x21f5e0c5,
+	0x11f40881,
+	0x0057f029,
+	0x08dc21f5,
+	0xc71f11f4,
+	0x21f5e0b5,
+	0x11f40881,
+	0x7421f515,
+	0xc774bd07,
+	0x1bf408c5,
+	0x0232f409,
+/* 0x0a93: i2c_recv_not_wr08 */
+/* 0x0a93: i2c_recv_done */
+	0xc7030ef4,
+	0x21f5f8ce,
+	0xe0fc093e,
+	0x12f4d0fc,
+	0x027cb90a,
+	0x02f121f5,
+/* 0x0aa8: i2c_recv_exit */
+/* 0x0aaa: i2c_init */
+	0x00f800f8,
+/* 0x0aac: test_recv */
+	0x05d817f1,
+	0xb60011cf,
+	0x07f10110,
+	0x01d005d8,
+	0xf104bd00,
+	0xf1d900e7,
+	0xf5134fe3,
+	0xf8022321,
+/* 0x0acd: test_init */
+	0x00e7f100,
+	0x2321f508,
+/* 0x0ad7: idle_recv */
+	0xf800f802,
+/* 0x0ad9: idle */
+	0x0031f400,
+	0x05d417f1,
+	0xb60011cf,
+	0x07f10110,
+	0x01d005d4,
+/* 0x0aef: idle_loop */
+	0xf004bd00,
+	0x32f45817,
+/* 0x0af5: idle_proc */
+/* 0x0af5: idle_proc_exec */
+	0xb910f902,
+	0x21f5021e,
+	0x10fc02fa,
+	0xf40911f4,
+	0x0ef40231,
+/* 0x0b09: idle_proc_next */
+	0x5810b6ef,
+	0xf4061fb8,
+	0x02f4e61b,
+	0x0028f4dd,
+	0x00c10ef4,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+};
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
index 96fc984..c5ec61f 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
@@ -25,6 +25,7 @@
 #define GT215 0xa3
 #define GF100 0xc0
 #define GF119 0xd9
+#define GK104 0xe4
 #define GK208 0x108
 
 #include "os.h"
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk104.c b/drm/nouveau/nvkm/subdev/pmu/gk104.c
index ce7de3e..3bd7be6 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gk104.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gk104.c
@@ -21,10 +21,8 @@
  *
  * Authors: Ben Skeggs
  */
-#define gf119_pmu_code gk104_pmu_code
-#define gf119_pmu_data gk104_pmu_data
 #include "priv.h"
-#include "fuc/gf119.fuc4.h"
+#include "fuc/gk104.fuc4.h"
 
 static void
 gk104_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk110.c b/drm/nouveau/nvkm/subdev/pmu/gk110.c
index ae25524..5b0796a 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gk110.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gk110.c
@@ -21,10 +21,10 @@
  *
  * Authors: Ben Skeggs
  */
-#define gf119_pmu_code gk110_pmu_code
-#define gf119_pmu_data gk110_pmu_data
+#define gk104_pmu_code gk110_pmu_code
+#define gk104_pmu_data gk110_pmu_data
 #include "priv.h"
-#include "fuc/gf119.fuc4.h"
+#include "fuc/gk104.fuc4.h"
 
 #include <subdev/timer.h>
 
-- 
2.6.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] pmu/fuc: add macros for pdaemon pwr counters
       [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 18:13   ` [PATCH 1/4] subdev/pmu/fuc: add gk104 Karol Herbst
@ 2015-10-26 18:13   ` Karol Herbst
       [not found]     ` <1445883189-4407-3-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 18:13   ` [PATCH 3/4] subdev/pmu/fuc: implement perf Karol Herbst
  2015-10-26 18:13   ` [PATCH 4/4] nouveau/debugfs: add interface for current load Karol Herbst
  3 siblings, 1 reply; 12+ messages in thread
From: Karol Herbst @ 2015-10-26 18:13 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

From: Karol Herbst <git@karolherbst.de>

---
 drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
index c5ec61f..86b8fd4 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
@@ -66,6 +66,29 @@
 #define NV_PPWR_RFIFO_GET                                                0x04cc
 #define NV_PPWR_H2D                                                      0x04d0
 #define NV_PPWR_D2H                                                      0x04dc
+#define NV_PPWR_COUNTER_MASK(i)                            (0x10 * (i) + 0x0504)
+#define NV_PPWR_COUNTER_COUNT(i)                           (0x10 * (i) + 0x0508)
+#define NV_PPWR_COUNTER_COUNT_RESET                                  0x80000000
+#define NV_PPWR_COUNTER_MODE(i)                            (0x10 * (i) + 0x050c)
+#define NV_PPWR_COUNTER_MODE_NEVER                                            0
+#define NV_PPWR_COUNTER_MODE_IF_ALL                                           1
+#define NV_PPWR_COUNTER_MODE_IF_NOT_ALL                                       2
+#define NV_PPWR_COUNTER_MODE_ALWAYS                                           3
+#define NV_PPWR_COUNTER_SIG_GR_IDLE                                  0x00000001
+#define NV_PPWR_COUNTER_SIG_GR_HUB_IDLE                              0x00000002
+#define NV_PPWR_COUNTER_SIG_GR_GPC_IDLE                              0x00000004
+#define NV_PPWR_COUNTER_SIG_GR_ROP_IDLE                              0x00000008
+#define NV_PPWR_COUNTER_SIG_PVLD_IDLE                                0x00000010
+#define NV_PPWR_COUNTER_SIG_PPDEC_IDLE                               0x00000020
+#define NV_PPWR_COUNTER_SIG_PPPP_IDLE                                0x00000040
+#define NV_PPWR_COUNTER_SIG_BFB_PART0_REQ                            0x00000080
+#define NV_PPWR_COUNTER_SIG_FB_PART0_REQ                             0x00000100
+#define NV_PPWR_COUNTER_SIG_PMFB                                     0x00001000
+#define NV_PPWR_COUNTER_SIG_PVENC                                    0x00020000
+#define NV_PPWR_COUNTER_SIG_PCOPY0_IDLE                              0x00080000
+#define NV_PPWR_COUNTER_SIG_PCOPY1_IDLE                              0x00100000
+#define NV_PPWR_COUNTER_SIG_PCOPY2_IDLE                              0x00200000
+#define NV_PPWR_COUNTER_SIG_PCIE                                     0x20000000
 #if NVKM_PPWR_CHIPSET < GK208
 #define NV_PPWR_DSCRATCH(i)                                   (4 * (i) + 0x05d0)
 #endif
-- 
2.6.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] subdev/pmu/fuc: implement perf
       [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 18:13   ` [PATCH 1/4] subdev/pmu/fuc: add gk104 Karol Herbst
  2015-10-26 18:13   ` [PATCH 2/4] pmu/fuc: add macros for pdaemon pwr counters Karol Herbst
@ 2015-10-26 18:13   ` Karol Herbst
       [not found]     ` <1445883189-4407-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 18:13   ` [PATCH 4/4] nouveau/debugfs: add interface for current load Karol Herbst
  3 siblings, 1 reply; 12+ messages in thread
From: Karol Herbst @ 2015-10-26 18:13 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

From: Karol Herbst <git@karolherbst.de>

---
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 788 +++++++++++++++------------
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 740 ++++++++++++++-----------
 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 740 ++++++++++++++-----------
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 710 ++++++++++++++----------
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 755 ++++++++++++++-----------
 drm/nouveau/nvkm/subdev/pmu/fuc/os.h         |   4 +
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc     | 148 +++++
 7 files changed, 2267 insertions(+), 1618 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
index 302557c..cd1c8e5 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
@@ -68,7 +68,7 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x46524550,
-	0x00000762,
+	0x00000875,
 	0x00000760,
 	0x00000000,
 	0x00000000,
@@ -90,8 +90,8 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x5f433249,
-	0x00000b92,
-	0x00000a35,
+	0x00000d51,
+	0x00000bf4,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -112,8 +112,8 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x54534554,
-	0x00000bbb,
-	0x00000b94,
+	0x00000d7a,
+	0x00000d53,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -134,8 +134,8 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x454c4449,
-	0x00000bc7,
-	0x00000bc5,
+	0x00000d86,
+	0x00000d84,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -834,7 +834,15 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_attr_start */
+/* 0x0ccc: perf_polling_period_us */
+	0x000186a0,
+/* 0x0cd0: perf_eng_gr */
+/* 0x0cd1: perf_eng_vdec */
+/* 0x0cd2: perf_eng_mc */
+/* 0x0cd3: perf_eng_pcie */
+	0x00000000,
+/* 0x0cd4: i2c_scl_map */
 	0x00001000,
 	0x00004000,
 	0x00010000,
@@ -845,7 +853,7 @@ uint32_t gf100_pmu_data[] = {
 	0x01000000,
 	0x04000000,
 	0x10000000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0cfc: i2c_sda_map */
 	0x00002000,
 	0x00008000,
 	0x00020000,
@@ -856,7 +864,7 @@ uint32_t gf100_pmu_data[] = {
 	0x02000000,
 	0x08000000,
 	0x20000000,
-/* 0x0d1c: i2c_ctrl */
+/* 0x0d24: i2c_ctrl */
 	0x0000e138,
 	0x0000e150,
 	0x0000e168,
@@ -912,8 +920,6 @@ uint32_t gf100_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000000,
-	0x00000000,
 };
 
 uint32_t gf100_pmu_code[] = {
@@ -1456,400 +1462,468 @@ uint32_t gf100_pmu_code[] = {
 /* 0x075e: memx_init */
 	0x00f800f8,
 /* 0x0760: perf_recv */
-/* 0x0762: perf_init */
-	0x00f800f8,
-/* 0x0764: i2c_drive_scl */
-	0xf40036b0,
-	0x07f1110b,
-	0x04b607e0,
-	0x0001d006,
-	0x00f804bd,
-/* 0x0778: i2c_drive_scl_lo */
-	0x07e407f1,
+	0xa7f110f9,
+	0xa3f14f48,
+	0xeab85453,
+	0x441bf406,
+	0xf401d6b0,
+	0x0ef4060b,
+/* 0x0779: perf_load */
+	0xbdb4bd50,
+	0xd307f1c4,
+	0x000c180c,
+	0xc4b604bd,
+	0xd207f108,
+	0x000c180c,
+	0xc4b604bd,
+	0xd107f108,
+	0x000c180c,
+	0xc4b604bd,
+	0xd007f108,
+	0x000c180c,
+	0x21f504bd,
+	0x0ef40342,
+/* 0x07b1: perf_recv_not_host */
+	0xca21f518,
+	0xcc07f107,
+	0x000e980c,
+	0x21f504bd,
+	0x21f50236,
+/* 0x07c6: perf_recv_exit */
+	0x10fc0262,
+/* 0x07ca: perf_counter_readout */
+	0xe7f100f8,
+	0xe4b60508,
+	0x00eecf06,
+	0xf1ffeecc,
+	0xb60518d7,
+	0xddcf06d4,
+	0xdcdeff00,
+	0x0cd007f1,
+	0xbd000d00,
+	0x28d7f104,
+	0x06d4b605,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d000cd1,
+	0xf104bd00,
+	0xb60538d7,
+	0xddcf06d4,
+	0xdcdeff00,
+	0x0cd207f1,
+	0xbd000d00,
+	0x48d7f104,
+	0x06d4b605,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d000cd3,
+	0xf104bd00,
+	0xf10000e7,
+	0xf18000e3,
+	0xb6050807,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6051807,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6052807,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6053807,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6054807,
+	0x0ed00604,
+	0xf804bd00,
+/* 0x0875: perf_init */
+	0x03e7f100,
+	0x00e3f000,
+	0x050c07f1,
 	0xd00604b6,
-	0x04bd0001,
-/* 0x0786: i2c_drive_sda */
-	0x36b000f8,
-	0x110bf400,
-	0x07e007f1,
+	0x04bd000e,
+	0x0002e7f1,
+	0xf100e3f0,
+	0xb6051c07,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6052c07,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6053c07,
+	0x0ed00604,
+	0xf104bd00,
+	0xb6054c07,
+	0x0ed00604,
+	0xf104bd00,
+	0xf0000fe7,
+	0x07f118e3,
+	0x04b60514,
+	0x000ed006,
+	0xe7f104bd,
+	0xe3f00070,
+	0x2407f100,
+	0x0604b605,
+	0xbd000ed0,
+	0x80e7f104,
+	0x00e3f000,
+	0x053407f1,
 	0xd00604b6,
-	0x04bd0002,
-/* 0x079a: i2c_drive_sda_lo */
-	0x07f100f8,
-	0x04b607e4,
-	0x0002d006,
-	0x00f804bd,
-/* 0x07a8: i2c_sense_scl */
-	0xf10132f4,
-	0xb607c437,
-	0x33cf0634,
-	0x0431fd00,
-	0xf4060bf4,
-/* 0x07be: i2c_sense_scl_done */
-	0x00f80131,
-/* 0x07c0: i2c_sense_sda */
-	0xf10132f4,
-	0xb607c437,
-	0x33cf0634,
-	0x0432fd00,
-	0xf4060bf4,
-/* 0x07d6: i2c_sense_sda_done */
-	0x00f80131,
-/* 0x07d8: i2c_raise_scl */
-	0x47f140f9,
-	0x37f00898,
-	0x6421f501,
-/* 0x07e5: i2c_raise_scl_wait */
-	0xe8e7f107,
-	0x7f21f403,
-	0x07a821f5,
-	0xb60901f4,
-	0x1bf40142,
-/* 0x07f9: i2c_raise_scl_done */
-	0xf840fcef,
-/* 0x07fd: i2c_start */
-	0xa821f500,
-	0x0d11f407,
-	0x07c021f5,
-	0xf40611f4,
-/* 0x080e: i2c_start_rep */
-	0x37f0300e,
-	0x6421f500,
-	0x0137f007,
-	0x078621f5,
-	0xb60076bb,
-	0x50f90465,
-	0xbb046594,
-	0x50bd0256,
-	0xfc0475fd,
-	0xd821f550,
-	0x0464b607,
-/* 0x083b: i2c_start_send */
-	0xf01f11f4,
-	0x21f50037,
-	0xe7f10786,
-	0x21f41388,
-	0x0037f07f,
-	0x076421f5,
-	0x1388e7f1,
-/* 0x0857: i2c_start_out */
-	0xf87f21f4,
-/* 0x0859: i2c_stop */
-	0x0037f000,
-	0x076421f5,
-	0xf50037f0,
-	0xf1078621,
-	0xf403e8e7,
-	0x37f07f21,
-	0x6421f501,
-	0x88e7f107,
-	0x7f21f413,
-	0xf50137f0,
-	0xf1078621,
-	0xf41388e7,
-	0x00f87f21,
-/* 0x088c: i2c_bitw */
-	0x078621f5,
+	0x04bd000e,
+	0x0000e7f1,
+	0x2000e3f1,
+	0x054407f1,
+	0xd00604b6,
+	0x04bd000e,
+	0x07ca21f5,
+	0x0ccc07f1,
+	0xbd000e98,
+	0x3621f504,
+	0x6221f502,
+/* 0x0923: i2c_drive_scl */
+	0xb000f802,
+	0x0bf40036,
+	0xe007f111,
+	0x0604b607,
+	0xbd0001d0,
+/* 0x0937: i2c_drive_scl_lo */
+	0xf100f804,
+	0xb607e407,
+	0x01d00604,
+	0xf804bd00,
+/* 0x0945: i2c_drive_sda */
+	0x0036b000,
+	0xf1110bf4,
+	0xb607e007,
+	0x02d00604,
+	0xf804bd00,
+/* 0x0959: i2c_drive_sda_lo */
+	0xe407f100,
+	0x0604b607,
+	0xbd0002d0,
+/* 0x0967: i2c_sense_scl */
+	0xf400f804,
+	0x37f10132,
+	0x34b607c4,
+	0x0033cf06,
+	0xf40431fd,
+	0x31f4060b,
+/* 0x097d: i2c_sense_scl_done */
+/* 0x097f: i2c_sense_sda */
+	0xf400f801,
+	0x37f10132,
+	0x34b607c4,
+	0x0033cf06,
+	0xf40432fd,
+	0x31f4060b,
+/* 0x0995: i2c_sense_sda_done */
+/* 0x0997: i2c_raise_scl */
+	0xf900f801,
+	0x9847f140,
+	0x0137f008,
+	0x092321f5,
+/* 0x09a4: i2c_raise_scl_wait */
 	0x03e8e7f1,
-	0xbb7f21f4,
+	0xf57f21f4,
+	0xf4096721,
+	0x42b60901,
+	0xef1bf401,
+/* 0x09b8: i2c_raise_scl_done */
+	0x00f840fc,
+/* 0x09bc: i2c_start */
+	0x096721f5,
+	0xf50d11f4,
+	0xf4097f21,
+	0x0ef40611,
+/* 0x09cd: i2c_start_rep */
+	0x0037f030,
+	0x092321f5,
+	0xf50137f0,
+	0xbb094521,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x07d821f5,
+	0x099721f5,
 	0xf40464b6,
-	0xe7f11811,
-	0x21f41388,
-	0x0037f07f,
-	0x076421f5,
+/* 0x09fa: i2c_start_send */
+	0x37f01f11,
+	0x4521f500,
+	0x88e7f109,
+	0x7f21f413,
+	0xf50037f0,
+	0xf1092321,
+	0xf41388e7,
+/* 0x0a16: i2c_start_out */
+	0x00f87f21,
+/* 0x0a18: i2c_stop */
+	0xf50037f0,
+	0xf0092321,
+	0x21f50037,
+	0xe7f10945,
+	0x21f403e8,
+	0x0137f07f,
+	0x092321f5,
 	0x1388e7f1,
-/* 0x08cb: i2c_bitw_out */
-	0xf87f21f4,
-/* 0x08cd: i2c_bitr */
-	0x0137f000,
-	0x078621f5,
-	0x03e8e7f1,
-	0xbb7f21f4,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x07d821f5,
-	0xf40464b6,
-	0x21f51b11,
-	0x37f007c0,
-	0x6421f500,
-	0x88e7f107,
+	0xf07f21f4,
+	0x21f50137,
+	0xe7f10945,
+	0x21f41388,
+/* 0x0a4b: i2c_bitw */
+	0xf500f87f,
+	0xf1094521,
+	0xf403e8e7,
+	0x76bb7f21,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb6099721,
+	0x11f40464,
+	0x88e7f118,
 	0x7f21f413,
-	0xf4013cf0,
-/* 0x0912: i2c_bitr_done */
-	0x00f80131,
-/* 0x0914: i2c_get_byte */
-	0xf00057f0,
-/* 0x091a: i2c_get_byte_next */
-	0x54b60847,
-	0x0076bb01,
-	0xf90465b6,
-	0x04659450,
-	0xbd0256bb,
-	0x0475fd50,
-	0x21f550fc,
-	0x64b608cd,
-	0x2b11f404,
-	0xb60553fd,
-	0x1bf40142,
-	0x0137f0d8,
+	0xf50037f0,
+	0xf1092321,
+	0xf41388e7,
+/* 0x0a8a: i2c_bitw_out */
+	0x00f87f21,
+/* 0x0a8c: i2c_bitr */
+	0xf50137f0,
+	0xf1094521,
+	0xf403e8e7,
+	0x76bb7f21,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb6099721,
+	0x11f40464,
+	0x7f21f51b,
+	0x0037f009,
+	0x092321f5,
+	0x1388e7f1,
+	0xf07f21f4,
+	0x31f4013c,
+/* 0x0ad1: i2c_bitr_done */
+/* 0x0ad3: i2c_get_byte */
+	0xf000f801,
+	0x47f00057,
+/* 0x0ad9: i2c_get_byte_next */
+	0x0154b608,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
 	0x8c21f550,
-	0x0464b608,
-/* 0x0964: i2c_get_byte_done */
-/* 0x0966: i2c_put_byte */
-	0x47f000f8,
-/* 0x0969: i2c_put_byte_next */
-	0x0142b608,
-	0xbb3854ff,
+	0x0464b60a,
+	0xfd2b11f4,
+	0x42b60553,
+	0xd81bf401,
+	0xbb0137f0,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x0a4b21f5,
+/* 0x0b23: i2c_get_byte_done */
+	0xf80464b6,
+/* 0x0b25: i2c_put_byte */
+	0x0847f000,
+/* 0x0b28: i2c_put_byte_next */
+	0xff0142b6,
+	0x76bb3854,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb60a4b21,
+	0x11f40464,
+	0x0046b034,
+	0xbbd81bf4,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x088c21f5,
+	0x0a8c21f5,
 	0xf40464b6,
-	0x46b03411,
-	0xd81bf400,
+	0x76bb0f11,
+	0x0136b000,
+	0xf4061bf4,
+/* 0x0b7e: i2c_put_byte_done */
+	0x00f80132,
+/* 0x0b80: i2c_addr */
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0xcd21f550,
-	0x0464b608,
-	0xbb0f11f4,
-	0x36b00076,
-	0x061bf401,
-/* 0x09bf: i2c_put_byte_done */
-	0xf80132f4,
-/* 0x09c1: i2c_addr */
-	0x0076bb00,
+	0xbc21f550,
+	0x0464b609,
+	0xe72911f4,
+	0xb6012ec3,
+	0x53fd0134,
+	0x0076bb05,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b607fd,
-	0x2911f404,
-	0x012ec3e7,
-	0xfd0134b6,
-	0x76bb0553,
+	0x64b60b25,
+/* 0x0bc5: i2c_addr_done */
+/* 0x0bc7: i2c_acquire_addr */
+	0xc700f804,
+	0xe4b6f8ce,
+	0x24e0b702,
+	0x00ee980d,
+/* 0x0bd6: i2c_acquire */
+	0x21f500f8,
+	0x21f40bc7,
+	0x03d9f004,
+	0xf83f21f4,
+/* 0x0be5: i2c_release */
+	0xc721f500,
+	0x0421f40b,
+	0xf403daf0,
+	0x00f83f21,
+/* 0x0bf4: i2c_recv */
+	0xc70132f4,
+	0x14b6f8c1,
+	0x2816b002,
+	0x013a1ff5,
+	0x0cfc13a0,
+	0xa0003298,
+	0x980cd413,
+	0x31f40031,
+	0xf9d0f902,
+	0xf1d0f9e0,
+	0xf1000067,
+	0x92100063,
+	0x76bb0167,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb6096621,
-/* 0x0a06: i2c_addr_done */
-	0x00f80464,
-/* 0x0a08: i2c_acquire_addr */
-	0xb6f8cec7,
-	0xe0b702e4,
-	0xee980d1c,
-/* 0x0a17: i2c_acquire */
-	0xf500f800,
-	0xf40a0821,
-	0xd9f00421,
-	0x3f21f403,
-/* 0x0a26: i2c_release */
-	0x21f500f8,
-	0x21f40a08,
-	0x03daf004,
-	0xf83f21f4,
-/* 0x0a35: i2c_recv */
-	0x0132f400,
-	0xb6f8c1c7,
-	0x16b00214,
-	0x3a1ff528,
-	0xf413a001,
-	0x0032980c,
-	0x0ccc13a0,
-	0xf4003198,
-	0xd0f90231,
-	0xd0f9e0f9,
-	0x000067f1,
-	0x100063f1,
-	0xbb016792,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x0a1721f5,
-	0xfc0464b6,
-	0x00d6b0d0,
-	0x00b31bf5,
-	0xbb0057f0,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x09c121f5,
-	0xf50464b6,
-	0xc700d011,
-	0x76bbe0c5,
+	0xb60bd621,
+	0xd0fc0464,
+	0xf500d6b0,
+	0xf000b31b,
+	0x76bb0057,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb6096621,
+	0xb60b8021,
 	0x11f50464,
-	0x57f000ad,
-	0x0076bb01,
+	0xc5c700d0,
+	0x0076bbe0,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b609c1,
-	0x8a11f504,
-	0x0076bb00,
-	0xf90465b6,
-	0x04659450,
-	0xbd0256bb,
-	0x0475fd50,
-	0x21f550fc,
-	0x64b60914,
-	0x6a11f404,
-	0xbbe05bcb,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x085921f5,
-	0xb90464b6,
-	0x74bd025b,
-/* 0x0b3b: i2c_recv_not_rd08 */
-	0xb0430ef4,
-	0x1bf401d6,
-	0x0057f03d,
-	0x09c121f5,
-	0xc73311f4,
-	0x21f5e0c5,
-	0x11f40966,
-	0x0057f029,
-	0x09c121f5,
-	0xc71f11f4,
-	0x21f5e0b5,
-	0x11f40966,
-	0x5921f515,
-	0xc774bd08,
-	0x1bf408c5,
-	0x0232f409,
-/* 0x0b7b: i2c_recv_not_wr08 */
-/* 0x0b7b: i2c_recv_done */
-	0xc7030ef4,
-	0x21f5f8ce,
-	0xe0fc0a26,
-	0x12f4d0fc,
-	0x027cb90a,
-	0x034221f5,
-/* 0x0b90: i2c_recv_exit */
-/* 0x0b92: i2c_init */
-	0x00f800f8,
-/* 0x0b94: test_recv */
-	0x05d817f1,
-	0xcf0614b6,
-	0x10b60011,
-	0xd807f101,
-	0x0604b605,
-	0xbd0001d0,
-	0x00e7f104,
-	0x4fe3f1d9,
-	0x6221f513,
-/* 0x0bbb: test_init */
-	0xf100f802,
-	0xf50800e7,
-	0xf8026221,
-/* 0x0bc5: idle_recv */
-/* 0x0bc7: idle */
-	0xf400f800,
-	0x17f10031,
-	0x14b605d4,
-	0x0011cf06,
-	0xf10110b6,
-	0xb605d407,
-	0x01d00604,
-/* 0x0be3: idle_loop */
-	0xf004bd00,
-	0x32f45817,
-/* 0x0be9: idle_proc */
-/* 0x0be9: idle_proc_exec */
-	0xb910f902,
-	0x21f5021e,
-	0x10fc034b,
-	0xf40911f4,
-	0x0ef40231,
-/* 0x0bfd: idle_proc_next */
-	0x5810b6ef,
-	0xf4061fb8,
-	0x02f4e61b,
-	0x0028f4dd,
-	0x00bb0ef4,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
+	0x64b60b25,
+	0xad11f504,
+	0x0157f000,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x8021f550,
+	0x0464b60b,
+	0x008a11f5,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0xd321f550,
+	0x0464b60a,
+	0xcb6a11f4,
+	0x76bbe05b,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb60a1821,
+	0x5bb90464,
+	0xf474bd02,
+/* 0x0cfa: i2c_recv_not_rd08 */
+	0xd6b0430e,
+	0x3d1bf401,
+	0xf50057f0,
+	0xf40b8021,
+	0xc5c73311,
+	0x2521f5e0,
+	0x2911f40b,
+	0xf50057f0,
+	0xf40b8021,
+	0xb5c71f11,
+	0x2521f5e0,
+	0x1511f40b,
+	0x0a1821f5,
+	0xc5c774bd,
+	0x091bf408,
+	0xf40232f4,
+/* 0x0d3a: i2c_recv_not_wr08 */
+/* 0x0d3a: i2c_recv_done */
+	0xcec7030e,
+	0xe521f5f8,
+	0xfce0fc0b,
+	0x0a12f4d0,
+	0xf5027cb9,
+/* 0x0d4f: i2c_recv_exit */
+	0xf8034221,
+/* 0x0d51: i2c_init */
+/* 0x0d53: test_recv */
+	0xf100f800,
+	0xb605d817,
+	0x11cf0614,
+	0x0110b600,
+	0x05d807f1,
+	0xd00604b6,
+	0x04bd0001,
+	0xd900e7f1,
+	0x134fe3f1,
+	0x026221f5,
+/* 0x0d7a: test_init */
+	0xe7f100f8,
+	0x21f50800,
+	0x00f80262,
+/* 0x0d84: idle_recv */
+/* 0x0d86: idle */
+	0x31f400f8,
+	0xd417f100,
+	0x0614b605,
+	0xb60011cf,
+	0x07f10110,
+	0x04b605d4,
+	0x0001d006,
+/* 0x0da2: idle_loop */
+	0x17f004bd,
+	0x0232f458,
+/* 0x0da8: idle_proc */
+/* 0x0da8: idle_proc_exec */
+	0x1eb910f9,
+	0x4b21f502,
+	0xf410fc03,
+	0x31f40911,
+	0xef0ef402,
+/* 0x0dbc: idle_proc_next */
+	0xb85810b6,
+	0x1bf4061f,
+	0xdd02f4e6,
+	0xf40028f4,
+	0x0000bb0e,
 	0x00000000,
 	0x00000000,
 	0x00000000,
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
index 31552af..6fc2290 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
@@ -68,7 +68,7 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x46524550,
-	0x0000068f,
+	0x00000784,
 	0x0000068d,
 	0x00000000,
 	0x00000000,
@@ -90,8 +90,8 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x5f433249,
-	0x00000aaa,
-	0x0000094d,
+	0x00000c30,
+	0x00000ad3,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -112,8 +112,8 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x54534554,
-	0x00000acd,
-	0x00000aac,
+	0x00000c53,
+	0x00000c32,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -134,8 +134,8 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x454c4449,
-	0x00000ad9,
-	0x00000ad7,
+	0x00000c5f,
+	0x00000c5d,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -834,7 +834,15 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_attr_start */
+/* 0x0ccc: perf_polling_period_us */
+	0x000186a0,
+/* 0x0cd0: perf_eng_gr */
+/* 0x0cd1: perf_eng_vdec */
+/* 0x0cd2: perf_eng_mc */
+/* 0x0cd3: perf_eng_pcie */
+	0x00000000,
+/* 0x0cd4: i2c_scl_map */
 	0x00000400,
 	0x00000800,
 	0x00001000,
@@ -845,7 +853,7 @@ uint32_t gf119_pmu_data[] = {
 	0x00020000,
 	0x00040000,
 	0x00080000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0cfc: i2c_sda_map */
 	0x00100000,
 	0x00200000,
 	0x00400000,
@@ -911,8 +919,6 @@ uint32_t gf119_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000000,
-	0x00000000,
 };
 
 uint32_t gf119_pmu_code[] = {
@@ -1397,378 +1403,446 @@ uint32_t gf119_pmu_code[] = {
 /* 0x068b: memx_init */
 	0xf800f8d8,
 /* 0x068d: perf_recv */
-/* 0x068f: perf_init */
-	0xf800f800,
-/* 0x0691: i2c_drive_scl */
-	0x0036b000,
-	0xf10e0bf4,
-	0xd007e007,
-	0x04bd0001,
-/* 0x06a2: i2c_drive_scl_lo */
-	0x07f100f8,
-	0x01d007e4,
-	0xf804bd00,
-/* 0x06ad: i2c_drive_sda */
-	0x0036b000,
-	0xf10e0bf4,
-	0xd007e007,
-	0x04bd0002,
-/* 0x06be: i2c_drive_sda_lo */
-	0x07f100f8,
-	0x02d007e4,
-	0xf804bd00,
-/* 0x06c9: i2c_sense_scl */
-	0x0132f400,
-	0x07c437f1,
-	0xfd0033cf,
-	0x0bf40431,
-	0x0131f406,
-/* 0x06dc: i2c_sense_scl_done */
-/* 0x06de: i2c_sense_sda */
-	0x32f400f8,
-	0xc437f101,
-	0x0033cf07,
-	0xf40432fd,
-	0x31f4060b,
-/* 0x06f1: i2c_sense_sda_done */
-/* 0x06f3: i2c_raise_scl */
-	0xf900f801,
-	0x9847f140,
-	0x0137f008,
-	0x069121f5,
-/* 0x0700: i2c_raise_scl_wait */
-	0x03e8e7f1,
-	0xf56721f4,
-	0xf406c921,
-	0x42b60901,
-	0xef1bf401,
-/* 0x0714: i2c_raise_scl_done */
-	0x00f840fc,
-/* 0x0718: i2c_start */
-	0x06c921f5,
-	0xf50d11f4,
-	0xf406de21,
-	0x0ef40611,
-/* 0x0729: i2c_start_rep */
-	0x0037f030,
-	0x069121f5,
-	0xf50137f0,
-	0xbb06ad21,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x06f321f5,
-	0xf40464b6,
-/* 0x0756: i2c_start_send */
-	0x37f01f11,
-	0xad21f500,
-	0x88e7f106,
-	0x6721f413,
+	0xf110f900,
+	0xf14f48a7,
+	0xb85453a3,
+	0x1bf406ea,
+	0x01d6b044,
+	0xf4060bf4,
+/* 0x06a6: perf_load */
+	0xb4bd500e,
+	0x07f1c4bd,
+	0x0c180cd3,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd2,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd1,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd0,
+	0xf504bd00,
+	0xf402f121,
+/* 0x06de: perf_recv_not_host */
+	0x21f5180e,
+	0x07f106f7,
+	0x0e980ccc,
+	0xf504bd00,
+	0xf501f721,
+/* 0x06f3: perf_recv_exit */
+	0xfc022321,
+/* 0x06f7: perf_counter_readout */
+	0xf100f810,
+	0xcf0508e7,
+	0xeecc00ee,
+	0x18d7f1ff,
+	0x00ddcf05,
+	0xf1dcdeff,
+	0x000cd007,
+	0x04bd000d,
+	0x0528d7f1,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d000cd1,
+	0xf104bd00,
+	0xcf0538d7,
+	0xdeff00dd,
+	0xd207f1dc,
+	0x000d000c,
+	0xd7f104bd,
+	0xddcf0548,
+	0xdcdeff00,
+	0x0cd307f1,
+	0xbd000d00,
+	0x00e7f104,
+	0x00e3f100,
+	0x0807f180,
+	0x000ed005,
+	0x07f104bd,
+	0x0ed00518,
+	0xf104bd00,
+	0xd0052807,
+	0x04bd000e,
+	0x053807f1,
+	0xbd000ed0,
+	0x4807f104,
+	0x000ed005,
+	0x00f804bd,
+/* 0x0784: perf_init */
+	0x0003e7f1,
+	0xf100e3f0,
+	0xd0050c07,
+	0x04bd000e,
+	0x0002e7f1,
+	0xf100e3f0,
+	0xd0051c07,
+	0x04bd000e,
+	0x052c07f1,
+	0xbd000ed0,
+	0x3c07f104,
+	0x000ed005,
+	0x07f104bd,
+	0x0ed0054c,
+	0xf104bd00,
+	0xf0000fe7,
+	0x07f118e3,
+	0x0ed00514,
+	0xf104bd00,
+	0xf00070e7,
+	0x07f100e3,
+	0x0ed00524,
+	0xf104bd00,
+	0xf00080e7,
+	0x07f100e3,
+	0x0ed00534,
+	0xf104bd00,
+	0xf10000e7,
+	0xf12000e3,
+	0xd0054407,
+	0x04bd000e,
+	0x06f721f5,
+	0x0ccc07f1,
+	0xbd000e98,
+	0xf721f504,
+	0x2321f501,
+/* 0x0817: i2c_drive_scl */
+	0xb000f802,
+	0x0bf40036,
+	0xe007f10e,
+	0x0001d007,
+	0x00f804bd,
+/* 0x0828: i2c_drive_scl_lo */
+	0x07e407f1,
+	0xbd0001d0,
+/* 0x0833: i2c_drive_sda */
+	0xb000f804,
+	0x0bf40036,
+	0xe007f10e,
+	0x0002d007,
+	0x00f804bd,
+/* 0x0844: i2c_drive_sda_lo */
+	0x07e407f1,
+	0xbd0002d0,
+/* 0x084f: i2c_sense_scl */
+	0xf400f804,
+	0x37f10132,
+	0x33cf07c4,
+	0x0431fd00,
+	0xf4060bf4,
+/* 0x0862: i2c_sense_scl_done */
+	0x00f80131,
+/* 0x0864: i2c_sense_sda */
+	0xf10132f4,
+	0xcf07c437,
+	0x32fd0033,
+	0x060bf404,
+/* 0x0877: i2c_sense_sda_done */
+	0xf80131f4,
+/* 0x0879: i2c_raise_scl */
+	0xf140f900,
+	0xf0089847,
+	0x21f50137,
+/* 0x0886: i2c_raise_scl_wait */
+	0xe7f10817,
+	0x21f403e8,
+	0x4f21f567,
+	0x0901f408,
+	0xf40142b6,
+/* 0x089a: i2c_raise_scl_done */
+	0x40fcef1b,
+/* 0x089e: i2c_start */
+	0x21f500f8,
+	0x11f4084f,
+	0x6421f50d,
+	0x0611f408,
+/* 0x08af: i2c_start_rep */
+	0xf0300ef4,
+	0x21f50037,
+	0x37f00817,
+	0x3321f501,
+	0x0076bb08,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b60879,
+	0x1f11f404,
+/* 0x08dc: i2c_start_send */
 	0xf50037f0,
-	0xf1069121,
+	0xf1083321,
 	0xf41388e7,
-/* 0x0772: i2c_start_out */
-	0x00f86721,
-/* 0x0774: i2c_stop */
-	0xf50037f0,
-	0xf0069121,
-	0x21f50037,
-	0xe7f106ad,
-	0x21f403e8,
-	0x0137f067,
-	0x069121f5,
-	0x1388e7f1,
+	0x37f06721,
+	0x1721f500,
+	0x88e7f108,
+	0x6721f413,
+/* 0x08f8: i2c_start_out */
+/* 0x08fa: i2c_stop */
+	0x37f000f8,
+	0x1721f500,
+	0x0037f008,
+	0x083321f5,
+	0x03e8e7f1,
 	0xf06721f4,
 	0x21f50137,
-	0xe7f106ad,
+	0xe7f10817,
 	0x21f41388,
-/* 0x07a7: i2c_bitw */
-	0xf500f867,
-	0xf106ad21,
-	0xf403e8e7,
-	0x76bb6721,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0xf550fc04,
-	0xb606f321,
-	0x11f40464,
-	0x88e7f118,
-	0x6721f413,
-	0xf50037f0,
-	0xf1069121,
-	0xf41388e7,
-/* 0x07e6: i2c_bitw_out */
-	0x00f86721,
-/* 0x07e8: i2c_bitr */
-	0xf50137f0,
-	0xf106ad21,
-	0xf403e8e7,
-	0x76bb6721,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0xf550fc04,
-	0xb606f321,
-	0x11f40464,
-	0xde21f51b,
-	0x0037f006,
-	0x069121f5,
+	0x0137f067,
+	0x083321f5,
 	0x1388e7f1,
-	0xf06721f4,
-	0x31f4013c,
-/* 0x082d: i2c_bitr_done */
-/* 0x082f: i2c_get_byte */
-	0xf000f801,
-	0x47f00057,
-/* 0x0835: i2c_get_byte_next */
-	0x0154b608,
+	0xf86721f4,
+/* 0x092d: i2c_bitw */
+	0x3321f500,
+	0xe8e7f108,
+	0x6721f403,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0xe821f550,
-	0x0464b607,
-	0xfd2b11f4,
-	0x42b60553,
-	0xd81bf401,
-	0xbb0137f0,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x07a721f5,
-/* 0x087f: i2c_get_byte_done */
-	0xf80464b6,
-/* 0x0881: i2c_put_byte */
-	0x0847f000,
-/* 0x0884: i2c_put_byte_next */
-	0xff0142b6,
-	0x76bb3854,
+	0x7921f550,
+	0x0464b608,
+	0xf11811f4,
+	0xf41388e7,
+	0x37f06721,
+	0x1721f500,
+	0x88e7f108,
+	0x6721f413,
+/* 0x096c: i2c_bitw_out */
+/* 0x096e: i2c_bitr */
+	0x37f000f8,
+	0x3321f501,
+	0xe8e7f108,
+	0x6721f403,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x7921f550,
+	0x0464b608,
+	0xf51b11f4,
+	0xf0086421,
+	0x21f50037,
+	0xe7f10817,
+	0x21f41388,
+	0x013cf067,
+/* 0x09b3: i2c_bitr_done */
+	0xf80131f4,
+/* 0x09b5: i2c_get_byte */
+	0x0057f000,
+/* 0x09bb: i2c_get_byte_next */
+	0xb60847f0,
+	0x76bb0154,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb607a721,
+	0xb6096e21,
 	0x11f40464,
-	0x0046b034,
-	0xbbd81bf4,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x07e821f5,
-	0xf40464b6,
-	0x76bb0f11,
-	0x0136b000,
-	0xf4061bf4,
-/* 0x08da: i2c_put_byte_done */
-	0x00f80132,
-/* 0x08dc: i2c_addr */
+	0x0553fd2b,
+	0xf40142b6,
+	0x37f0d81b,
+	0x0076bb01,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b6092d,
+/* 0x0a05: i2c_get_byte_done */
+/* 0x0a07: i2c_put_byte */
+	0xf000f804,
+/* 0x0a0a: i2c_put_byte_next */
+	0x42b60847,
+	0x3854ff01,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x1821f550,
-	0x0464b607,
-	0xe72911f4,
-	0xb6012ec3,
-	0x53fd0134,
-	0x0076bb05,
+	0x2d21f550,
+	0x0464b609,
+	0xb03411f4,
+	0x1bf40046,
+	0x0076bbd8,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b60881,
-/* 0x0921: i2c_addr_done */
-/* 0x0923: i2c_acquire_addr */
-	0xc700f804,
-	0xe4b6f8ce,
-	0x14e0b705,
-/* 0x092f: i2c_acquire */
-	0xf500f8d0,
-	0xf4092321,
-	0xd9f00421,
-	0x3321f403,
-/* 0x093e: i2c_release */
-	0x21f500f8,
-	0x21f40923,
-	0x03daf004,
-	0xf83321f4,
-/* 0x094d: i2c_recv */
-	0x0132f400,
-	0xb6f8c1c7,
-	0x16b00214,
-	0x3a1ff528,
-	0xf413a001,
-	0x0032980c,
-	0x0ccc13a0,
-	0xf4003198,
-	0xd0f90231,
-	0xd0f9e0f9,
-	0x000067f1,
-	0x100063f1,
-	0xbb016792,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x092f21f5,
-	0xfc0464b6,
-	0x00d6b0d0,
-	0x00b31bf5,
-	0xbb0057f0,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x08dc21f5,
-	0xf50464b6,
-	0xc700d011,
-	0x76bbe0c5,
+	0x64b6096e,
+	0x0f11f404,
+	0xb00076bb,
+	0x1bf40136,
+	0x0132f406,
+/* 0x0a60: i2c_put_byte_done */
+/* 0x0a62: i2c_addr */
+	0x76bb00f8,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb6088121,
-	0x11f50464,
-	0x57f000ad,
+	0xb6089e21,
+	0x11f40464,
+	0x2ec3e729,
+	0x0134b601,
+	0xbb0553fd,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x0a0721f5,
+/* 0x0aa7: i2c_addr_done */
+	0xf80464b6,
+/* 0x0aa9: i2c_acquire_addr */
+	0xf8cec700,
+	0xb705e4b6,
+	0xf8d014e0,
+/* 0x0ab5: i2c_acquire */
+	0xa921f500,
+	0x0421f40a,
+	0xf403d9f0,
+	0x00f83321,
+/* 0x0ac4: i2c_release */
+	0x0aa921f5,
+	0xf00421f4,
+	0x21f403da,
+/* 0x0ad3: i2c_recv */
+	0xf400f833,
+	0xc1c70132,
+	0x0214b6f8,
+	0xf52816b0,
+	0xa0013a1f,
+	0x980cfc13,
+	0x13a00032,
+	0x31980cd4,
+	0x0231f400,
+	0xe0f9d0f9,
+	0x67f1d0f9,
+	0x63f10000,
+	0x67921000,
 	0x0076bb01,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b608dc,
-	0x8a11f504,
+	0x64b60ab5,
+	0xb0d0fc04,
+	0x1bf500d6,
+	0x57f000b3,
 	0x0076bb00,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b6082f,
-	0x6a11f404,
-	0xbbe05bcb,
+	0x64b60a62,
+	0xd011f504,
+	0xe0c5c700,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x0721f550,
+	0x0464b60a,
+	0x00ad11f5,
+	0xbb0157f0,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x077421f5,
-	0xb90464b6,
-	0x74bd025b,
-/* 0x0a53: i2c_recv_not_rd08 */
-	0xb0430ef4,
-	0x1bf401d6,
-	0x0057f03d,
-	0x08dc21f5,
-	0xc73311f4,
-	0x21f5e0c5,
-	0x11f40881,
-	0x0057f029,
-	0x08dc21f5,
-	0xc71f11f4,
-	0x21f5e0b5,
-	0x11f40881,
-	0x7421f515,
-	0xc774bd07,
-	0x1bf408c5,
-	0x0232f409,
-/* 0x0a93: i2c_recv_not_wr08 */
-/* 0x0a93: i2c_recv_done */
-	0xc7030ef4,
-	0x21f5f8ce,
-	0xe0fc093e,
-	0x12f4d0fc,
-	0x027cb90a,
-	0x02f121f5,
-/* 0x0aa8: i2c_recv_exit */
-/* 0x0aaa: i2c_init */
-	0x00f800f8,
-/* 0x0aac: test_recv */
-	0x05d817f1,
-	0xb60011cf,
-	0x07f10110,
-	0x01d005d8,
-	0xf104bd00,
-	0xf1d900e7,
-	0xf5134fe3,
+	0x0a6221f5,
+	0xf50464b6,
+	0xbb008a11,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x09b521f5,
+	0xf40464b6,
+	0x5bcb6a11,
+	0x0076bbe0,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b608fa,
+	0x025bb904,
+	0x0ef474bd,
+/* 0x0bd9: i2c_recv_not_rd08 */
+	0x01d6b043,
+	0xf03d1bf4,
+	0x21f50057,
+	0x11f40a62,
+	0xe0c5c733,
+	0x0a0721f5,
+	0xf02911f4,
+	0x21f50057,
+	0x11f40a62,
+	0xe0b5c71f,
+	0x0a0721f5,
+	0xf51511f4,
+	0xbd08fa21,
+	0x08c5c774,
+	0xf4091bf4,
+	0x0ef40232,
+/* 0x0c19: i2c_recv_not_wr08 */
+/* 0x0c19: i2c_recv_done */
+	0xf8cec703,
+	0x0ac421f5,
+	0xd0fce0fc,
+	0xb90a12f4,
+	0x21f5027c,
+/* 0x0c2e: i2c_recv_exit */
+	0x00f802f1,
+/* 0x0c30: i2c_init */
+/* 0x0c32: test_recv */
+	0x17f100f8,
+	0x11cf05d8,
+	0x0110b600,
+	0x05d807f1,
+	0xbd0001d0,
+	0x00e7f104,
+	0x4fe3f1d9,
+	0x2321f513,
+/* 0x0c53: test_init */
+	0xf100f802,
+	0xf50800e7,
 	0xf8022321,
-/* 0x0acd: test_init */
-	0x00e7f100,
-	0x2321f508,
-/* 0x0ad7: idle_recv */
-	0xf800f802,
-/* 0x0ad9: idle */
-	0x0031f400,
-	0x05d417f1,
-	0xb60011cf,
-	0x07f10110,
-	0x01d005d4,
-/* 0x0aef: idle_loop */
-	0xf004bd00,
-	0x32f45817,
-/* 0x0af5: idle_proc */
-/* 0x0af5: idle_proc_exec */
-	0xb910f902,
-	0x21f5021e,
-	0x10fc02fa,
-	0xf40911f4,
-	0x0ef40231,
-/* 0x0b09: idle_proc_next */
-	0x5810b6ef,
-	0xf4061fb8,
-	0x02f4e61b,
-	0x0028f4dd,
-	0x00c10ef4,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
+/* 0x0c5d: idle_recv */
+/* 0x0c5f: idle */
+	0xf400f800,
+	0x17f10031,
+	0x11cf05d4,
+	0x0110b600,
+	0x05d407f1,
+	0xbd0001d0,
+/* 0x0c75: idle_loop */
+	0x5817f004,
+/* 0x0c7b: idle_proc */
+/* 0x0c7b: idle_proc_exec */
+	0xf90232f4,
+	0x021eb910,
+	0x02fa21f5,
+	0x11f410fc,
+	0x0231f409,
+/* 0x0c8f: idle_proc_next */
+	0xb6ef0ef4,
+	0x1fb85810,
+	0xe61bf406,
+	0xf4dd02f4,
+	0x0ef40028,
+	0x000000c1,
 	0x00000000,
 	0x00000000,
 	0x00000000,
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
index ca7f2b8..9a5bdc1 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
@@ -68,7 +68,7 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x46524550,
-	0x0000068f,
+	0x00000784,
 	0x0000068d,
 	0x00000000,
 	0x00000000,
@@ -90,8 +90,8 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x5f433249,
-	0x00000aaa,
-	0x0000094d,
+	0x00000c30,
+	0x00000ad3,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -112,8 +112,8 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x54534554,
-	0x00000acd,
-	0x00000aac,
+	0x00000c53,
+	0x00000c32,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -134,8 +134,8 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x454c4449,
-	0x00000ad9,
-	0x00000ad7,
+	0x00000c5f,
+	0x00000c5d,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -834,7 +834,15 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_attr_start */
+/* 0x0ccc: perf_polling_period_us */
+	0x000186a0,
+/* 0x0cd0: perf_eng_gr */
+/* 0x0cd1: perf_eng_vdec */
+/* 0x0cd2: perf_eng_mc */
+/* 0x0cd3: perf_eng_pcie */
+	0x00000000,
+/* 0x0cd4: i2c_scl_map */
 	0x00000400,
 	0x00000800,
 	0x00001000,
@@ -845,7 +853,7 @@ uint32_t gk104_pmu_data[] = {
 	0x00020000,
 	0x00040000,
 	0x00080000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0cfc: i2c_sda_map */
 	0x00100000,
 	0x00200000,
 	0x00400000,
@@ -911,8 +919,6 @@ uint32_t gk104_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000000,
-	0x00000000,
 };
 
 uint32_t gk104_pmu_code[] = {
@@ -1397,378 +1403,446 @@ uint32_t gk104_pmu_code[] = {
 /* 0x068b: memx_init */
 	0xf800f8d8,
 /* 0x068d: perf_recv */
-/* 0x068f: perf_init */
-	0xf800f800,
-/* 0x0691: i2c_drive_scl */
-	0x0036b000,
-	0xf10e0bf4,
-	0xd007e007,
-	0x04bd0001,
-/* 0x06a2: i2c_drive_scl_lo */
-	0x07f100f8,
-	0x01d007e4,
-	0xf804bd00,
-/* 0x06ad: i2c_drive_sda */
-	0x0036b000,
-	0xf10e0bf4,
-	0xd007e007,
-	0x04bd0002,
-/* 0x06be: i2c_drive_sda_lo */
-	0x07f100f8,
-	0x02d007e4,
-	0xf804bd00,
-/* 0x06c9: i2c_sense_scl */
-	0x0132f400,
-	0x07c437f1,
-	0xfd0033cf,
-	0x0bf40431,
-	0x0131f406,
-/* 0x06dc: i2c_sense_scl_done */
-/* 0x06de: i2c_sense_sda */
-	0x32f400f8,
-	0xc437f101,
-	0x0033cf07,
-	0xf40432fd,
-	0x31f4060b,
-/* 0x06f1: i2c_sense_sda_done */
-/* 0x06f3: i2c_raise_scl */
-	0xf900f801,
-	0x9847f140,
-	0x0137f008,
-	0x069121f5,
-/* 0x0700: i2c_raise_scl_wait */
-	0x03e8e7f1,
-	0xf56721f4,
-	0xf406c921,
-	0x42b60901,
-	0xef1bf401,
-/* 0x0714: i2c_raise_scl_done */
-	0x00f840fc,
-/* 0x0718: i2c_start */
-	0x06c921f5,
-	0xf50d11f4,
-	0xf406de21,
-	0x0ef40611,
-/* 0x0729: i2c_start_rep */
-	0x0037f030,
-	0x069121f5,
-	0xf50137f0,
-	0xbb06ad21,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x06f321f5,
-	0xf40464b6,
-/* 0x0756: i2c_start_send */
-	0x37f01f11,
-	0xad21f500,
-	0x88e7f106,
-	0x6721f413,
+	0xf110f900,
+	0xf14f48a7,
+	0xb85453a3,
+	0x1bf406ea,
+	0x01d6b044,
+	0xf4060bf4,
+/* 0x06a6: perf_load */
+	0xb4bd500e,
+	0x07f1c4bd,
+	0x0c180cd3,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd2,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd1,
+	0xb604bd00,
+	0x07f108c4,
+	0x0c180cd0,
+	0xf504bd00,
+	0xf402f121,
+/* 0x06de: perf_recv_not_host */
+	0x21f5180e,
+	0x07f106f7,
+	0x0e980ccc,
+	0xf504bd00,
+	0xf501f721,
+/* 0x06f3: perf_recv_exit */
+	0xfc022321,
+/* 0x06f7: perf_counter_readout */
+	0xf100f810,
+	0xcf0508e7,
+	0xeecc00ee,
+	0x18d7f1ff,
+	0x00ddcf05,
+	0xf1dcdeff,
+	0x000cd007,
+	0x04bd000d,
+	0x0528d7f1,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d000cd1,
+	0xf104bd00,
+	0xcf0538d7,
+	0xdeff00dd,
+	0xd207f1dc,
+	0x000d000c,
+	0xd7f104bd,
+	0xddcf0548,
+	0xdcdeff00,
+	0x0cd307f1,
+	0xbd000d00,
+	0x00e7f104,
+	0x00e3f100,
+	0x0807f180,
+	0x000ed005,
+	0x07f104bd,
+	0x0ed00518,
+	0xf104bd00,
+	0xd0052807,
+	0x04bd000e,
+	0x053807f1,
+	0xbd000ed0,
+	0x4807f104,
+	0x000ed005,
+	0x00f804bd,
+/* 0x0784: perf_init */
+	0x0003e7f1,
+	0xf100e3f0,
+	0xd0050c07,
+	0x04bd000e,
+	0x0002e7f1,
+	0xf100e3f0,
+	0xd0051c07,
+	0x04bd000e,
+	0x052c07f1,
+	0xbd000ed0,
+	0x3c07f104,
+	0x000ed005,
+	0x07f104bd,
+	0x0ed0054c,
+	0xf104bd00,
+	0xf0000fe7,
+	0x07f138e3,
+	0x0ed00514,
+	0xf104bd00,
+	0xf00070e7,
+	0x07f102e3,
+	0x0ed00524,
+	0xf104bd00,
+	0xf00080e7,
+	0x07f100e3,
+	0x0ed00534,
+	0xf104bd00,
+	0xf10000e7,
+	0xf12000e3,
+	0xd0054407,
+	0x04bd000e,
+	0x06f721f5,
+	0x0ccc07f1,
+	0xbd000e98,
+	0xf721f504,
+	0x2321f501,
+/* 0x0817: i2c_drive_scl */
+	0xb000f802,
+	0x0bf40036,
+	0xe007f10e,
+	0x0001d007,
+	0x00f804bd,
+/* 0x0828: i2c_drive_scl_lo */
+	0x07e407f1,
+	0xbd0001d0,
+/* 0x0833: i2c_drive_sda */
+	0xb000f804,
+	0x0bf40036,
+	0xe007f10e,
+	0x0002d007,
+	0x00f804bd,
+/* 0x0844: i2c_drive_sda_lo */
+	0x07e407f1,
+	0xbd0002d0,
+/* 0x084f: i2c_sense_scl */
+	0xf400f804,
+	0x37f10132,
+	0x33cf07c4,
+	0x0431fd00,
+	0xf4060bf4,
+/* 0x0862: i2c_sense_scl_done */
+	0x00f80131,
+/* 0x0864: i2c_sense_sda */
+	0xf10132f4,
+	0xcf07c437,
+	0x32fd0033,
+	0x060bf404,
+/* 0x0877: i2c_sense_sda_done */
+	0xf80131f4,
+/* 0x0879: i2c_raise_scl */
+	0xf140f900,
+	0xf0089847,
+	0x21f50137,
+/* 0x0886: i2c_raise_scl_wait */
+	0xe7f10817,
+	0x21f403e8,
+	0x4f21f567,
+	0x0901f408,
+	0xf40142b6,
+/* 0x089a: i2c_raise_scl_done */
+	0x40fcef1b,
+/* 0x089e: i2c_start */
+	0x21f500f8,
+	0x11f4084f,
+	0x6421f50d,
+	0x0611f408,
+/* 0x08af: i2c_start_rep */
+	0xf0300ef4,
+	0x21f50037,
+	0x37f00817,
+	0x3321f501,
+	0x0076bb08,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b60879,
+	0x1f11f404,
+/* 0x08dc: i2c_start_send */
 	0xf50037f0,
-	0xf1069121,
+	0xf1083321,
 	0xf41388e7,
-/* 0x0772: i2c_start_out */
-	0x00f86721,
-/* 0x0774: i2c_stop */
-	0xf50037f0,
-	0xf0069121,
-	0x21f50037,
-	0xe7f106ad,
-	0x21f403e8,
-	0x0137f067,
-	0x069121f5,
-	0x1388e7f1,
+	0x37f06721,
+	0x1721f500,
+	0x88e7f108,
+	0x6721f413,
+/* 0x08f8: i2c_start_out */
+/* 0x08fa: i2c_stop */
+	0x37f000f8,
+	0x1721f500,
+	0x0037f008,
+	0x083321f5,
+	0x03e8e7f1,
 	0xf06721f4,
 	0x21f50137,
-	0xe7f106ad,
+	0xe7f10817,
 	0x21f41388,
-/* 0x07a7: i2c_bitw */
-	0xf500f867,
-	0xf106ad21,
-	0xf403e8e7,
-	0x76bb6721,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0xf550fc04,
-	0xb606f321,
-	0x11f40464,
-	0x88e7f118,
-	0x6721f413,
-	0xf50037f0,
-	0xf1069121,
-	0xf41388e7,
-/* 0x07e6: i2c_bitw_out */
-	0x00f86721,
-/* 0x07e8: i2c_bitr */
-	0xf50137f0,
-	0xf106ad21,
-	0xf403e8e7,
-	0x76bb6721,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0xf550fc04,
-	0xb606f321,
-	0x11f40464,
-	0xde21f51b,
-	0x0037f006,
-	0x069121f5,
+	0x0137f067,
+	0x083321f5,
 	0x1388e7f1,
-	0xf06721f4,
-	0x31f4013c,
-/* 0x082d: i2c_bitr_done */
-/* 0x082f: i2c_get_byte */
-	0xf000f801,
-	0x47f00057,
-/* 0x0835: i2c_get_byte_next */
-	0x0154b608,
+	0xf86721f4,
+/* 0x092d: i2c_bitw */
+	0x3321f500,
+	0xe8e7f108,
+	0x6721f403,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0xe821f550,
-	0x0464b607,
-	0xfd2b11f4,
-	0x42b60553,
-	0xd81bf401,
-	0xbb0137f0,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x07a721f5,
-/* 0x087f: i2c_get_byte_done */
-	0xf80464b6,
-/* 0x0881: i2c_put_byte */
-	0x0847f000,
-/* 0x0884: i2c_put_byte_next */
-	0xff0142b6,
-	0x76bb3854,
+	0x7921f550,
+	0x0464b608,
+	0xf11811f4,
+	0xf41388e7,
+	0x37f06721,
+	0x1721f500,
+	0x88e7f108,
+	0x6721f413,
+/* 0x096c: i2c_bitw_out */
+/* 0x096e: i2c_bitr */
+	0x37f000f8,
+	0x3321f501,
+	0xe8e7f108,
+	0x6721f403,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x7921f550,
+	0x0464b608,
+	0xf51b11f4,
+	0xf0086421,
+	0x21f50037,
+	0xe7f10817,
+	0x21f41388,
+	0x013cf067,
+/* 0x09b3: i2c_bitr_done */
+	0xf80131f4,
+/* 0x09b5: i2c_get_byte */
+	0x0057f000,
+/* 0x09bb: i2c_get_byte_next */
+	0xb60847f0,
+	0x76bb0154,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb607a721,
+	0xb6096e21,
 	0x11f40464,
-	0x0046b034,
-	0xbbd81bf4,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x07e821f5,
-	0xf40464b6,
-	0x76bb0f11,
-	0x0136b000,
-	0xf4061bf4,
-/* 0x08da: i2c_put_byte_done */
-	0x00f80132,
-/* 0x08dc: i2c_addr */
+	0x0553fd2b,
+	0xf40142b6,
+	0x37f0d81b,
+	0x0076bb01,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b6092d,
+/* 0x0a05: i2c_get_byte_done */
+/* 0x0a07: i2c_put_byte */
+	0xf000f804,
+/* 0x0a0a: i2c_put_byte_next */
+	0x42b60847,
+	0x3854ff01,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x1821f550,
-	0x0464b607,
-	0xe72911f4,
-	0xb6012ec3,
-	0x53fd0134,
-	0x0076bb05,
+	0x2d21f550,
+	0x0464b609,
+	0xb03411f4,
+	0x1bf40046,
+	0x0076bbd8,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b60881,
-/* 0x0921: i2c_addr_done */
-/* 0x0923: i2c_acquire_addr */
-	0xc700f804,
-	0xe4b6f8ce,
-	0x14e0b705,
-/* 0x092f: i2c_acquire */
-	0xf500f8d0,
-	0xf4092321,
-	0xd9f00421,
-	0x3321f403,
-/* 0x093e: i2c_release */
-	0x21f500f8,
-	0x21f40923,
-	0x03daf004,
-	0xf83321f4,
-/* 0x094d: i2c_recv */
-	0x0132f400,
-	0xb6f8c1c7,
-	0x16b00214,
-	0x3a1ff528,
-	0xf413a001,
-	0x0032980c,
-	0x0ccc13a0,
-	0xf4003198,
-	0xd0f90231,
-	0xd0f9e0f9,
-	0x000067f1,
-	0x100063f1,
-	0xbb016792,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x092f21f5,
-	0xfc0464b6,
-	0x00d6b0d0,
-	0x00b31bf5,
-	0xbb0057f0,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x08dc21f5,
-	0xf50464b6,
-	0xc700d011,
-	0x76bbe0c5,
+	0x64b6096e,
+	0x0f11f404,
+	0xb00076bb,
+	0x1bf40136,
+	0x0132f406,
+/* 0x0a60: i2c_put_byte_done */
+/* 0x0a62: i2c_addr */
+	0x76bb00f8,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb6088121,
-	0x11f50464,
-	0x57f000ad,
+	0xb6089e21,
+	0x11f40464,
+	0x2ec3e729,
+	0x0134b601,
+	0xbb0553fd,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x0a0721f5,
+/* 0x0aa7: i2c_addr_done */
+	0xf80464b6,
+/* 0x0aa9: i2c_acquire_addr */
+	0xf8cec700,
+	0xb705e4b6,
+	0xf8d014e0,
+/* 0x0ab5: i2c_acquire */
+	0xa921f500,
+	0x0421f40a,
+	0xf403d9f0,
+	0x00f83321,
+/* 0x0ac4: i2c_release */
+	0x0aa921f5,
+	0xf00421f4,
+	0x21f403da,
+/* 0x0ad3: i2c_recv */
+	0xf400f833,
+	0xc1c70132,
+	0x0214b6f8,
+	0xf52816b0,
+	0xa0013a1f,
+	0x980cfc13,
+	0x13a00032,
+	0x31980cd4,
+	0x0231f400,
+	0xe0f9d0f9,
+	0x67f1d0f9,
+	0x63f10000,
+	0x67921000,
 	0x0076bb01,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b608dc,
-	0x8a11f504,
+	0x64b60ab5,
+	0xb0d0fc04,
+	0x1bf500d6,
+	0x57f000b3,
 	0x0076bb00,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b6082f,
-	0x6a11f404,
-	0xbbe05bcb,
+	0x64b60a62,
+	0xd011f504,
+	0xe0c5c700,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x0721f550,
+	0x0464b60a,
+	0x00ad11f5,
+	0xbb0157f0,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x077421f5,
-	0xb90464b6,
-	0x74bd025b,
-/* 0x0a53: i2c_recv_not_rd08 */
-	0xb0430ef4,
-	0x1bf401d6,
-	0x0057f03d,
-	0x08dc21f5,
-	0xc73311f4,
-	0x21f5e0c5,
-	0x11f40881,
-	0x0057f029,
-	0x08dc21f5,
-	0xc71f11f4,
-	0x21f5e0b5,
-	0x11f40881,
-	0x7421f515,
-	0xc774bd07,
-	0x1bf408c5,
-	0x0232f409,
-/* 0x0a93: i2c_recv_not_wr08 */
-/* 0x0a93: i2c_recv_done */
-	0xc7030ef4,
-	0x21f5f8ce,
-	0xe0fc093e,
-	0x12f4d0fc,
-	0x027cb90a,
-	0x02f121f5,
-/* 0x0aa8: i2c_recv_exit */
-/* 0x0aaa: i2c_init */
-	0x00f800f8,
-/* 0x0aac: test_recv */
-	0x05d817f1,
-	0xb60011cf,
-	0x07f10110,
-	0x01d005d8,
-	0xf104bd00,
-	0xf1d900e7,
-	0xf5134fe3,
+	0x0a6221f5,
+	0xf50464b6,
+	0xbb008a11,
+	0x65b60076,
+	0x9450f904,
+	0x56bb0465,
+	0xfd50bd02,
+	0x50fc0475,
+	0x09b521f5,
+	0xf40464b6,
+	0x5bcb6a11,
+	0x0076bbe0,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b608fa,
+	0x025bb904,
+	0x0ef474bd,
+/* 0x0bd9: i2c_recv_not_rd08 */
+	0x01d6b043,
+	0xf03d1bf4,
+	0x21f50057,
+	0x11f40a62,
+	0xe0c5c733,
+	0x0a0721f5,
+	0xf02911f4,
+	0x21f50057,
+	0x11f40a62,
+	0xe0b5c71f,
+	0x0a0721f5,
+	0xf51511f4,
+	0xbd08fa21,
+	0x08c5c774,
+	0xf4091bf4,
+	0x0ef40232,
+/* 0x0c19: i2c_recv_not_wr08 */
+/* 0x0c19: i2c_recv_done */
+	0xf8cec703,
+	0x0ac421f5,
+	0xd0fce0fc,
+	0xb90a12f4,
+	0x21f5027c,
+/* 0x0c2e: i2c_recv_exit */
+	0x00f802f1,
+/* 0x0c30: i2c_init */
+/* 0x0c32: test_recv */
+	0x17f100f8,
+	0x11cf05d8,
+	0x0110b600,
+	0x05d807f1,
+	0xbd0001d0,
+	0x00e7f104,
+	0x4fe3f1d9,
+	0x2321f513,
+/* 0x0c53: test_init */
+	0xf100f802,
+	0xf50800e7,
 	0xf8022321,
-/* 0x0acd: test_init */
-	0x00e7f100,
-	0x2321f508,
-/* 0x0ad7: idle_recv */
-	0xf800f802,
-/* 0x0ad9: idle */
-	0x0031f400,
-	0x05d417f1,
-	0xb60011cf,
-	0x07f10110,
-	0x01d005d4,
-/* 0x0aef: idle_loop */
-	0xf004bd00,
-	0x32f45817,
-/* 0x0af5: idle_proc */
-/* 0x0af5: idle_proc_exec */
-	0xb910f902,
-	0x21f5021e,
-	0x10fc02fa,
-	0xf40911f4,
-	0x0ef40231,
-/* 0x0b09: idle_proc_next */
-	0x5810b6ef,
-	0xf4061fb8,
-	0x02f4e61b,
-	0x0028f4dd,
-	0x00c10ef4,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
-	0x00000000,
+/* 0x0c5d: idle_recv */
+/* 0x0c5f: idle */
+	0xf400f800,
+	0x17f10031,
+	0x11cf05d4,
+	0x0110b600,
+	0x05d407f1,
+	0xbd0001d0,
+/* 0x0c75: idle_loop */
+	0x5817f004,
+/* 0x0c7b: idle_proc */
+/* 0x0c7b: idle_proc_exec */
+	0xf90232f4,
+	0x021eb910,
+	0x02fa21f5,
+	0x11f410fc,
+	0x0231f409,
+/* 0x0c8f: idle_proc_next */
+	0xb6ef0ef4,
+	0x1fb85810,
+	0xe61bf406,
+	0xf4dd02f4,
+	0x0ef40028,
+	0x000000c1,
 	0x00000000,
 	0x00000000,
 	0x00000000,
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
index fe4f63d..a619f74 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
@@ -68,7 +68,7 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x46524550,
-	0x00000631,
+	0x00000717,
 	0x0000062f,
 	0x00000000,
 	0x00000000,
@@ -90,8 +90,8 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x5f433249,
-	0x00000a35,
-	0x000008dc,
+	0x00000ba3,
+	0x00000a4a,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -112,8 +112,8 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x54534554,
-	0x00000a56,
-	0x00000a37,
+	0x00000bc4,
+	0x00000ba5,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -134,8 +134,8 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x454c4449,
-	0x00000a61,
-	0x00000a5f,
+	0x00000bcf,
+	0x00000bcd,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -834,7 +834,15 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_attr_start */
+/* 0x0ccc: perf_polling_period_us */
+	0x000186a0,
+/* 0x0cd0: perf_eng_gr */
+/* 0x0cd1: perf_eng_vdec */
+/* 0x0cd2: perf_eng_mc */
+/* 0x0cd3: perf_eng_pcie */
+	0x00000000,
+/* 0x0cd4: i2c_scl_map */
 	0x00000400,
 	0x00000800,
 	0x00001000,
@@ -845,7 +853,7 @@ uint32_t gk208_pmu_data[] = {
 	0x00020000,
 	0x00040000,
 	0x00080000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0cfc: i2c_sda_map */
 	0x00100000,
 	0x00200000,
 	0x00400000,
@@ -911,8 +919,6 @@ uint32_t gk208_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000000,
-	0x00000000,
 };
 
 uint32_t gk208_pmu_code[] = {
@@ -1373,111 +1379,188 @@ uint32_t gk208_pmu_code[] = {
 	0xf8dc0bf4,
 /* 0x062d: memx_init */
 /* 0x062f: perf_recv */
-	0xf800f800,
-/* 0x0631: perf_init */
-/* 0x0633: i2c_drive_scl */
-	0xb000f800,
-	0x0bf40036,
-	0x07e0400d,
-	0xbd0001f6,
-/* 0x0643: i2c_drive_scl_lo */
-	0x4000f804,
-	0x01f607e4,
-	0xf804bd00,
-/* 0x064d: i2c_drive_sda */
+	0xf900f800,
+	0x48a7f110,
+	0x53a3f14f,
+	0xf4eaa654,
+	0xd6b0441b,
+	0x060bf401,
+/* 0x0647: perf_load */
+	0xbd500ef4,
+	0xf1c4bdb4,
+	0x180cd307,
+	0x04bd000c,
+	0xf108c4b6,
+	0x180cd207,
+	0x04bd000c,
+	0xf108c4b6,
+	0x180cd107,
+	0x04bd000c,
+	0xf108c4b6,
+	0x180cd007,
+	0x04bd000c,
+	0x0002c27e,
+/* 0x067f: perf_recv_not_host */
+	0x7e180ef4,
+	0xf1000698,
+	0x980ccc07,
+	0x04bd000e,
+	0x01d621f5,
+	0x0002017e,
+/* 0x0694: perf_recv_exit */
+	0x00f810fc,
+/* 0x0698: perf_counter_readout */
+	0xcf05084e,
+	0xeecc00ee,
+	0x05184dff,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d200cd0,
+	0x284d04bd,
+	0x00ddcf05,
+	0xf1dcdeff,
+	0x200cd107,
+	0x4d04bd0d,
+	0xddcf0538,
+	0xdcdeff00,
+	0x0cd207f1,
+	0x04bd0d20,
+	0xcf05484d,
+	0xdeff00dd,
+	0xd307f1dc,
+	0xbd0d200c,
+	0x00e7f104,
+	0x00e3f100,
+	0x05084080,
+	0xbd000ef6,
+	0x05184004,
+	0xbd000ef6,
+	0x05284004,
+	0xbd000ef6,
+	0x05384004,
+	0xbd000ef6,
+	0x05484004,
+	0xbd000ef6,
+/* 0x0717: perf_init */
+	0xf100f804,
+	0xf00003e7,
+	0x0c4000e3,
+	0x000ef605,
+	0xe7f104bd,
+	0xe3f00002,
+	0x051c4000,
+	0xbd000ef6,
+	0x052c4004,
+	0xbd000ef6,
+	0x053c4004,
+	0xbd000ef6,
+	0x054c4004,
+	0xbd000ef6,
+	0x0fe7f104,
+	0x38e3f000,
+	0xf6051440,
+	0x04bd000e,
+	0x0070e7f1,
+	0x4002e3f0,
+	0x0ef60524,
+	0xf104bd00,
+	0xf00080e7,
+	0x344000e3,
+	0x000ef605,
+	0xe7f104bd,
+	0xe3f10000,
+	0x44402000,
+	0x000ef605,
+	0x987e04bd,
+	0x07f10006,
+	0x0e980ccc,
+	0xf504bd00,
+	0x7e01d621,
+	0xf8000201,
+/* 0x07a1: i2c_drive_scl */
 	0x0036b000,
 	0x400d0bf4,
-	0x02f607e0,
+	0x01f607e0,
 	0xf804bd00,
-/* 0x065d: i2c_drive_sda_lo */
+/* 0x07b1: i2c_drive_scl_lo */
 	0x07e44000,
+	0xbd0001f6,
+/* 0x07bb: i2c_drive_sda */
+	0xb000f804,
+	0x0bf40036,
+	0x07e0400d,
 	0xbd0002f6,
-/* 0x0667: i2c_sense_scl */
-	0xf400f804,
-	0xc4430132,
-	0x0033cf07,
-	0xf40431fd,
-	0x31f4060b,
-/* 0x0679: i2c_sense_scl_done */
-/* 0x067b: i2c_sense_sda */
-	0xf400f801,
-	0xc4430132,
-	0x0033cf07,
-	0xf40432fd,
-	0x31f4060b,
-/* 0x068d: i2c_sense_sda_done */
-/* 0x068f: i2c_raise_scl */
-	0xf900f801,
-	0x08984440,
-	0x337e0103,
-/* 0x069a: i2c_raise_scl_wait */
-	0xe84e0006,
-	0x005d7e03,
-	0x06677e00,
-	0x0901f400,
-	0xf40142b6,
-/* 0x06ae: i2c_raise_scl_done */
-	0x40fcef1b,
-/* 0x06b2: i2c_start */
-	0x677e00f8,
-	0x11f40006,
-	0x067b7e0d,
-	0x0611f400,
-/* 0x06c3: i2c_start_rep */
-	0x032e0ef4,
-	0x06337e00,
-	0x7e010300,
-	0xbb00064d,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x00068f7e,
-	0xf40464b6,
-/* 0x06ee: i2c_start_send */
-	0x00031d11,
-	0x00064d7e,
-	0x7e13884e,
+/* 0x07cb: i2c_drive_sda_lo */
+	0x4000f804,
+	0x02f607e4,
+	0xf804bd00,
+/* 0x07d5: i2c_sense_scl */
+	0x0132f400,
+	0xcf07c443,
+	0x31fd0033,
+	0x060bf404,
+/* 0x07e7: i2c_sense_scl_done */
+	0xf80131f4,
+/* 0x07e9: i2c_sense_sda */
+	0x0132f400,
+	0xcf07c443,
+	0x32fd0033,
+	0x060bf404,
+/* 0x07fb: i2c_sense_sda_done */
+	0xf80131f4,
+/* 0x07fd: i2c_raise_scl */
+	0x4440f900,
+	0x01030898,
+	0x0007a17e,
+/* 0x0808: i2c_raise_scl_wait */
+	0x7e03e84e,
+	0x7e00005d,
+	0xf40007d5,
+	0x42b60901,
+	0xef1bf401,
+/* 0x081c: i2c_raise_scl_done */
+	0x00f840fc,
+/* 0x0820: i2c_start */
+	0x0007d57e,
+	0x7e0d11f4,
+	0xf40007e9,
+	0x0ef40611,
+/* 0x0831: i2c_start_rep */
+	0x7e00032e,
+	0x030007a1,
+	0x07bb7e01,
+	0x0076bb00,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0xfd7e50fc,
+	0x64b60007,
+	0x1d11f404,
+/* 0x085c: i2c_start_send */
+	0xbb7e0003,
+	0x884e0007,
+	0x005d7e13,
+	0x7e000300,
+	0x4e0007a1,
+	0x5d7e1388,
+/* 0x0876: i2c_start_out */
+	0x00f80000,
+/* 0x0878: i2c_stop */
+	0xa17e0003,
+	0x00030007,
+	0x0007bb7e,
+	0x7e03e84e,
 	0x0300005d,
-	0x06337e00,
+	0x07a17e01,
 	0x13884e00,
 	0x00005d7e,
-/* 0x0708: i2c_start_out */
-/* 0x070a: i2c_stop */
-	0x000300f8,
-	0x0006337e,
-	0x4d7e0003,
-	0xe84e0006,
-	0x005d7e03,
-	0x7e010300,
-	0x4e000633,
-	0x5d7e1388,
-	0x01030000,
-	0x00064d7e,
-	0x7e13884e,
-	0xf800005d,
-/* 0x0739: i2c_bitw */
-	0x064d7e00,
-	0x03e84e00,
-	0x00005d7e,
-	0xb60076bb,
-	0x50f90465,
-	0xbb046594,
-	0x50bd0256,
-	0xfc0475fd,
-	0x068f7e50,
-	0x0464b600,
-	0x4e1711f4,
-	0x5d7e1388,
-	0x00030000,
-	0x0006337e,
-	0x7e13884e,
-/* 0x0777: i2c_bitw_out */
-	0xf800005d,
-/* 0x0779: i2c_bitr */
-	0x7e010300,
-	0x4e00064d,
+	0xbb7e0103,
+	0x884e0007,
+	0x005d7e13,
+/* 0x08a7: i2c_bitw */
+	0x7e00f800,
+	0x4e0007bb,
 	0x5d7e03e8,
 	0x76bb0000,
 	0x0465b600,
@@ -1485,225 +1568,280 @@ uint32_t gk208_pmu_code[] = {
 	0x0256bb04,
 	0x75fd50bd,
 	0x7e50fc04,
-	0xb600068f,
+	0xb60007fd,
 	0x11f40464,
-	0x067b7e1a,
-	0x7e000300,
-	0x4e000633,
-	0x5d7e1388,
-	0x3cf00000,
-	0x0131f401,
-/* 0x07bc: i2c_bitr_done */
-/* 0x07be: i2c_get_byte */
-	0x000500f8,
-/* 0x07c2: i2c_get_byte_next */
-	0x54b60804,
-	0x0076bb01,
-	0xf90465b6,
-	0x04659450,
-	0xbd0256bb,
-	0x0475fd50,
-	0x797e50fc,
-	0x64b60007,
-	0x2a11f404,
-	0xb60553fd,
-	0x1bf40142,
-	0xbb0103d8,
+	0x13884e17,
+	0x00005d7e,
+	0xa17e0003,
+	0x884e0007,
+	0x005d7e13,
+/* 0x08e5: i2c_bitw_out */
+/* 0x08e7: i2c_bitr */
+	0x0300f800,
+	0x07bb7e01,
+	0x03e84e00,
+	0x00005d7e,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x07fd7e50,
+	0x0464b600,
+	0x7e1a11f4,
+	0x030007e9,
+	0x07a17e00,
+	0x13884e00,
+	0x00005d7e,
+	0xf4013cf0,
+/* 0x092a: i2c_bitr_done */
+	0x00f80131,
+/* 0x092c: i2c_get_byte */
+	0x08040005,
+/* 0x0930: i2c_get_byte_next */
+	0xbb0154b6,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x0007397e,
-/* 0x080b: i2c_get_byte_done */
-	0xf80464b6,
-/* 0x080d: i2c_put_byte */
-/* 0x080f: i2c_put_byte_next */
-	0xb6080400,
-	0x54ff0142,
-	0x0076bb38,
+	0x0008e77e,
+	0xf40464b6,
+	0x53fd2a11,
+	0x0142b605,
+	0x03d81bf4,
+	0x0076bb01,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
-	0x397e50fc,
-	0x64b60007,
-	0x3411f404,
-	0xf40046b0,
-	0x76bbd81b,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0x7e50fc04,
-	0xb6000779,
-	0x11f40464,
-	0x0076bb0f,
-	0xf40136b0,
-	0x32f4061b,
-/* 0x0865: i2c_put_byte_done */
-/* 0x0867: i2c_addr */
-	0xbb00f801,
+	0xa77e50fc,
+	0x64b60008,
+/* 0x0979: i2c_get_byte_done */
+/* 0x097b: i2c_put_byte */
+	0x0400f804,
+/* 0x097d: i2c_put_byte_next */
+	0x0142b608,
+	0xbb3854ff,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x0006b27e,
+	0x0008a77e,
 	0xf40464b6,
-	0xc3e72911,
-	0x34b6012e,
-	0x0553fd01,
+	0x46b03411,
+	0xd81bf400,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x080d7e50,
+	0x08e77e50,
 	0x0464b600,
-/* 0x08ac: i2c_addr_done */
-/* 0x08ae: i2c_acquire_addr */
-	0xcec700f8,
-	0x05e4b6f8,
-	0xd014e0b7,
-/* 0x08ba: i2c_acquire */
-	0xae7e00f8,
-	0x047e0008,
-	0xd9f00000,
-	0x002e7e03,
-/* 0x08cb: i2c_release */
-	0x7e00f800,
-	0x7e0008ae,
-	0xf0000004,
-	0x2e7e03da,
-	0x00f80000,
-/* 0x08dc: i2c_recv */
-	0xc70132f4,
-	0x14b6f8c1,
-	0x2816b002,
-	0x01371ff5,
-	0x0cf413b8,
-	0x00329800,
-	0x0ccc13b8,
-	0x00319800,
-	0xf90231f4,
-	0xf9e0f9d0,
-	0x0067f1d0,
-	0x0063f100,
-	0x01679210,
+	0xbb0f11f4,
+	0x36b00076,
+	0x061bf401,
+/* 0x09d3: i2c_put_byte_done */
+	0xf80132f4,
+/* 0x09d5: i2c_addr */
+	0x0076bb00,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x207e50fc,
+	0x64b60008,
+	0x2911f404,
+	0x012ec3e7,
+	0xfd0134b6,
+	0x76bb0553,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0x7e50fc04,
+	0xb600097b,
+/* 0x0a1a: i2c_addr_done */
+	0x00f80464,
+/* 0x0a1c: i2c_acquire_addr */
+	0xb6f8cec7,
+	0xe0b705e4,
+	0x00f8d014,
+/* 0x0a28: i2c_acquire */
+	0x000a1c7e,
+	0x0000047e,
+	0x7e03d9f0,
+	0xf800002e,
+/* 0x0a39: i2c_release */
+	0x0a1c7e00,
+	0x00047e00,
+	0x03daf000,
+	0x00002e7e,
+/* 0x0a4a: i2c_recv */
+	0x32f400f8,
+	0xf8c1c701,
+	0xb00214b6,
+	0x1ff52816,
+	0x13b80137,
+	0x98000cfc,
+	0x13b80032,
+	0x98000cd4,
+	0x31f40031,
+	0xf9d0f902,
+	0xf1d0f9e0,
+	0xf1000067,
+	0x92100063,
+	0x76bb0167,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0x7e50fc04,
+	0xb6000a28,
+	0xd0fc0464,
+	0xf500d6b0,
+	0x0500b01b,
+	0x0076bb00,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0xd57e50fc,
+	0x64b60009,
+	0xcc11f504,
+	0xe0c5c700,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x08ba7e50,
+	0x097b7e50,
 	0x0464b600,
-	0xd6b0d0fc,
-	0xb01bf500,
-	0xbb000500,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x0008677e,
-	0xf50464b6,
-	0xc700cc11,
-	0x76bbe0c5,
+	0x00a911f5,
+	0x76bb0105,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0x7e50fc04,
-	0xb600080d,
+	0xb60009d5,
 	0x11f50464,
-	0x010500a9,
-	0xb60076bb,
-	0x50f90465,
-	0xbb046594,
-	0x50bd0256,
-	0xfc0475fd,
-	0x08677e50,
-	0x0464b600,
-	0x008711f5,
+	0x76bb0087,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0x7e50fc04,
+	0xb600092c,
+	0x11f40464,
+	0xe05bcb67,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x07be7e50,
+	0x08787e50,
 	0x0464b600,
-	0xcb6711f4,
-	0x76bbe05b,
-	0x0465b600,
-	0x659450f9,
-	0x0256bb04,
-	0x75fd50bd,
-	0x7e50fc04,
-	0xb600070a,
-	0x5bb20464,
-	0x0ef474bd,
-/* 0x09e1: i2c_recv_not_rd08 */
-	0x01d6b041,
-	0x053b1bf4,
-	0x08677e00,
-	0x3211f400,
-	0x7ee0c5c7,
-	0xf400080d,
-	0x00052811,
-	0x0008677e,
-	0xc71f11f4,
-	0x0d7ee0b5,
-	0x11f40008,
-	0x070a7e15,
-	0xc774bd00,
-	0x1bf408c5,
-	0x0232f409,
-/* 0x0a1f: i2c_recv_not_wr08 */
-/* 0x0a1f: i2c_recv_done */
-	0xc7030ef4,
-	0xcb7ef8ce,
-	0xe0fc0008,
-	0x12f4d0fc,
-	0x7e7cb209,
-/* 0x0a33: i2c_recv_exit */
-	0xf80002c2,
-/* 0x0a35: i2c_init */
-/* 0x0a37: test_recv */
-	0x4100f800,
-	0x11cf0458,
-	0x0110b600,
-	0xf6045840,
-	0x04bd0001,
-	0xd900e7f1,
-	0x134fe3f1,
-	0x0002017e,
-/* 0x0a56: test_init */
-	0x004e00f8,
-	0x02017e08,
-/* 0x0a5f: idle_recv */
+	0x74bd5bb2,
+/* 0x0b4f: i2c_recv_not_rd08 */
+	0xb0410ef4,
+	0x1bf401d6,
+	0x7e00053b,
+	0xf40009d5,
+	0xc5c73211,
+	0x097b7ee0,
+	0x2811f400,
+	0xd57e0005,
+	0x11f40009,
+	0xe0b5c71f,
+	0x00097b7e,
+	0x7e1511f4,
+	0xbd000878,
+	0x08c5c774,
+	0xf4091bf4,
+	0x0ef40232,
+/* 0x0b8d: i2c_recv_not_wr08 */
+/* 0x0b8d: i2c_recv_done */
+	0xf8cec703,
+	0x000a397e,
+	0xd0fce0fc,
+	0xb20912f4,
+	0x02c27e7c,
+/* 0x0ba1: i2c_recv_exit */
+/* 0x0ba3: i2c_init */
 	0xf800f800,
-/* 0x0a61: idle */
-	0x0031f400,
-	0xcf045441,
-	0x10b60011,
-	0x04544001,
-	0xbd0001f6,
-/* 0x0a75: idle_loop */
-	0xf4580104,
-/* 0x0a7a: idle_proc */
-/* 0x0a7a: idle_proc_exec */
-	0x10f90232,
-	0xcb7e1eb2,
-	0x10fc0002,
-	0xf40911f4,
-	0x0ef40231,
-/* 0x0a8d: idle_proc_next */
-	0x5810b6f0,
-	0x1bf41fa6,
-	0xe002f4e8,
-	0xf40028f4,
-	0x0000c60e,
+/* 0x0ba5: test_recv */
+	0x04584100,
+	0xb60011cf,
+	0x58400110,
+	0x0001f604,
+	0xe7f104bd,
+	0xe3f1d900,
+	0x017e134f,
+	0x00f80002,
+/* 0x0bc4: test_init */
+	0x7e08004e,
+	0xf8000201,
+/* 0x0bcd: idle_recv */
+/* 0x0bcf: idle */
+	0xf400f800,
+	0x54410031,
+	0x0011cf04,
+	0x400110b6,
+	0x01f60454,
+/* 0x0be3: idle_loop */
+	0x0104bd00,
+	0x0232f458,
+/* 0x0be8: idle_proc */
+/* 0x0be8: idle_proc_exec */
+	0x1eb210f9,
+	0x0002cb7e,
+	0x11f410fc,
+	0x0231f409,
+/* 0x0bfb: idle_proc_next */
+	0xb6f00ef4,
+	0x1fa65810,
+	0xf4e81bf4,
+	0x28f4e002,
+	0xc60ef400,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
 	0x00000000,
 	0x00000000,
 	0x00000000,
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h b/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
index 2686f8f..7fb9a49 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
@@ -68,7 +68,7 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x46524550,
-	0x00000846,
+	0x0000092b,
 	0x00000844,
 	0x00000000,
 	0x00000000,
@@ -90,8 +90,8 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x5f433249,
-	0x00000c76,
-	0x00000b19,
+	0x00000de7,
+	0x00000c8a,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -112,8 +112,8 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x54534554,
-	0x00000c9f,
-	0x00000c78,
+	0x00000e10,
+	0x00000de9,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -134,8 +134,8 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x454c4449,
-	0x00000cab,
-	0x00000ca9,
+	0x00000e1c,
+	0x00000e1a,
 	0x00000000,
 	0x00000000,
 	0x00000000,
@@ -834,7 +834,14 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_attr_start */
+/* 0x0ccc: perf_polling_period_us */
+	0x000186a0,
+/* 0x0cd0: perf_eng_gr */
+/* 0x0cd1: perf_eng_vdec */
+/* 0x0cd2: perf_eng_mc */
+	0x00000000,
+/* 0x0cd4: i2c_scl_map */
 	0x00001000,
 	0x00004000,
 	0x00010000,
@@ -845,7 +852,7 @@ uint32_t gt215_pmu_data[] = {
 	0x01000000,
 	0x04000000,
 	0x10000000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0cfc: i2c_sda_map */
 	0x00002000,
 	0x00008000,
 	0x00020000,
@@ -856,7 +863,7 @@ uint32_t gt215_pmu_data[] = {
 	0x02000000,
 	0x08000000,
 	0x20000000,
-/* 0x0d1c: i2c_ctrl */
+/* 0x0d24: i2c_ctrl */
 	0x0000e138,
 	0x0000e150,
 	0x0000e168,
@@ -912,8 +919,6 @@ uint32_t gt215_pmu_data[] = {
 	0x00000000,
 	0x00000000,
 	0x00000000,
-	0x00000000,
-	0x00000000,
 };
 
 uint32_t gt215_pmu_code[] = {
@@ -1516,352 +1521,484 @@ uint32_t gt215_pmu_code[] = {
 /* 0x0842: memx_init */
 	0x00f800f8,
 /* 0x0844: perf_recv */
-/* 0x0846: perf_init */
-	0x00f800f8,
-/* 0x0848: i2c_drive_scl */
-	0xf40036b0,
-	0x07f1110b,
-	0x04b607e0,
-	0x0001d006,
-	0x00f804bd,
-/* 0x085c: i2c_drive_scl_lo */
-	0x07e407f1,
-	0xd00604b6,
-	0x04bd0001,
-/* 0x086a: i2c_drive_sda */
-	0x36b000f8,
-	0x110bf400,
-	0x07e007f1,
+	0xa7f110f9,
+	0xa3f14f48,
+	0xeab85453,
+	0x381bf406,
+	0xf401d6b0,
+	0x0ef4060b,
+/* 0x085d: perf_load */
+	0xbdb4bd44,
+	0xd207f1c4,
+	0x000c180c,
+	0xc4b604bd,
+	0xd107f108,
+	0x000c180c,
+	0xc4b604bd,
+	0xd007f108,
+	0x000c180c,
+	0x21f504bd,
+	0x0ef40342,
+/* 0x0889: perf_recv_not_host */
+	0xa221f518,
+	0xcc07f108,
+	0x000e980c,
+	0x21f504bd,
+	0x21f50236,
+/* 0x089e: perf_recv_exit */
+	0x10fc0262,
+/* 0x08a2: perf_counter_readout */
+	0xe7f100f8,
+	0xe4b60508,
+	0x00eecf06,
+	0xf1ffeecc,
+	0xb60518d7,
+	0xddcf06d4,
+	0xdcdeff00,
+	0x0cd007f1,
+	0xbd000d00,
+	0x28d7f104,
+	0x06d4b605,
+	0xff00ddcf,
+	0x07f1dcde,
+	0x0d000cd1,
+	0xf104bd00,
+	0xb60538d7,
+	0xddcf06d4,
+	0xdcdeff00,
+	0x0cd207f1,
+	0xbd000d00,
+	0x00e7f104,
+	0x00e3f100,
+	0x0807f180,
+	0x0604b605,
+	0xbd000ed0,
+	0x1807f104,
+	0x0604b605,
+	0xbd000ed0,
+	0x2807f104,
+	0x0604b605,
+	0xbd000ed0,
+	0x3807f104,
+	0x0604b605,
+	0xbd000ed0,
+/* 0x092b: perf_init */
+	0xf100f804,
+	0xf00003e7,
+	0x07f100e3,
+	0x04b6050c,
+	0x000ed006,
+	0xe7f104bd,
+	0xe3f00002,
+	0x1c07f100,
+	0x0604b605,
+	0xbd000ed0,
+	0x2c07f104,
+	0x0604b605,
+	0xbd000ed0,
+	0x3c07f104,
+	0x0604b605,
+	0xbd000ed0,
+	0x0de7f104,
+	0x00e3f000,
+	0x051407f1,
 	0xd00604b6,
-	0x04bd0002,
-/* 0x087e: i2c_drive_sda_lo */
-	0x07f100f8,
-	0x04b607e4,
-	0x0002d006,
-	0x00f804bd,
-/* 0x088c: i2c_sense_scl */
-	0xf10132f4,
-	0xb607c437,
-	0x33cf0634,
-	0x0431fd00,
-	0xf4060bf4,
-/* 0x08a2: i2c_sense_scl_done */
-	0x00f80131,
-/* 0x08a4: i2c_sense_sda */
-	0xf10132f4,
-	0xb607c437,
-	0x33cf0634,
-	0x0432fd00,
-	0xf4060bf4,
-/* 0x08ba: i2c_sense_sda_done */
-	0x00f80131,
-/* 0x08bc: i2c_raise_scl */
-	0x47f140f9,
-	0x37f00898,
-	0x4821f501,
-/* 0x08c9: i2c_raise_scl_wait */
-	0xe8e7f108,
-	0x7f21f403,
-	0x088c21f5,
-	0xb60901f4,
-	0x1bf40142,
-/* 0x08dd: i2c_raise_scl_done */
-	0xf840fcef,
-/* 0x08e1: i2c_start */
-	0x8c21f500,
-	0x0d11f408,
-	0x08a421f5,
-	0xf40611f4,
-/* 0x08f2: i2c_start_rep */
-	0x37f0300e,
-	0x4821f500,
-	0x0137f008,
-	0x086a21f5,
-	0xb60076bb,
-	0x50f90465,
-	0xbb046594,
-	0x50bd0256,
-	0xfc0475fd,
-	0xbc21f550,
-	0x0464b608,
-/* 0x091f: i2c_start_send */
-	0xf01f11f4,
+	0x04bd000e,
+	0x0070e7f1,
+	0xf100e3f0,
+	0xb6052407,
+	0x0ed00604,
+	0xf104bd00,
+	0xf00100e7,
+	0x07f100e3,
+	0x04b60534,
+	0x000ed006,
+	0x21f504bd,
+	0x07f108a2,
+	0x0e980ccc,
+	0xf504bd00,
+	0xf5023621,
+	0xf8026221,
+/* 0x09b9: i2c_drive_scl */
+	0x0036b000,
+	0xf1110bf4,
+	0xb607e007,
+	0x01d00604,
+	0xf804bd00,
+/* 0x09cd: i2c_drive_scl_lo */
+	0xe407f100,
+	0x0604b607,
+	0xbd0001d0,
+/* 0x09db: i2c_drive_sda */
+	0xb000f804,
+	0x0bf40036,
+	0xe007f111,
+	0x0604b607,
+	0xbd0002d0,
+/* 0x09ef: i2c_drive_sda_lo */
+	0xf100f804,
+	0xb607e407,
+	0x02d00604,
+	0xf804bd00,
+/* 0x09fd: i2c_sense_scl */
+	0x0132f400,
+	0x07c437f1,
+	0xcf0634b6,
+	0x31fd0033,
+	0x060bf404,
+/* 0x0a13: i2c_sense_scl_done */
+	0xf80131f4,
+/* 0x0a15: i2c_sense_sda */
+	0x0132f400,
+	0x07c437f1,
+	0xcf0634b6,
+	0x32fd0033,
+	0x060bf404,
+/* 0x0a2b: i2c_sense_sda_done */
+	0xf80131f4,
+/* 0x0a2d: i2c_raise_scl */
+	0xf140f900,
+	0xf0089847,
+	0x21f50137,
+/* 0x0a3a: i2c_raise_scl_wait */
+	0xe7f109b9,
+	0x21f403e8,
+	0xfd21f57f,
+	0x0901f409,
+	0xf40142b6,
+/* 0x0a4e: i2c_raise_scl_done */
+	0x40fcef1b,
+/* 0x0a52: i2c_start */
+	0x21f500f8,
+	0x11f409fd,
+	0x1521f50d,
+	0x0611f40a,
+/* 0x0a63: i2c_start_rep */
+	0xf0300ef4,
 	0x21f50037,
-	0xe7f1086a,
-	0x21f41388,
-	0x0037f07f,
-	0x084821f5,
-	0x1388e7f1,
-/* 0x093b: i2c_start_out */
-	0xf87f21f4,
-/* 0x093d: i2c_stop */
-	0x0037f000,
-	0x084821f5,
+	0x37f009b9,
+	0xdb21f501,
+	0x0076bb09,
+	0xf90465b6,
+	0x04659450,
+	0xbd0256bb,
+	0x0475fd50,
+	0x21f550fc,
+	0x64b60a2d,
+	0x1f11f404,
+/* 0x0a90: i2c_start_send */
 	0xf50037f0,
-	0xf1086a21,
-	0xf403e8e7,
+	0xf109db21,
+	0xf41388e7,
 	0x37f07f21,
-	0x4821f501,
-	0x88e7f108,
+	0xb921f500,
+	0x88e7f109,
 	0x7f21f413,
-	0xf50137f0,
-	0xf1086a21,
-	0xf41388e7,
-	0x00f87f21,
-/* 0x0970: i2c_bitw */
-	0x086a21f5,
+/* 0x0aac: i2c_start_out */
+/* 0x0aae: i2c_stop */
+	0x37f000f8,
+	0xb921f500,
+	0x0037f009,
+	0x09db21f5,
 	0x03e8e7f1,
-	0xbb7f21f4,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x08bc21f5,
-	0xf40464b6,
-	0xe7f11811,
+	0xf07f21f4,
+	0x21f50137,
+	0xe7f109b9,
 	0x21f41388,
-	0x0037f07f,
-	0x084821f5,
+	0x0137f07f,
+	0x09db21f5,
 	0x1388e7f1,
-/* 0x09af: i2c_bitw_out */
 	0xf87f21f4,
-/* 0x09b1: i2c_bitr */
-	0x0137f000,
-	0x086a21f5,
-	0x03e8e7f1,
-	0xbb7f21f4,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x08bc21f5,
-	0xf40464b6,
-	0x21f51b11,
-	0x37f008a4,
-	0x4821f500,
-	0x88e7f108,
+/* 0x0ae1: i2c_bitw */
+	0xdb21f500,
+	0xe8e7f109,
+	0x7f21f403,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x2d21f550,
+	0x0464b60a,
+	0xf11811f4,
+	0xf41388e7,
+	0x37f07f21,
+	0xb921f500,
+	0x88e7f109,
 	0x7f21f413,
-	0xf4013cf0,
-/* 0x09f6: i2c_bitr_done */
-	0x00f80131,
-/* 0x09f8: i2c_get_byte */
-	0xf00057f0,
-/* 0x09fe: i2c_get_byte_next */
-	0x54b60847,
+/* 0x0b20: i2c_bitw_out */
+/* 0x0b22: i2c_bitr */
+	0x37f000f8,
+	0xdb21f501,
+	0xe8e7f109,
+	0x7f21f403,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x2d21f550,
+	0x0464b60a,
+	0xf51b11f4,
+	0xf00a1521,
+	0x21f50037,
+	0xe7f109b9,
+	0x21f41388,
+	0x013cf07f,
+/* 0x0b67: i2c_bitr_done */
+	0xf80131f4,
+/* 0x0b69: i2c_get_byte */
+	0x0057f000,
+/* 0x0b6f: i2c_get_byte_next */
+	0xb60847f0,
+	0x76bb0154,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb60b2221,
+	0x11f40464,
+	0x0553fd2b,
+	0xf40142b6,
+	0x37f0d81b,
 	0x0076bb01,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b609b1,
-	0x2b11f404,
-	0xb60553fd,
-	0x1bf40142,
-	0x0137f0d8,
+	0x64b60ae1,
+/* 0x0bb9: i2c_get_byte_done */
+/* 0x0bbb: i2c_put_byte */
+	0xf000f804,
+/* 0x0bbe: i2c_put_byte_next */
+	0x42b60847,
+	0x3854ff01,
 	0xb60076bb,
 	0x50f90465,
 	0xbb046594,
 	0x50bd0256,
 	0xfc0475fd,
-	0x7021f550,
-	0x0464b609,
-/* 0x0a48: i2c_get_byte_done */
-/* 0x0a4a: i2c_put_byte */
-	0x47f000f8,
-/* 0x0a4d: i2c_put_byte_next */
-	0x0142b608,
-	0xbb3854ff,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x097021f5,
-	0xf40464b6,
-	0x46b03411,
-	0xd81bf400,
-	0xb60076bb,
-	0x50f90465,
-	0xbb046594,
-	0x50bd0256,
-	0xfc0475fd,
-	0xb121f550,
-	0x0464b609,
-	0xbb0f11f4,
-	0x36b00076,
-	0x061bf401,
-/* 0x0aa3: i2c_put_byte_done */
-	0xf80132f4,
-/* 0x0aa5: i2c_addr */
-	0x0076bb00,
+	0xe121f550,
+	0x0464b60a,
+	0xb03411f4,
+	0x1bf40046,
+	0x0076bbd8,
 	0xf90465b6,
 	0x04659450,
 	0xbd0256bb,
 	0x0475fd50,
 	0x21f550fc,
-	0x64b608e1,
-	0x2911f404,
-	0x012ec3e7,
-	0xfd0134b6,
-	0x76bb0553,
+	0x64b60b22,
+	0x0f11f404,
+	0xb00076bb,
+	0x1bf40136,
+	0x0132f406,
+/* 0x0c14: i2c_put_byte_done */
+/* 0x0c16: i2c_addr */
+	0x76bb00f8,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb60a4a21,
-/* 0x0aea: i2c_addr_done */
-	0x00f80464,
-/* 0x0aec: i2c_acquire_addr */
-	0xb6f8cec7,
-	0xe0b702e4,
-	0xee980d1c,
-/* 0x0afb: i2c_acquire */
-	0xf500f800,
-	0xf40aec21,
-	0xd9f00421,
-	0x3f21f403,
-/* 0x0b0a: i2c_release */
-	0x21f500f8,
-	0x21f40aec,
-	0x03daf004,
-	0xf83f21f4,
-/* 0x0b19: i2c_recv */
-	0x0132f400,
-	0xb6f8c1c7,
-	0x16b00214,
-	0x3a1ff528,
-	0xf413a001,
-	0x0032980c,
-	0x0ccc13a0,
-	0xf4003198,
-	0xd0f90231,
-	0xd0f9e0f9,
-	0x000067f1,
-	0x100063f1,
-	0xbb016792,
+	0xb60a5221,
+	0x11f40464,
+	0x2ec3e729,
+	0x0134b601,
+	0xbb0553fd,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x0afb21f5,
-	0xfc0464b6,
-	0x00d6b0d0,
-	0x00b31bf5,
-	0xbb0057f0,
+	0x0bbb21f5,
+/* 0x0c5b: i2c_addr_done */
+	0xf80464b6,
+/* 0x0c5d: i2c_acquire_addr */
+	0xf8cec700,
+	0xb702e4b6,
+	0x980d24e0,
+	0x00f800ee,
+/* 0x0c6c: i2c_acquire */
+	0x0c5d21f5,
+	0xf00421f4,
+	0x21f403d9,
+/* 0x0c7b: i2c_release */
+	0xf500f83f,
+	0xf40c5d21,
+	0xdaf00421,
+	0x3f21f403,
+/* 0x0c8a: i2c_recv */
+	0x32f400f8,
+	0xf8c1c701,
+	0xb00214b6,
+	0x1ff52816,
+	0x13a0013a,
+	0x32980cfc,
+	0xd413a000,
+	0x0031980c,
+	0xf90231f4,
+	0xf9e0f9d0,
+	0x0067f1d0,
+	0x0063f100,
+	0x01679210,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x6c21f550,
+	0x0464b60c,
+	0xd6b0d0fc,
+	0xb31bf500,
+	0x0057f000,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0x1621f550,
+	0x0464b60c,
+	0x00d011f5,
+	0xbbe0c5c7,
 	0x65b60076,
 	0x9450f904,
 	0x56bb0465,
 	0xfd50bd02,
 	0x50fc0475,
-	0x0aa521f5,
+	0x0bbb21f5,
 	0xf50464b6,
-	0xc700d011,
-	0x76bbe0c5,
+	0xf000ad11,
+	0x76bb0157,
 	0x0465b600,
 	0x659450f9,
 	0x0256bb04,
 	0x75fd50bd,
 	0xf550fc04,
-	0xb60a4a21,
+	0xb60c1621,
 	0x11f50464,
-	0x57f000ad,
-	0x0076bb01,
-	0xf90465b6,
-	0x04659450,
-	0xbd0256bb,
-	0x0475fd50,
-	0x21f550fc,
-	0x64b60aa5,
-	0x8a11f504,
-	0x0076bb00,
-	0xf90465b6,
-	0x04659450,
-	0xbd0256bb,
-	0x0475fd50,
-	0x21f550fc,
-	0x64b609f8,
-	0x6a11f404,
-	0xbbe05bcb,
-	0x65b60076,
-	0x9450f904,
-	0x56bb0465,
-	0xfd50bd02,
-	0x50fc0475,
-	0x093d21f5,
-	0xb90464b6,
-	0x74bd025b,
-/* 0x0c1f: i2c_recv_not_rd08 */
-	0xb0430ef4,
-	0x1bf401d6,
-	0x0057f03d,
-	0x0aa521f5,
-	0xc73311f4,
-	0x21f5e0c5,
-	0x11f40a4a,
-	0x0057f029,
-	0x0aa521f5,
-	0xc71f11f4,
-	0x21f5e0b5,
-	0x11f40a4a,
-	0x3d21f515,
-	0xc774bd09,
-	0x1bf408c5,
-	0x0232f409,
-/* 0x0c5f: i2c_recv_not_wr08 */
-/* 0x0c5f: i2c_recv_done */
-	0xc7030ef4,
-	0x21f5f8ce,
-	0xe0fc0b0a,
-	0x12f4d0fc,
-	0x027cb90a,
-	0x034221f5,
-/* 0x0c74: i2c_recv_exit */
-/* 0x0c76: i2c_init */
+	0x76bb008a,
+	0x0465b600,
+	0x659450f9,
+	0x0256bb04,
+	0x75fd50bd,
+	0xf550fc04,
+	0xb60b6921,
+	0x11f40464,
+	0xe05bcb6a,
+	0xb60076bb,
+	0x50f90465,
+	0xbb046594,
+	0x50bd0256,
+	0xfc0475fd,
+	0xae21f550,
+	0x0464b60a,
+	0xbd025bb9,
+	0x430ef474,
+/* 0x0d90: i2c_recv_not_rd08 */
+	0xf401d6b0,
+	0x57f03d1b,
+	0x1621f500,
+	0x3311f40c,
+	0xf5e0c5c7,
+	0xf40bbb21,
+	0x57f02911,
+	0x1621f500,
+	0x1f11f40c,
+	0xf5e0b5c7,
+	0xf40bbb21,
+	0x21f51511,
+	0x74bd0aae,
+	0xf408c5c7,
+	0x32f4091b,
+	0x030ef402,
+/* 0x0dd0: i2c_recv_not_wr08 */
+/* 0x0dd0: i2c_recv_done */
+	0xf5f8cec7,
+	0xfc0c7b21,
+	0xf4d0fce0,
+	0x7cb90a12,
+	0x4221f502,
+/* 0x0de5: i2c_recv_exit */
+/* 0x0de7: i2c_init */
+	0xf800f803,
+/* 0x0de9: test_recv */
+	0xd817f100,
+	0x0614b605,
+	0xb60011cf,
+	0x07f10110,
+	0x04b605d8,
+	0x0001d006,
+	0xe7f104bd,
+	0xe3f1d900,
+	0x21f5134f,
+	0x00f80262,
+/* 0x0e10: test_init */
+	0x0800e7f1,
+	0x026221f5,
+/* 0x0e1a: idle_recv */
 	0x00f800f8,
-/* 0x0c78: test_recv */
-	0x05d817f1,
-	0xcf0614b6,
-	0x10b60011,
-	0xd807f101,
-	0x0604b605,
-	0xbd0001d0,
-	0x00e7f104,
-	0x4fe3f1d9,
-	0x6221f513,
-/* 0x0c9f: test_init */
-	0xf100f802,
-	0xf50800e7,
-	0xf8026221,
-/* 0x0ca9: idle_recv */
-/* 0x0cab: idle */
-	0xf400f800,
-	0x17f10031,
-	0x14b605d4,
-	0x0011cf06,
-	0xf10110b6,
-	0xb605d407,
-	0x01d00604,
-/* 0x0cc7: idle_loop */
-	0xf004bd00,
-	0x32f45817,
-/* 0x0ccd: idle_proc */
-/* 0x0ccd: idle_proc_exec */
-	0xb910f902,
-	0x21f5021e,
-	0x10fc034b,
-	0xf40911f4,
-	0x0ef40231,
-/* 0x0ce1: idle_proc_next */
-	0x5810b6ef,
-	0xf4061fb8,
-	0x02f4e61b,
-	0x0028f4dd,
-	0x00bb0ef4,
+/* 0x0e1c: idle */
+	0xf10031f4,
+	0xb605d417,
+	0x11cf0614,
+	0x0110b600,
+	0x05d407f1,
+	0xd00604b6,
+	0x04bd0001,
+/* 0x0e38: idle_loop */
+	0xf45817f0,
+/* 0x0e3e: idle_proc */
+/* 0x0e3e: idle_proc_exec */
+	0x10f90232,
+	0xf5021eb9,
+	0xfc034b21,
+	0x0911f410,
+	0xf40231f4,
+/* 0x0e52: idle_proc_next */
+	0x10b6ef0e,
+	0x061fb858,
+	0xf4e61bf4,
+	0x28f4dd02,
+	0xbb0ef400,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
+	0x00000000,
 	0x00000000,
 	0x00000000,
 	0x00000000,
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
index c8b06cb..53508d9 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
@@ -49,4 +49,8 @@
 #define I2C__MSG_DATA0_WR08_REG 0:7
 #define I2C__MSG_DATA1_WR08_VAL 0:7
 
+
+/* PERF: message identifiers */
+#define PERF_MSG_LOAD 1
+
 #endif
diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
index 38eadf7..69a8f8d 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
@@ -30,6 +30,18 @@ process(PROC_PERF, #perf_init, #perf_recv)
  * PERF data segment
  *****************************************************************************/
 #ifdef INCLUDE_DATA
+perf_attr_start:
+// parameters
+perf_polling_period_us: .b32 100000
+
+// engine usage percentage
+perf_eng_gr:   .b8 0
+perf_eng_vdec: .b8 0
+perf_eng_mc:   .b8 0
+#if NVKM_PPWR_CHIPSET >= GF100
+perf_eng_pcie: .b8 0
+#endif
+.align 4
 #endif
 
 /******************************************************************************
@@ -46,6 +58,78 @@ process(PROC_PERF, #perf_init, #perf_recv)
 // $r11 - data1
 // $r0  - zero
 perf_recv:
+	push $r1
+
+	imm32($r10, PROC_HOST)
+	cmp b32 $r14 $r10
+	bra ne #perf_recv_not_host
+		cmp b32 $r13 PERF_MSG_LOAD
+		bra e #perf_load
+		bra #perf_recv_exit
+
+perf_load:
+			clear b32 $r11
+			clear b32 $r12
+#if NVKM_PPWR_CHIPSET >= GF100
+			ld(b8, $r12, #perf_eng_pcie)
+			shl b32 $r12 8
+#endif
+			ld(b8, $r12, #perf_eng_mc)
+			shl b32 $r12 8
+			ld(b8, $r12, #perf_eng_vdec)
+			shl b32 $r12 8
+			ld(b8, $r12, #perf_eng_gr)
+			call(send)
+			bra #perf_recv_exit
+
+perf_recv_not_host:
+	call(perf_counter_readout)
+
+	ld(b32, $r14, #perf_polling_period_us)
+	call #ticks_from_us
+	call(timer)
+
+perf_recv_exit:
+	pop $r1
+	ret
+
+
+// description
+//
+// $r15 - current (perf)
+// $r0  - zero
+perf_counter_readout:
+	nv_iord($r14, NV_PPWR_COUNTER_COUNT(0))
+	div $r14 $r14 0xff
+
+	nv_iord($r13, NV_PPWR_COUNTER_COUNT(1))
+	div $r13 $r13 $r14
+	st(b8, #perf_eng_gr, $r13)
+
+	nv_iord($r13, NV_PPWR_COUNTER_COUNT(2))
+	div $r13 $r13 $r14
+	st(b8, #perf_eng_vdec, $r13)
+
+	nv_iord($r13, NV_PPWR_COUNTER_COUNT(3))
+	div $r13 $r13 $r14
+	st(b8, #perf_eng_mc, $r13)
+
+#if NVKM_PPWR_CHIPSET >= GF100
+	nv_iord($r13, NV_PPWR_COUNTER_COUNT(4))
+	div $r13 $r13 $r14
+	st(b8, #perf_eng_pcie, $r13)
+#endif
+
+	// reset the counters
+	imm32($r14, NV_PPWR_COUNTER_COUNT_RESET)
+	nv_iowr(NV_PPWR_COUNTER_COUNT(0), $r14)
+	nv_iowr(NV_PPWR_COUNTER_COUNT(1), $r14)
+	nv_iowr(NV_PPWR_COUNTER_COUNT(2), $r14)
+	nv_iowr(NV_PPWR_COUNTER_COUNT(3), $r14)
+#if NVKM_PPWR_CHIPSET >= GF100
+	nv_iowr(NV_PPWR_COUNTER_COUNT(4), $r14)
+#endif
+
 	ret
 
 // description
@@ -53,5 +137,69 @@ perf_recv:
 // $r15 - current (perf)
 // $r0  - zero
 perf_init:
+	// set up the total ticks counter first
+	imm32($r14, NV_PPWR_COUNTER_MODE_ALWAYS)
+	nv_iowr(NV_PPWR_COUNTER_MODE(0), $r14)
+
+	// set up the other counters, with fermi there are more
+	imm32($r14, NV_PPWR_COUNTER_MODE_IF_NOT_ALL)
+	nv_iowr(NV_PPWR_COUNTER_MODE(1), $r14)
+	nv_iowr(NV_PPWR_COUNTER_MODE(2), $r14)
+	nv_iowr(NV_PPWR_COUNTER_MODE(3), $r14)
+#if NVKM_PPWR_CHIPSET >= GF100
+	nv_iowr(NV_PPWR_COUNTER_MODE(4), $r14)
+#endif
+
+	// core load counter
+	imm32($r14,
+		  NV_PPWR_COUNTER_SIG_GR_IDLE
+		| NV_PPWR_COUNTER_SIG_GR_GPC_IDLE
+		| NV_PPWR_COUNTER_SIG_GR_ROP_IDLE
+#if NVKM_PPWR_CHIPSET >= GF100
+		| NV_PPWR_COUNTER_SIG_GR_HUB_IDLE
+		| NV_PPWR_COUNTER_SIG_PCOPY0_IDLE
+		| NV_PPWR_COUNTER_SIG_PCOPY1_IDLE
+#if NVKM_PPWR_CHIPSET >= GK104
+		| NV_PPWR_COUNTER_SIG_PCOPY2_IDLE
+#endif
+#endif
+	)
+	nv_iowr(NV_PPWR_COUNTER_MASK(1), $r14)
+
+	// video load counter
+	imm32($r14,
+		  NV_PPWR_COUNTER_SIG_PVLD_IDLE
+		| NV_PPWR_COUNTER_SIG_PPDEC_IDLE
+		| NV_PPWR_COUNTER_SIG_PPPP_IDLE
+#if NVKM_PPWR_CHIPSET >= GK104
+		| NV_PPWR_COUNTER_SIG_PVENC
+#endif
+	)
+	nv_iowr(NV_PPWR_COUNTER_MASK(2), $r14)
+
+	// memory load counter
+	imm32($r14,
+#if NVKM_PPWR_CHIPSET >= GF100
+		  NV_PPWR_COUNTER_SIG_BFB_PART0_REQ
+#else
+		  NV_PPWR_COUNTER_SIG_FB_PART0_REQ
+#endif
+	)
+	nv_iowr(NV_PPWR_COUNTER_MASK(3), $r14)
+
+	// pcie load counter
+#if NVKM_PPWR_CHIPSET >= GF100
+	imm32($r14, NV_PPWR_COUNTER_SIG_PCIE)
+	nv_iowr(NV_PPWR_COUNTER_MASK(4), $r14)
+#endif
+
+	// initial read out
+	call(perf_counter_readout)
+
+	// schedule the next read out
+	ld(b32, $r14, #perf_polling_period_us)
+	call #ticks_from_us
+	call(timer)
+
 	ret
 #endif
-- 
2.6.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] nouveau/debugfs: add interface for current load
       [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-10-26 18:13   ` [PATCH 3/4] subdev/pmu/fuc: implement perf Karol Herbst
@ 2015-10-26 18:13   ` Karol Herbst
       [not found]     ` <1445883189-4407-5-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  3 siblings, 1 reply; 12+ messages in thread
From: Karol Herbst @ 2015-10-26 18:13 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

From: Karol Herbst <git@karolherbst.de>

---
 drm/nouveau/include/nvif/device.h     |  1 +
 drm/nouveau/include/nvkm/subdev/pmu.h | 10 ++++++++++
 drm/nouveau/nouveau_debugfs.c         | 23 +++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/pmu/base.c    | 18 ++++++++++++++++++
 4 files changed, 52 insertions(+)

diff --git a/drm/nouveau/include/nvif/device.h b/drm/nouveau/include/nvif/device.h
index 700a9b2..d289fdf 100644
--- a/drm/nouveau/include/nvif/device.h
+++ b/drm/nouveau/include/nvif/device.h
@@ -63,6 +63,7 @@ u64  nvif_device_time(struct nvif_device *);
 #define nvxx_clk(a) nvxx_device(a)->clk
 #define nvxx_i2c(a) nvxx_device(a)->i2c
 #define nvxx_therm(a) nvxx_device(a)->therm
+#define nvxx_pmu(a) nvxx_device(a)->pmu
 
 #include <core/device.h>
 #include <engine/fifo.h>
diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
index e61923d..be3c60e 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -23,6 +23,13 @@ struct nvkm_pmu {
 	} recv;
 };
 
+struct nvkm_pmu_load_data {
+	u8 core;
+	u8 mem;
+	u8 video;
+	u8 pcie;
+};
+
 int nvkm_pmu_send(struct nvkm_pmu *, u32 reply[2], u32 process,
 		  u32 message, u32 data0, u32 data1);
 void nvkm_pmu_pgob(struct nvkm_pmu *, bool enable);
@@ -48,4 +55,7 @@ void nvkm_memx_train(struct nvkm_memx *);
 int  nvkm_memx_train_result(struct nvkm_pmu *, u32 *, int);
 void nvkm_memx_block(struct nvkm_memx *);
 void nvkm_memx_unblock(struct nvkm_memx *);
+
+/* interface to PERF process running on PMU */
+int nvkm_pmu_get_perf_data(struct nvkm_pmu *, struct nvkm_pmu_load_data *);
 #endif
diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c
index 5392e07..ec3d3d3 100644
--- a/drm/nouveau/nouveau_debugfs.c
+++ b/drm/nouveau/nouveau_debugfs.c
@@ -28,6 +28,8 @@
  *  Ben Skeggs <bskeggs@redhat.com>
  */
 
+#include <nvkm/subdev/pmu.h>
+
 #include "nouveau_debugfs.h"
 #include "nouveau_drm.h"
 
@@ -43,8 +45,29 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
 	return 0;
 }
 
+static int
+nouveau_debugfs_current_load(struct seq_file *m, void *data)
+{
+	struct drm_info_node *node = (struct drm_info_node *) m->private;
+	struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
+	struct nvkm_pmu *pmu = nvxx_pmu(&drm->device);
+	struct nvkm_pmu_load_data load_data;
+	int ret;
+
+	ret = nvkm_pmu_get_perf_data(pmu, &load_data);
+	if (ret < 0)
+		return ret;
+
+	seq_printf(m, "core: %i\n", load_data.core);
+	seq_printf(m, "mem: %i\n", load_data.mem);
+	seq_printf(m, "video: %i\n", load_data.video);
+	seq_printf(m, "pcie: %i\n", load_data.pcie);
+	return 0;
+}
+
 static struct drm_info_list nouveau_debugfs_list[] = {
 	{ "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
+	{ "current_load", nouveau_debugfs_current_load, 0, NULL },
 };
 #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
 
diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
index d95eb86..ddb36e7 100644
--- a/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -140,6 +140,24 @@ nvkm_pmu_recv(struct work_struct *work)
 		  process, message, data0, data1);
 }
 
+#define get_counter_index(v, i) (((v) & 0xff << ((i)*8)) >> ((i)*8))
+
+int
+nvkm_pmu_get_perf_data(struct nvkm_pmu *pmu, struct nvkm_pmu_load_data *data)
+{
+	int result[2], ret;
+	ret = nvkm_pmu_send(pmu, result, PROC_PERF, PERF_MSG_LOAD, 0, 0);
+
+	if (ret < 0)
+		return ret;
+
+	data->core = get_counter_index(result[0], 0);
+	data->video = get_counter_index(result[0], 1);
+	data->mem = get_counter_index(result[0], 2);
+	data->pcie = get_counter_index(result[0], 3);
+	return 0;
+}
+
 static void
 nvkm_pmu_intr(struct nvkm_subdev *subdev)
 {
-- 
2.6.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] nouveau/debugfs: add interface for current load
       [not found]     ` <1445883189-4407-5-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2015-10-26 18:17       ` Ilia Mirkin
       [not found]         ` <CAKb7UvjGYgXGCG-SjictQS=GvL1QdDYAY6A4nZYHP6=RFMyxeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Ilia Mirkin @ 2015-10-26 18:17 UTC (permalink / raw)
  To: Karol Herbst
  Cc: Karol Herbst,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

On Mon, Oct 26, 2015 at 2:13 PM, Karol Herbst <nouveau@karolherbst.de> wrote:
> From: Karol Herbst <git@karolherbst.de>
>
> ---
>  drm/nouveau/include/nvif/device.h     |  1 +
>  drm/nouveau/include/nvkm/subdev/pmu.h | 10 ++++++++++
>  drm/nouveau/nouveau_debugfs.c         | 23 +++++++++++++++++++++++
>  drm/nouveau/nvkm/subdev/pmu/base.c    | 18 ++++++++++++++++++
>  4 files changed, 52 insertions(+)
>
> diff --git a/drm/nouveau/include/nvif/device.h b/drm/nouveau/include/nvif/device.h
> index 700a9b2..d289fdf 100644
> --- a/drm/nouveau/include/nvif/device.h
> +++ b/drm/nouveau/include/nvif/device.h
> @@ -63,6 +63,7 @@ u64  nvif_device_time(struct nvif_device *);
>  #define nvxx_clk(a) nvxx_device(a)->clk
>  #define nvxx_i2c(a) nvxx_device(a)->i2c
>  #define nvxx_therm(a) nvxx_device(a)->therm
> +#define nvxx_pmu(a) nvxx_device(a)->pmu
>
>  #include <core/device.h>
>  #include <engine/fifo.h>
> diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
> index e61923d..be3c60e 100644
> --- a/drm/nouveau/include/nvkm/subdev/pmu.h
> +++ b/drm/nouveau/include/nvkm/subdev/pmu.h
> @@ -23,6 +23,13 @@ struct nvkm_pmu {
>         } recv;
>  };
>
> +struct nvkm_pmu_load_data {
> +       u8 core;
> +       u8 mem;
> +       u8 video;
> +       u8 pcie;
> +};
> +
>  int nvkm_pmu_send(struct nvkm_pmu *, u32 reply[2], u32 process,
>                   u32 message, u32 data0, u32 data1);
>  void nvkm_pmu_pgob(struct nvkm_pmu *, bool enable);
> @@ -48,4 +55,7 @@ void nvkm_memx_train(struct nvkm_memx *);
>  int  nvkm_memx_train_result(struct nvkm_pmu *, u32 *, int);
>  void nvkm_memx_block(struct nvkm_memx *);
>  void nvkm_memx_unblock(struct nvkm_memx *);
> +
> +/* interface to PERF process running on PMU */
> +int nvkm_pmu_get_perf_data(struct nvkm_pmu *, struct nvkm_pmu_load_data *);
>  #endif
> diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c
> index 5392e07..ec3d3d3 100644
> --- a/drm/nouveau/nouveau_debugfs.c
> +++ b/drm/nouveau/nouveau_debugfs.c
> @@ -28,6 +28,8 @@
>   *  Ben Skeggs <bskeggs@redhat.com>
>   */
>
> +#include <nvkm/subdev/pmu.h>
> +
>  #include "nouveau_debugfs.h"
>  #include "nouveau_drm.h"
>
> @@ -43,8 +45,29 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
>         return 0;
>  }
>
> +static int
> +nouveau_debugfs_current_load(struct seq_file *m, void *data)
> +{
> +       struct drm_info_node *node = (struct drm_info_node *) m->private;
> +       struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
> +       struct nvkm_pmu *pmu = nvxx_pmu(&drm->device);
> +       struct nvkm_pmu_load_data load_data;
> +       int ret;
> +
> +       ret = nvkm_pmu_get_perf_data(pmu, &load_data);
> +       if (ret < 0)
> +               return ret;
> +
> +       seq_printf(m, "core: %i\n", load_data.core);
> +       seq_printf(m, "mem: %i\n", load_data.mem);
> +       seq_printf(m, "video: %i\n", load_data.video);
> +       seq_printf(m, "pcie: %i\n", load_data.pcie);
> +       return 0;
> +}
> +
>  static struct drm_info_list nouveau_debugfs_list[] = {
>         { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
> +       { "current_load", nouveau_debugfs_current_load, 0, NULL },
>  };
>  #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
>
> diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
> index d95eb86..ddb36e7 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/base.c
> +++ b/drm/nouveau/nvkm/subdev/pmu/base.c
> @@ -140,6 +140,24 @@ nvkm_pmu_recv(struct work_struct *work)
>                   process, message, data0, data1);
>  }
>
> +#define get_counter_index(v, i) (((v) & 0xff << ((i)*8)) >> ((i)*8))

Is this the same thing as

(v >> (i*8)) & 0xff

? I can't tell if you're attempting to preserve the sign, but don't
see why you'd want to since it all just becomes a u8 anyways.

> +
> +int
> +nvkm_pmu_get_perf_data(struct nvkm_pmu *pmu, struct nvkm_pmu_load_data *data)
> +{
> +       int result[2], ret;

Given the bit manipulations, sounds like result should be (a) unsigned
and (b) sized.

> +       ret = nvkm_pmu_send(pmu, result, PROC_PERF, PERF_MSG_LOAD, 0, 0);
> +
> +       if (ret < 0)
> +               return ret;
> +
> +       data->core = get_counter_index(result[0], 0);
> +       data->video = get_counter_index(result[0], 1);
> +       data->mem = get_counter_index(result[0], 2);
> +       data->pcie = get_counter_index(result[0], 3);
> +       return 0;
> +}
> +
>  static void
>  nvkm_pmu_intr(struct nvkm_subdev *subdev)
>  {
> --
> 2.6.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] subdev/pmu/fuc: implement perf
       [not found]     ` <1445883189-4407-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2015-10-26 19:19       ` Roy Spliet
  2016-02-14 22:02       ` Martin Peres
  1 sibling, 0 replies; 12+ messages in thread
From: Roy Spliet @ 2015-10-26 19:19 UTC (permalink / raw)
  To: Karol Herbst, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

See my tiny nit-pick below.

Op 26-10-15 om 18:13 schreef Karol Herbst:
> From: Karol Herbst <git@karolherbst.de>
>
> ---
>   drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 788 +++++++++++++++------------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 740 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 740 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 710 ++++++++++++++----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 755 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/os.h         |   4 +
>   drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc     | 148 +++++
>   7 files changed, 2267 insertions(+), 1618 deletions(-)
>
> [snip]
>
> diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> index c8b06cb..53508d9 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> +++ b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> @@ -49,4 +49,8 @@
>   #define I2C__MSG_DATA0_WR08_REG 0:7
>   #define I2C__MSG_DATA1_WR08_VAL 0:7
>   
> +
> +/* PERF: message identifiers */
> +#define PERF_MSG_LOAD 1
> +
>   #endif
> diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> index 38eadf7..69a8f8d 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> +++ b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> @@ -30,6 +30,18 @@ process(PROC_PERF, #perf_init, #perf_recv)
>    * PERF data segment
>    *****************************************************************************/
>   #ifdef INCLUDE_DATA
> +perf_attr_start:
> +// parameters
> +perf_polling_period_us: .b32 100000
> +
> +// engine usage percentage
> +perf_eng_gr:   .b8 0
> +perf_eng_vdec: .b8 0
> +perf_eng_mc:   .b8 0
> +#if NVKM_PPWR_CHIPSET >= GF100
> +perf_eng_pcie: .b8 0
> +#endif
> +.align 4
>   #endif
>   
>   /******************************************************************************
> @@ -46,6 +58,78 @@ process(PROC_PERF, #perf_init, #perf_recv)
>   // $r11 - data1
>   // $r0  - zero
>   perf_recv:
> +	push $r1
> +
> +	imm32($r10, PROC_HOST)
> +	cmp b32 $r14 $r10
> +	bra ne #perf_recv_not_host
> +		cmp b32 $r13 PERF_MSG_LOAD
> +		bra e #perf_load
> +		bra #perf_recv_exit
> +
> +perf_load:
> +			clear b32 $r11
> +			clear b32 $r12
> +#if NVKM_PPWR_CHIPSET >= GF100
> +			ld(b8, $r12, #perf_eng_pcie)
> +			shl b32 $r12 8
> +#endif
> +			ld(b8, $r12, #perf_eng_mc)
> +			shl b32 $r12 8
> +			ld(b8, $r12, #perf_eng_vdec)
> +			shl b32 $r12 8
> +			ld(b8, $r12, #perf_eng_gr)
> +			call(send)
> +			bra #perf_recv_exit
> +
> +perf_recv_not_host:
> +	call(perf_counter_readout)
> +
> +	ld(b32, $r14, #perf_polling_period_us)
> +	call #ticks_from_us
> +	call(timer)
> +
> +perf_recv_exit:
> +	pop $r1
> +	ret
> +
> +
> +// description
> +//
> +// $r15 - current (perf)
> +// $r0  - zero
> +perf_counter_readout:
> +	nv_iord($r14, NV_PPWR_COUNTER_COUNT(0))
> +	div $r14 $r14 0xff
> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(1))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_gr, $r13)
> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(2))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_vdec, $r13)
> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(3))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_mc, $r13)
> +
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(4))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_pcie, $r13)
> +#endif
> +
> +	// reset the counters
> +	imm32($r14, NV_PPWR_COUNTER_COUNT_RESET)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(0), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(1), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(2), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(3), $r14)
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(4), $r14)
> +#endif
> +
>   	ret
>   
>   // description
> @@ -53,5 +137,69 @@ perf_recv:
>   // $r15 - current (perf)
>   // $r0  - zero
>   perf_init:
> +	// set up the total ticks counter first
> +	imm32($r14, NV_PPWR_COUNTER_MODE_ALWAYS)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(0), $r14)
> +
> +	// set up the other counters, with fermi there are more
> +	imm32($r14, NV_PPWR_COUNTER_MODE_IF_NOT_ALL)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(1), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(2), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(3), $r14)
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iowr(NV_PPWR_COUNTER_MODE(4), $r14)
> +#endif
> +
> +	// core load counter
> +	imm32($r14,
> +		  NV_PPWR_COUNTER_SIG_GR_IDLE
> +		| NV_PPWR_COUNTER_SIG_GR_GPC_IDLE
> +		| NV_PPWR_COUNTER_SIG_GR_ROP_IDLE
> +#if NVKM_PPWR_CHIPSET >= GF100
> +		| NV_PPWR_COUNTER_SIG_GR_HUB_IDLE
> +		| NV_PPWR_COUNTER_SIG_PCOPY0_IDLE
> +		| NV_PPWR_COUNTER_SIG_PCOPY1_IDLE
> +#if NVKM_PPWR_CHIPSET >= GK104
> +		| NV_PPWR_COUNTER_SIG_PCOPY2_IDLE
> +#endif
> +#endif
I'm not a big fan of nesting myself if it's not necessary, find it
clearer to keep them separate "if" preprocessor hints.
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(1), $r14)
> +
> +	// video load counter
> +	imm32($r14,
> +		  NV_PPWR_COUNTER_SIG_PVLD_IDLE
> +		| NV_PPWR_COUNTER_SIG_PPDEC_IDLE
> +		| NV_PPWR_COUNTER_SIG_PPPP_IDLE
> +#if NVKM_PPWR_CHIPSET >= GK104
> +		| NV_PPWR_COUNTER_SIG_PVENC
> +#endif
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(2), $r14)
> +
> +	// memory load counter
> +	imm32($r14,
> +#if NVKM_PPWR_CHIPSET >= GF100
> +		  NV_PPWR_COUNTER_SIG_BFB_PART0_REQ
> +#else
> +		  NV_PPWR_COUNTER_SIG_FB_PART0_REQ
> +#endif
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(3), $r14)
> +
> +	// pcie load counter
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	imm32($r14, NV_PPWR_COUNTER_SIG_PCIE)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(4), $r14)
> +#endif
> +
> +	// initial read out
> +	call(perf_counter_readout)
> +
> +	// schedule the next read out
> +	ld(b32, $r14, #perf_polling_period_us)
> +	call #ticks_from_us
> +	call(timer)
> +
>   	ret
>   #endif

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] nouveau/debugfs: add interface for current load
       [not found] ` <1454931798-5406-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2016-02-08 11:43   ` Karol Herbst
  0 siblings, 0 replies; 12+ messages in thread
From: Karol Herbst @ 2016-02-08 11:43 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

should be moved into nvif though

Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
---
 drm/nouveau/include/nvif/device.h     |  1 +
 drm/nouveau/include/nvkm/subdev/pmu.h | 10 ++++++++++
 drm/nouveau/nouveau_debugfs.c         | 24 ++++++++++++++++++++++++
 drm/nouveau/nvkm/subdev/pmu/base.c    | 18 ++++++++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/drm/nouveau/include/nvif/device.h b/drm/nouveau/include/nvif/device.h
index e0ed2f4..cba6d0f 100644
--- a/drm/nouveau/include/nvif/device.h
+++ b/drm/nouveau/include/nvif/device.h
@@ -64,6 +64,7 @@ u64  nvif_device_time(struct nvif_device *);
 #define nvxx_i2c(a) nvxx_device(a)->i2c
 #define nvxx_therm(a) nvxx_device(a)->therm
 #define nvxx_volt(a) nvxx_device(a)->volt
+#define nvxx_pmu(a) nvxx_device(a)->pmu
 
 #include <core/device.h>
 #include <engine/fifo.h>
diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
index e61923d..be3c60e 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -23,6 +23,13 @@ struct nvkm_pmu {
 	} recv;
 };
 
+struct nvkm_pmu_load_data {
+	u8 core;
+	u8 mem;
+	u8 video;
+	u8 pcie;
+};
+
 int nvkm_pmu_send(struct nvkm_pmu *, u32 reply[2], u32 process,
 		  u32 message, u32 data0, u32 data1);
 void nvkm_pmu_pgob(struct nvkm_pmu *, bool enable);
@@ -48,4 +55,7 @@ void nvkm_memx_train(struct nvkm_memx *);
 int  nvkm_memx_train_result(struct nvkm_pmu *, u32 *, int);
 void nvkm_memx_block(struct nvkm_memx *);
 void nvkm_memx_unblock(struct nvkm_memx *);
+
+/* interface to PERF process running on PMU */
+int nvkm_pmu_get_perf_data(struct nvkm_pmu *, struct nvkm_pmu_load_data *);
 #endif
diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c
index 3d0dc19..eefaee7 100644
--- a/drm/nouveau/nouveau_debugfs.c
+++ b/drm/nouveau/nouveau_debugfs.c
@@ -31,6 +31,8 @@
 #include <linux/debugfs.h>
 #include <nvif/class.h>
 #include <nvif/if0001.h>
+#include <nvkm/subdev/pmu.h>
+
 #include "nouveau_debugfs.h"
 #include "nouveau_drm.h"
 
@@ -180,8 +182,30 @@ static const struct file_operations nouveau_pstate_fops = {
 	.write = nouveau_debugfs_pstate_set,
 };
 
+static int
+nouveau_debugfs_current_load(struct seq_file *m, void *data)
+{
+	struct drm_info_node *node = (struct drm_info_node *) m->private;
+	struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
+	struct nvkm_pmu *pmu = nvxx_pmu(&drm->device);
+	struct nvkm_pmu_load_data load_data = { 0 };
+
+	if (!pm_runtime_suspended(drm->dev->dev)) {
+		int ret = nvkm_pmu_get_perf_data(pmu, &load_data);
+		if (ret < 0)
+			return ret;
+	}
+
+	seq_printf(m, "core: %x\n", load_data.core);
+	seq_printf(m, "mem: %x\n", load_data.mem);
+	seq_printf(m, "video: %x\n", load_data.video);
+	seq_printf(m, "pcie: %x\n", load_data.pcie);
+	return 0;
+}
+
 static struct drm_info_list nouveau_debugfs_list[] = {
 	{ "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
+	{ "current_load", nouveau_debugfs_current_load, 0, NULL },
 };
 #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
 
diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
index d95eb86..6594812 100644
--- a/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -140,6 +140,24 @@ nvkm_pmu_recv(struct work_struct *work)
 		  process, message, data0, data1);
 }
 
+#define get_counter_index(v, i) (((v) >> ((i)*8)) & 0xff)
+
+int
+nvkm_pmu_get_perf_data(struct nvkm_pmu *pmu, struct nvkm_pmu_load_data *data)
+{
+	u32 result[2];
+
+	int ret = nvkm_pmu_send(pmu, result, PROC_PERF, PERF_MSG_LOAD, 0, 0);
+	if (ret < 0)
+		return ret;
+
+	data->core = get_counter_index(result[0], 0);
+	data->video = get_counter_index(result[0], 1);
+	data->mem = get_counter_index(result[0], 2);
+	data->pcie = get_counter_index(result[0], 3);
+	return 0;
+}
+
 static void
 nvkm_pmu_intr(struct nvkm_subdev *subdev)
 {
-- 
2.7.1

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] subdev/pmu/fuc: add gk104
       [not found]     ` <1445883189-4407-2-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2016-02-14 21:10       ` Martin Peres
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Peres @ 2016-02-14 21:10 UTC (permalink / raw)
  To: Karol Herbst, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

On 26/10/15 20:13, Karol Herbst wrote:
> From: Karol Herbst <git@karolherbst.de>
>
> we need this, because since kepler there is PCOPY2 and this is needed for the
> counters later in this series
> ---
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4   |   70 +
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 1795 ++++++++++++++++++++++++++
>   drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc   |    1 +
>   drm/nouveau/nvkm/subdev/pmu/gk104.c          |    4 +-
>   drm/nouveau/nvkm/subdev/pmu/gk110.c          |    6 +-
>   5 files changed, 1870 insertions(+), 6 deletions(-)
>   create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4
>   create mode 100644 drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h
>

Reviewed-by: Martin Peres <martin.peres@free.fr>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] pmu/fuc: add macros for pdaemon pwr counters
       [not found]     ` <1445883189-4407-3-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
@ 2016-02-14 21:14       ` Martin Peres
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Peres @ 2016-02-14 21:14 UTC (permalink / raw)
  To: Karol Herbst, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

On 26/10/15 20:13, Karol Herbst wrote:
> From: Karol Herbst <git@karolherbst.de>
>
> ---
>   drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
>
> diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
> index c5ec61f..86b8fd4 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
> +++ b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
> @@ -66,6 +66,29 @@
>   #define NV_PPWR_RFIFO_GET                                                0x04cc
>   #define NV_PPWR_H2D                                                      0x04d0
>   #define NV_PPWR_D2H                                                      0x04dc
> +#define NV_PPWR_COUNTER_MASK(i)                            (0x10 * (i) + 0x0504)
> +#define NV_PPWR_COUNTER_COUNT(i)                           (0x10 * (i) + 0x0508)
> +#define NV_PPWR_COUNTER_COUNT_RESET                                  0x80000000
> +#define NV_PPWR_COUNTER_MODE(i)                            (0x10 * (i) + 0x050c)
> +#define NV_PPWR_COUNTER_MODE_NEVER                                            0
> +#define NV_PPWR_COUNTER_MODE_IF_ALL                                           1
> +#define NV_PPWR_COUNTER_MODE_IF_NOT_ALL                                       2
> +#define NV_PPWR_COUNTER_MODE_ALWAYS                                           3
> +#define NV_PPWR_COUNTER_SIG_GR_IDLE                                  0x00000001
> +#define NV_PPWR_COUNTER_SIG_GR_HUB_IDLE                              0x00000002
> +#define NV_PPWR_COUNTER_SIG_GR_GPC_IDLE                              0x00000004
> +#define NV_PPWR_COUNTER_SIG_GR_ROP_IDLE                              0x00000008
> +#define NV_PPWR_COUNTER_SIG_PVLD_IDLE                                0x00000010
> +#define NV_PPWR_COUNTER_SIG_PPDEC_IDLE                               0x00000020
> +#define NV_PPWR_COUNTER_SIG_PPPP_IDLE                                0x00000040
> +#define NV_PPWR_COUNTER_SIG_BFB_PART0_REQ                            0x00000080
> +#define NV_PPWR_COUNTER_SIG_FB_PART0_REQ                             0x00000100
> +#define NV_PPWR_COUNTER_SIG_PMFB                                     0x00001000
> +#define NV_PPWR_COUNTER_SIG_PVENC                                    0x00020000
> +#define NV_PPWR_COUNTER_SIG_PCOPY0_IDLE                              0x00080000
> +#define NV_PPWR_COUNTER_SIG_PCOPY1_IDLE                              0x00100000
> +#define NV_PPWR_COUNTER_SIG_PCOPY2_IDLE                              0x00200000
> +#define NV_PPWR_COUNTER_SIG_PCIE                                     0x20000000
>   #if NVKM_PPWR_CHIPSET < GK208
>   #define NV_PPWR_DSCRATCH(i)                                   (4 * (i) + 0x05d0)
>   #endif

Why call the signals _IDLE when they are set when the engine is busy and 
cleared when idle? This is why I named the bitfield 
gt215_pdaemon_counter_busy_signals in envytools.

With this fixed:
Reviewed-by: Martin Peres <martin.peres@free.fr>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] subdev/pmu/fuc: implement perf
       [not found]     ` <1445883189-4407-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
  2015-10-26 19:19       ` Roy Spliet
@ 2016-02-14 22:02       ` Martin Peres
  1 sibling, 0 replies; 12+ messages in thread
From: Martin Peres @ 2016-02-14 22:02 UTC (permalink / raw)
  To: Karol Herbst, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Karol Herbst

On 26/10/15 20:13, Karol Herbst wrote:
> From: Karol Herbst <git@karolherbst.de>
>
> ---
>   drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 788 +++++++++++++++------------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 740 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk104.fuc4.h | 740 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 710 ++++++++++++++----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 755 ++++++++++++++-----------
>   drm/nouveau/nvkm/subdev/pmu/fuc/os.h         |   4 +
>   drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc     | 148 +++++
>   7 files changed, 2267 insertions(+), 1618 deletions(-)
>
>
> diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> index c8b06cb..53508d9 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> +++ b/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
> @@ -49,4 +49,8 @@
>   #define I2C__MSG_DATA0_WR08_REG 0:7
>   #define I2C__MSG_DATA1_WR08_VAL 0:7
>   
> +
> +/* PERF: message identifiers */
> +#define PERF_MSG_LOAD 1

Could you document the expected inputs and outputs of this message as a 
comment?

// IN: don't care
// OUT:
// - byte 3: PCIe load (GF100+)
// - byte 2: Memory load
// - byte 1: Video decoding engines' load
// - byte 0: GR load

> +
>   #endif
> diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> index 38eadf7..69a8f8d 100644
> --- a/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> +++ b/drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc
> @@ -30,6 +30,18 @@ process(PROC_PERF, #perf_init, #perf_recv)
>    * PERF data segment
>    *****************************************************************************/
>   #ifdef INCLUDE_DATA
> +perf_attr_start:
> +// parameters
> +perf_polling_period_us: .b32 100000
> +
> +// engine usage percentage

It is a tiny bit misleading to say percentage when you mean per-255. How 
about:

// engine usage (0-255)

> +perf_eng_gr:   .b8 0
> +perf_eng_vdec: .b8 0
> +perf_eng_mc:   .b8 0
> +#if NVKM_PPWR_CHIPSET >= GF100
> +perf_eng_pcie: .b8 0
> +#endif
> +.align 4
>   #endif
>   
>   /******************************************************************************
> @@ -46,6 +58,78 @@ process(PROC_PERF, #perf_init, #perf_recv)
>   // $r11 - data1
>   // $r0  - zero
>   perf_recv:
> +	push $r1
> +
> +	imm32($r10, PROC_HOST)
> +	cmp b32 $r14 $r10
> +	bra ne #perf_recv_not_host
> +		cmp b32 $r13 PERF_MSG_LOAD

Thanks for doing this and not assuming straight away that this is going 
to be the only type of messages you will receive from the host :)

> +		bra e #perf_load
> +		bra #perf_recv_exit
> +
> +perf_load:
> +			clear b32 $r11
> +			clear b32 $r12
> +#if NVKM_PPWR_CHIPSET >= GF100
> +			ld(b8, $r12, #perf_eng_pcie)
> +			shl b32 $r12 8
> +#endif
> +			ld(b8, $r12, #perf_eng_mc)
> +			shl b32 $r12 8
> +			ld(b8, $r12, #perf_eng_vdec)
> +			shl b32 $r12 8
> +			ld(b8, $r12, #perf_eng_gr)

Simple and effective, that's nice :)
> +			call(send)
> +			bra #perf_recv_exit
> +
> +perf_recv_not_host:
> +	call(perf_counter_readout)
> +
> +	ld(b32, $r14, #perf_polling_period_us)
> +	call #ticks_from_us
> +	call(timer)
> +
> +perf_recv_exit:
> +	pop $r1
> +	ret
> +
> +
> +// description
> +//
> +// $r15 - current (perf)
> +// $r0  - zero
> +perf_counter_readout:
> +	nv_iord($r14, NV_PPWR_COUNTER_COUNT(0))
> +	div $r14 $r14 0xff

Not a big fan of the loss in precision. Why do you do that instead of 
what I did here:
https://cgit.freedesktop.org/~mperes/nouveau/tree/nvkm/subdev/pwr/fuc/perf.fuc?h=ppwr_rework&id=27310fa8fdc39e54a3f4383fada96a3562c5a022#n134

With my solution, you get no loss in precision. And you also poll the 
counters faster so it means a greater accuracy. I also miss less cycles.

All in all, could you please reuse my polling function please? :D

> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(1))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_gr, $r13)
> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(2))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_vdec, $r13)
> +
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(3))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_mc, $r13)
> +
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iord($r13, NV_PPWR_COUNTER_COUNT(4))
> +	div $r13 $r13 $r14
> +	st(b8, #perf_eng_pcie, $r13)
> +#endif
> +
> +	// reset the counters
> +	imm32($r14, NV_PPWR_COUNTER_COUNT_RESET)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(0), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(1), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(2), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(3), $r14)
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iowr(NV_PPWR_COUNTER_COUNT(4), $r14)
> +#endif
> +
>   	ret
>   
>   // description
> @@ -53,5 +137,69 @@ perf_recv:
>   // $r15 - current (perf)
>   // $r0  - zero
>   perf_init:
> +	// set up the total ticks counter first
> +	imm32($r14, NV_PPWR_COUNTER_MODE_ALWAYS)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(0), $r14)
> +
> +	// set up the other counters, with fermi there are more
> +	imm32($r14, NV_PPWR_COUNTER_MODE_IF_NOT_ALL)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(1), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(2), $r14)
> +	nv_iowr(NV_PPWR_COUNTER_MODE(3), $r14)
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	nv_iowr(NV_PPWR_COUNTER_MODE(4), $r14)
> +#endif
> +
> +	// core load counter
> +	imm32($r14,
> +		  NV_PPWR_COUNTER_SIG_GR_IDLE
> +		| NV_PPWR_COUNTER_SIG_GR_GPC_IDLE
> +		| NV_PPWR_COUNTER_SIG_GR_ROP_IDLE
> +#if NVKM_PPWR_CHIPSET >= GF100
> +		| NV_PPWR_COUNTER_SIG_GR_HUB_IDLE
> +		| NV_PPWR_COUNTER_SIG_PCOPY0_IDLE
> +		| NV_PPWR_COUNTER_SIG_PCOPY1_IDLE
> +#if NVKM_PPWR_CHIPSET >= GK104
> +		| NV_PPWR_COUNTER_SIG_PCOPY2_IDLE
> +#endif
> +#endif
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(1), $r14)
> +
> +	// video load counter
> +	imm32($r14,
> +		  NV_PPWR_COUNTER_SIG_PVLD_IDLE
> +		| NV_PPWR_COUNTER_SIG_PPDEC_IDLE
> +		| NV_PPWR_COUNTER_SIG_PPPP_IDLE
> +#if NVKM_PPWR_CHIPSET >= GK104
> +		| NV_PPWR_COUNTER_SIG_PVENC
> +#endif
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(2), $r14)
> +
> +	// memory load counter
> +	imm32($r14,
> +#if NVKM_PPWR_CHIPSET >= GF100
> +		  NV_PPWR_COUNTER_SIG_BFB_PART0_REQ
> +#else
> +		  NV_PPWR_COUNTER_SIG_FB_PART0_REQ
> +#endif
> +	)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(3), $r14)
> +
> +	// pcie load counter
> +#if NVKM_PPWR_CHIPSET >= GF100
> +	imm32($r14, NV_PPWR_COUNTER_SIG_PCIE)
> +	nv_iowr(NV_PPWR_COUNTER_MASK(4), $r14)
> +#endif
> +
> +	// initial read out
> +	call(perf_counter_readout)
> +
> +	// schedule the next read out
> +	ld(b32, $r14, #perf_polling_period_us)
> +	call #ticks_from_us
> +	call(timer)
> +
>   	ret
>   #endif

Looks about good, except the polling function!
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] nouveau/debugfs: add interface for current load
       [not found]         ` <CAKb7UvjGYgXGCG-SjictQS=GvL1QdDYAY6A4nZYHP6=RFMyxeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-02-14 22:36           ` Martin Peres
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Peres @ 2016-02-14 22:36 UTC (permalink / raw)
  To: Ilia Mirkin, Karol Herbst
  Cc: Karol Herbst,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

On 26/10/15 20:17, Ilia Mirkin wrote:
> On Mon, Oct 26, 2015 at 2:13 PM, Karol Herbst <nouveau@karolherbst.de> wrote:
>> From: Karol Herbst <git@karolherbst.de>
>>
>> ---
>>   drm/nouveau/include/nvif/device.h     |  1 +
>>   drm/nouveau/include/nvkm/subdev/pmu.h | 10 ++++++++++
>>   drm/nouveau/nouveau_debugfs.c         | 23 +++++++++++++++++++++++
>>   drm/nouveau/nvkm/subdev/pmu/base.c    | 18 ++++++++++++++++++
>>   4 files changed, 52 insertions(+)
>>
>> diff --git a/drm/nouveau/include/nvif/device.h b/drm/nouveau/include/nvif/device.h
>> index 700a9b2..d289fdf 100644
>> --- a/drm/nouveau/include/nvif/device.h
>> +++ b/drm/nouveau/include/nvif/device.h
>> @@ -63,6 +63,7 @@ u64  nvif_device_time(struct nvif_device *);
>>   #define nvxx_clk(a) nvxx_device(a)->clk
>>   #define nvxx_i2c(a) nvxx_device(a)->i2c
>>   #define nvxx_therm(a) nvxx_device(a)->therm
>> +#define nvxx_pmu(a) nvxx_device(a)->pmu
>>
>>   #include <core/device.h>
>>   #include <engine/fifo.h>
>> diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h b/drm/nouveau/include/nvkm/subdev/pmu.h
>> index e61923d..be3c60e 100644
>> --- a/drm/nouveau/include/nvkm/subdev/pmu.h
>> +++ b/drm/nouveau/include/nvkm/subdev/pmu.h
>> @@ -23,6 +23,13 @@ struct nvkm_pmu {
>>          } recv;
>>   };
>>
>> +struct nvkm_pmu_load_data {
>> +       u8 core;
>> +       u8 mem;
>> +       u8 video;
>> +       u8 pcie;
>> +};
>> +
>>   int nvkm_pmu_send(struct nvkm_pmu *, u32 reply[2], u32 process,
>>                    u32 message, u32 data0, u32 data1);
>>   void nvkm_pmu_pgob(struct nvkm_pmu *, bool enable);
>> @@ -48,4 +55,7 @@ void nvkm_memx_train(struct nvkm_memx *);
>>   int  nvkm_memx_train_result(struct nvkm_pmu *, u32 *, int);
>>   void nvkm_memx_block(struct nvkm_memx *);
>>   void nvkm_memx_unblock(struct nvkm_memx *);
>> +
>> +/* interface to PERF process running on PMU */
>> +int nvkm_pmu_get_perf_data(struct nvkm_pmu *, struct nvkm_pmu_load_data *);
>>   #endif
>> diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c
>> index 5392e07..ec3d3d3 100644
>> --- a/drm/nouveau/nouveau_debugfs.c
>> +++ b/drm/nouveau/nouveau_debugfs.c
>> @@ -28,6 +28,8 @@
>>    *  Ben Skeggs <bskeggs@redhat.com>
>>    */
>>
>> +#include <nvkm/subdev/pmu.h>
>> +
>>   #include "nouveau_debugfs.h"
>>   #include "nouveau_drm.h"
>>
>> @@ -43,8 +45,29 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
>>          return 0;
>>   }
>>
>> +static int
>> +nouveau_debugfs_current_load(struct seq_file *m, void *data)
>> +{
>> +       struct drm_info_node *node = (struct drm_info_node *) m->private;
>> +       struct nouveau_drm *drm = nouveau_drm(node->minor->dev);
>> +       struct nvkm_pmu *pmu = nvxx_pmu(&drm->device);
>> +       struct nvkm_pmu_load_data load_data;
>> +       int ret;
>> +
>> +       ret = nvkm_pmu_get_perf_data(pmu, &load_data);
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       seq_printf(m, "core: %i\n", load_data.core);
>> +       seq_printf(m, "mem: %i\n", load_data.mem);
>> +       seq_printf(m, "video: %i\n", load_data.video);
>> +       seq_printf(m, "pcie: %i\n", load_data.pcie);
>> +       return 0;
>> +}
>> +
>>   static struct drm_info_list nouveau_debugfs_list[] = {
>>          { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL },
>> +       { "current_load", nouveau_debugfs_current_load, 0, NULL },
>>   };
>>   #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list)
>>
>> diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c
>> index d95eb86..ddb36e7 100644
>> --- a/drm/nouveau/nvkm/subdev/pmu/base.c
>> +++ b/drm/nouveau/nvkm/subdev/pmu/base.c
>> @@ -140,6 +140,24 @@ nvkm_pmu_recv(struct work_struct *work)
>>                    process, message, data0, data1);
>>   }
>>
>> +#define get_counter_index(v, i) (((v) & 0xff << ((i)*8)) >> ((i)*8))
> Is this the same thing as
>
> (v >> (i*8)) & 0xff
>
> ? I can't tell if you're attempting to preserve the sign, but don't
> see why you'd want to since it all just becomes a u8 anyways.

There is no sign and the values are u8 anyway. So you are right, this is 
what Karol should do.

>
>> +
>> +int
>> +nvkm_pmu_get_perf_data(struct nvkm_pmu *pmu, struct nvkm_pmu_load_data *data)
>> +{
>> +       int result[2], ret;
> Given the bit manipulations, sounds like result should be (a) unsigned
> and (b) sized.

Agreed. u32 is what he needs.

>
>> +       ret = nvkm_pmu_send(pmu, result, PROC_PERF, PERF_MSG_LOAD, 0, 0);
>> +
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       data->core = get_counter_index(result[0], 0);
>> +       data->video = get_counter_index(result[0], 1);
>> +       data->mem = get_counter_index(result[0], 2);
>> +       data->pcie = get_counter_index(result[0], 3);
>> +       return 0;
>> +}
>> +
>>   static void
>>   nvkm_pmu_intr(struct nvkm_subdev *subdev)
>>   {
>> --
>> 2.6.2
>>
>> _______________________________________________
>> Nouveau mailing list
>> Nouveau@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nouveau
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-02-14 22:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26 18:13 [PATCH 0/4] Add pdaemon load counters Karol Herbst
     [not found] ` <1445883189-4407-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2015-10-26 18:13   ` [PATCH 1/4] subdev/pmu/fuc: add gk104 Karol Herbst
     [not found]     ` <1445883189-4407-2-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-14 21:10       ` Martin Peres
2015-10-26 18:13   ` [PATCH 2/4] pmu/fuc: add macros for pdaemon pwr counters Karol Herbst
     [not found]     ` <1445883189-4407-3-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-14 21:14       ` Martin Peres
2015-10-26 18:13   ` [PATCH 3/4] subdev/pmu/fuc: implement perf Karol Herbst
     [not found]     ` <1445883189-4407-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2015-10-26 19:19       ` Roy Spliet
2016-02-14 22:02       ` Martin Peres
2015-10-26 18:13   ` [PATCH 4/4] nouveau/debugfs: add interface for current load Karol Herbst
     [not found]     ` <1445883189-4407-5-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2015-10-26 18:17       ` Ilia Mirkin
     [not found]         ` <CAKb7UvjGYgXGCG-SjictQS=GvL1QdDYAY6A4nZYHP6=RFMyxeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-14 22:36           ` Martin Peres
  -- strict thread matches above, loose matches on Subject: below --
2016-02-08 11:43 [PATCH 0/4] PMU engine counters Karol Herbst
     [not found] ` <1454931798-5406-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-08 11:43   ` [PATCH 4/4] nouveau/debugfs: add interface for current load Karol Herbst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.