[Nouveau] [Bug 101184] [NVE6] [bisected] Panic on boot with GK106

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101184

--- Comment #9 from S. Gilles  ---
(In reply to Ben Skeggs from comment #6)
> Created attachment 131704 [details] [review]
> test fix
> 
> Can you give this patch a try please?

I built against -mainline just now. Without the patch, I get the panic, and
with the patch, I get no panic.  I'll call that successful.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v2] nv110/exa: update sched codes

2017-06-05 Thread Samuel Pitoiset

Nice work!

See my comments below, and double-check if some of them can be applied 
to the shaders I didn't review yet.


I recommend you to test your work because if one sched code is wrong, 
you are likely going to kill your card and reboot your box. :-)


On 06/03/2017 04:16 PM, Aaryaman Vasishta wrote:

v2: Add missing delays

This patch adds proper delays to maxwell exa shaders. rendercheck tests
seem consistent with/without this patch. I haven't extensively tested
them though.

Trello:
https://trello.com/c/6LPB2EIS/174-update-maxwell-shaders-with-proper-delays

Signed-off-by: Aaryaman Vasishta 
---
  src/shader/exac8nv110.fp  | 10 +-
  src/shader/exac8nv110.fpc | 18 +-
  src/shader/exacanv110.fp  | 10 +-
  src/shader/exacanv110.fpc | 18 +-
  src/shader/exacmnv110.fp  | 10 +-
  src/shader/exacmnv110.fpc | 18 +-
  src/shader/exas8nv110.fp  |  6 +++---
  src/shader/exas8nv110.fpc | 12 ++--
  src/shader/exasanv110.fp  | 10 +-
  src/shader/exasanv110.fpc | 18 +-
  src/shader/exascnv110.fp  |  6 +++---
  src/shader/exascnv110.fpc | 10 +-
  src/shader/videonv110.fp  | 14 +++---
  src/shader/videonv110.fpc | 26 +-
  14 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/src/shader/exac8nv110.fp b/src/shader/exac8nv110.fp
index ce78036..1c4a4f1 100644
--- a/src/shader/exac8nv110.fp
+++ b/src/shader/exac8nv110.fp
@@ -25,23 +25,23 @@ NV110FP_Composite_A8[] = {
  };
  #else
  
-sched (st 0x0) (st 0x0) (st 0x0)

+sched (st 0xf wr 0x0) (st 0xd wr 0x0 wt 0x1) (st 0xf wr 0x0 wt 0x1)
  ipa pass $r0 a[0x7c] 0x0 0x0 0x1
  mufu rcp $r0 $r0
  ipa $r3 a[0x94] $r0 0x0 0x1
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0xf wr 0x1) (st 0xf wr 0x0 rd 0x1 wt 0x3) (st 0xf wr 0x1 wt 0x2)
  ipa $r2 a[0x90] $r0 0x0 0x1
  tex nodep $r1 $r2 0x0 0x1 t2d 0x8
  ipa $r3 a[0x84] $r0 0x0 0x1
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0xf wr 0x2) (st 0xf wr 0x1 wt 0x6) (st 0xf)
  ipa $r2 a[0x80] $r0 0x0 0x1
  tex nodep $r0 $r2 0x0 0x0 t2d 0x8


Out of curiosity, what didn't you add a read-dep-bar on $r2:$r3 here?


  depbar le 0x5 0x0 0x0
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0x6 wt 0x3) (st 0x6) (st 0x1)
  fmul ftz $r3 $r0 $r1
  mov $r2 $r3 0xf


You can stall for only one cycle here, but the 6 cycles on fmul is needed.


  mov $r1 $r3 0xf
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0x6) (st 0xf) (st 0x0)
  mov $r0 $r3 0xf


Same here.


  exit
  #endif
diff --git a/src/shader/exac8nv110.fpc b/src/shader/exac8nv110.fpc
index 4aa1368..46943b7 100644
--- a/src/shader/exac8nv110.fpc
+++ b/src/shader/exac8nv110.fpc
@@ -1,36 +1,36 @@
-0xfc0007e0,
-0x001f8000,
+0xe1a0070f,
+0x003c3c01,
  0xcff7ff00,
  0xe003ff87,
  0x0047,
  0x5080,
  0x4007ff03,
  0xe043ff89,
-0xfc0007e0,
-0x001f8000,
+0x21e0072f,
+0x005cbc03,
  0x0007ff02,
  0xe043ff89,
  0x2ff70201,
  0xc03a0014,
  0x4007ff03,
  0xe043ff88,
-0xfc0007e0,
-0x001f8000,
+0xe5e0074f,
+0x001fbc06,
  0x0007ff02,
  0xe043ff88,
  0x2ff70200,
  0xc03a0004,
  0x3407,
  0xf0f0,
-0xfc0007e0,
-0x001f8000,
+0xfcc01fe6,
+0x001f8400,
  0x00170003,
  0x5c681000,
  0x00370002,
  0x5c980780,
  0x00370001,
  0x5c980780,
-0xfc0007e0,
+0xfde007e6,
  0x001f8000,
  0x0037,
  0x5c980780,
diff --git a/src/shader/exacanv110.fp b/src/shader/exacanv110.fp
index a70d5c5..d7c2867 100644
--- a/src/shader/exacanv110.fp
+++ b/src/shader/exacanv110.fp
@@ -25,23 +25,23 @@ NV110FP_CAComposite[] = {
  };
  #else
  
-sched (st 0x0) (st 0x0) (st 0x0)

+sched (st 0xf wr 0x0) (st 0xd wr 0x0 wt 0x1) (st 0xf wr 0x0 wt 0x1)
  ipa pass $r0 a[0x7c] 0x0 0x0 0x1
  mufu rcp $r0 $r0
  ipa $r3 a[0x94] $r0 0x0 0x1
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0xf wr 0x1) (st 0xf wr 0x0 wt 0x3) (st 0xf wr 0x1 rd 0x2)
  ipa $r2 a[0x90] $r0 0x0 0x1
  tex nodep $r4 $r2 0x0 0x1 t2d 0xf


Please add a read-dep-bar and wait for on the first fmul because $r2:$r3 
are re-used before $r4. Should be safer.



  ipa $r1 a[0x84] $r0 0x0 0x1
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0xf wr 0x2 wt 0x4) (st 0xf wr 0x1 wt 0x6) (st 0xf)
  ipa $r0 a[0x80] $r0 0x0 0x1
  tex nodep $r0 $r0 0x0 0x0 t2d 0xf
  depbar le 0x5 0x0 0x0
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0x1 wt 0x3f) (st 0x1) (st 0x1)
  fmul ftz $r3 $r3 $r7


Why are you waiting all barriers? Only $r3 is needed here.


  fmul ftz $r2 $r2 $r6
  fmul ftz $r1 $r1 $r5
-sched (st 0x0) (st 0x0) (st 0x0)
+sched (st 0x1 wt 0x3) (st 0xf) (st 0x0)
  fmul ftz $r0 $r0 $r4
  exit
  #endif
diff --git a/src/shader/exacanv110.fpc b/src/shader/exacanv110.fpc
index 7c0ca5e..9cad139 100644
--- a/src/shader/exacanv110.fpc
+++ b/src/shader/exacanv110.fpc
@@ -1,36 +1,36 @@
-0xfc0007e0,
-0x001f8000,
+0xe1a0070f,
+0x003c3c01,
  0xcff7ff00,
  0xe003ff87,
  0x0047,
  0x5080,
  0x4007ff03,
  0xe043ff89,
-0xfc0007e0,
-0x001f8000,
+0xe1e0072f,
+0x0008bc03,
  0x0007ff02,
  0xe043ff89,
  0xaff70204,
  

[Nouveau] [PATCH v3 3/7] pmu/fuc: implement GET_SLOTS

2017-06-05 Thread Karol Herbst
Reads out all stored 8 bit slot values. The 0th one being always 0xff.

v3: Add macros documenting the command.

Signed-off-by: Karol Herbst 
---
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 894 ++-
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 840 +
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 776 ---
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 770 +++
 drm/nouveau/nvkm/subdev/pmu/fuc/os.h |  12 +
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc |  29 +-
 6 files changed, 1780 insertions(+), 1541 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h 
b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
index 9ed8e313..2cbdcdff 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[] = {
0x,
0x,
0x46524550,
-   0x08c9,
+   0x094b,
0x0758,
0x,
0x,
@@ -90,8 +90,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x5f433249,
-   0x0d7f,
-   0x0c22,
+   0x0e01,
+   0x0ca4,
0x,
0x,
0x,
@@ -112,8 +112,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x54534554,
-   0x0da8,
-   0x0d81,
+   0x0e2a,
+   0x0e03,
0x,
0x,
0x,
@@ -134,8 +134,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x454c4449,
-   0x0db4,
-   0x0db2,
+   0x0e36,
+   0x0e34,
0x,
0x,
0x,
@@ -1462,477 +1462,543 @@ uint32_t gf100_pmu_code[] = {
 /* 0x0758: perf_recv */
0x4f48a7f1,
0x5453a3f1,
-   0xf406eab8,
-   0x0ef4061b,
-/* 0x0769: perf_recv_not_host */
-   0x8321f51b,
-   0xcc07f107,
+   0xf506eab8,
+   0xf100811b,
+   0xf1a7,
+   0xdab800a3,
+   0x070bf406,
+   0x008b0ef5,
+/* 0x0778: perf_recv_get_slots */
+   0x0cd207f1,
+   0x180003f0,
+   0x04bd000c,
+   0xf108c4b6,
+   0xf00cd107,
+   0x0c180003,
+   0xb604bd00,
+   0x07f108c4,
+   0x03f00cd0,
+   0x000c1800,
+   0xc4b604bd,
+   0xffc5f008,
+   0x0cd607f1,
+   0x180003f0,
+   0x04bd000b,
+   0xf108b4b6,
+   0xf00cd507,
+   0x0b180003,
+   0xb604bd00,
+   0x07f108b4,
+   0x03f00cd4,
+   0x000b1800,
+   0xb4b604bd,
+   0xd307f108,
+   0x0003f00c,
+   0xbd000b18,
+   0x1e0ef404,
+/* 0x07e4: perf_recv_not_host */
+   0x080521f5,
+   0x0ccc07f1,
+   0x980003f0,
+   0x04bd000e,
+   0x022a21f5,
+   0x025621f5,
+/* 0x07ff: perf_recv_host */
+   0xf5070ef4,
+/* 0x0803: perf_recv_exit */
+   0xf8033621,
+/* 0x0805: perf_counter_readout */
+   0xf910f900,
+   0xf930f920,
+   0xf950f940,
+   0xf970f960,
+   0x0817f180,
+   0x0614b605,
+   0xf10011cf,
+   0xb6051827,
+   0x22cf0624,
+   0x2837f100,
+   0x0634b605,
+   0xf10033cf,
+   0xb6053847,
+   0x44cf0644,
+   0x4857f100,
+   0x0654b605,
+   0xf10055cf,
+   0xb6055867,
+   0x66cf0664,
+   0x6877f100,
+   0x0674b605,
+   0xf10077cf,
+   0xb6057887,
+   0x88cf0684,
+   0x00e7f100,
+   0x00e3f100,
+   0x0807f180,
+   0x0604b605,
+   0xbd000ed0,
+   0x1807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x2807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x3807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x4807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x5807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x6807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x7807f104,
+   0x0604b605,
+   0xbd000ed0,
+   0xff11cc04,
+   0xff2c21ff,
+   0x41ff3c31,
+   0x5c51ff4c,
+   0xff6c61ff,
+   0x81ff7c71,
+   0xd007f18c,
+   0x0003f00c,
+   0xbd000200,
+   0xd107f104,
+   0x0003f00c,
+   0xbd000300,
+   0xd207f104,
+   0x0003f00c,
+   0xbd000400,
+   0xd307f104,
+   0x0003f00c,
+   0xbd000500,
+   0xd407f104,
+   0x0003f00c,
+   0xbd000600,
+   0xd507f104,
+   0x0003f00c,
+   0xbd000700,
+   0xd607f104,
+   0x0003f00c,
+   0xbd000800,
+   0xfc80fc04,
+   0xfc60fc70,
+   0xfc40fc50,
+   0xfc20fc30,
+/* 0x094b: perf_init */
+   0xf100f810,
+   0xf3e7,
+   0x07f100e3,
+   0x04b6050c,
+   0x000ed006,
+   0xe7f104bd,
+   0xe3f2,
+   0x1c07f100,
+   0x0604b605,
+   0xbd000ed0,
+   0x2c07f104,
+   0x0604b605,
+   0xbd000ed0,
+   0x3c07f104,
+   

[Nouveau] [PATCH v3 7/7] nouveau/debugfs: add interface for current load

2017-06-05 Thread Karol Herbst
output of the file will be something like that:

core, mem,  vid,  pci
0xfd, 0x15, 0x00, 0xa2

v2: relayout the debugfs file
v3: rework the struct holding load values

Signed-off-by: Karol Herbst 
---
 drm/nouveau/include/nvif/device.h |  1 +
 drm/nouveau/include/nvkm/subdev/pmu.h |  8 
 drm/nouveau/nouveau_debugfs.c | 27 +++
 drm/nouveau/nvkm/subdev/pmu/base.c|  8 
 drm/nouveau/nvkm/subdev/pmu/gf100.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gf119.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gk104.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gk110.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gk208.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gm107.c   |  1 +
 drm/nouveau/nvkm/subdev/pmu/gt215.c   | 18 ++
 drm/nouveau/nvkm/subdev/pmu/priv.h|  3 +++
 12 files changed, 71 insertions(+)

diff --git a/drm/nouveau/include/nvif/device.h 
b/drm/nouveau/include/nvif/device.h
index bcb98171..2b9f725f 100644
--- a/drm/nouveau/include/nvif/device.h
+++ b/drm/nouveau/include/nvif/device.h
@@ -65,6 +65,7 @@ u64  nvif_device_time(struct nvif_device *);
 #define nvxx_iccsense(a) nvxx_device(a)->iccsense
 #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 
 #include 
diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h 
b/drm/nouveau/include/nvkm/subdev/pmu.h
index b29570eb..d450b805 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -35,6 +35,10 @@ enum nvkm_pmu_counter_slot {
NVKM_PMU_COUNTER_SLOT_LAST = 8, // we support up to 8 slots for now
 };
 
+struct nvkm_pmu_counter_data {
+   u8 data[NVKM_PMU_COUNTER_SLOT_LAST];
+};
+
 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);
@@ -63,4 +67,8 @@ 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 *pmu,
+  struct nvkm_pmu_counter_data *data);
 #endif
diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c
index fd64dfdc..24200abb 100644
--- a/drm/nouveau/nouveau_debugfs.c
+++ b/drm/nouveau/nouveau_debugfs.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include "nouveau_debugfs.h"
 #include "nouveau_drv.h"
 
@@ -180,8 +182,33 @@ 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(>client.device);
+   struct nvkm_pmu_counter_data counter_data;
+
+   if (!pm_runtime_suspended(drm->dev->dev)) {
+   int ret = nvkm_pmu_get_perf_data(pmu, _data);
+
+   if (ret < 0)
+   return ret;
+   }
+
+   seq_puts(m, "core, mem,  vid,  pci\n");
+   seq_printf(m, "0x%2.2x, 0x%2.2x, 0x%2.2x, 0x%2.2x\n",
+  counter_data.data[NVKM_PMU_COUNTER_SLOT_CORE],
+  counter_data.data[NVKM_PMU_COUNTER_SLOT_MEMORY],
+  counter_data.data[NVKM_PMU_COUNTER_SLOT_VIDEO],
+  counter_data.data[NVKM_PMU_COUNTER_SLOT_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 3306f9fe..ed525f30 100644
--- a/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -49,6 +49,14 @@ nvkm_pmu_send(struct nvkm_pmu *pmu, u32 reply[2],
return pmu->func->send(pmu, reply, process, message, data0, data1);
 }
 
+int
+nvkm_pmu_get_perf_data(struct nvkm_pmu *pmu, struct nvkm_pmu_counter_data 
*data)
+{
+   if (!pmu || !pmu->func->get_perf_data)
+   return -ENODEV;
+   return pmu->func->get_perf_data(pmu, data);
+}
+
 static void
 nvkm_pmu_intr(struct nvkm_subdev *subdev)
 {
diff --git a/drm/nouveau/nvkm/subdev/pmu/gf100.c 
b/drm/nouveau/nvkm/subdev/pmu/gf100.c
index 14c3dd26..1c4986cb 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gf100.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gf100.c
@@ -37,6 +37,7 @@ gf100_pmu = {
.intr = gt215_pmu_intr,
.send = gt215_pmu_send,
.recv = gt215_pmu_recv,
+   .get_perf_data = gt215_pmu_get_perf_data,
 };
 
 int
diff --git 

[Nouveau] [PATCH v3 4/7] pmu/fuc: implement SET_SLOT

2017-06-05 Thread Karol Herbst
Interface to set the PMU counter mask of a specific slot.

v3: Add macros documenting the command.

Signed-off-by: Karol Herbst 
---
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 889 ++-
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 825 -
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 245 
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 763 +++
 drm/nouveau/nvkm/subdev/pmu/fuc/os.h |   4 +
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc |   9 +
 6 files changed, 1376 insertions(+), 1359 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h 
b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
index 2cbdcdff..0838d503 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[] = {
0x,
0x,
0x46524550,
-   0x094b,
+   0x0965,
0x0758,
0x,
0x,
@@ -90,8 +90,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x5f433249,
-   0x0e01,
-   0x0ca4,
+   0x0e1b,
+   0x0cbe,
0x,
0x,
0x,
@@ -112,8 +112,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x54534554,
-   0x0e2a,
-   0x0e03,
+   0x0e44,
+   0x0e1d,
0x,
0x,
0x,
@@ -134,8 +134,8 @@ uint32_t gf100_pmu_data[] = {
0x,
0x,
0x454c4449,
-   0x0e36,
-   0x0e34,
+   0x0e50,
+   0x0e4e,
0x,
0x,
0x,
@@ -1463,518 +1463,519 @@ uint32_t gf100_pmu_code[] = {
0x4f48a7f1,
0x5453a3f1,
0xf506eab8,
-   0xf100811b,
+   0xf1009b1b,
0xf1a7,
0xdab800a3,
-   0x070bf406,
-   0x008b0ef5,
-/* 0x0778: perf_recv_get_slots */
-   0x0cd207f1,
+   0x140bf406,
+   0x0002a7f1,
+   0xb800a3f0,
+   0x0bf406da,
+   0x980ef573,
+/* 0x0785: perf_recv_get_slots */
+   0xd207f100,
+   0x0003f00c,
+   0xbd000c18,
+   0x08c4b604,
+   0x0cd107f1,
0x180003f0,
0x04bd000c,
0xf108c4b6,
-   0xf00cd107,
+   0xf00cd007,
0x0c180003,
0xb604bd00,
-   0x07f108c4,
-   0x03f00cd0,
-   0x000c1800,
-   0xc4b604bd,
-   0xffc5f008,
-   0x0cd607f1,
+   0xc5f008c4,
+   0xd607f1ff,
+   0x0003f00c,
+   0xbd000b18,
+   0x08b4b604,
+   0x0cd507f1,
0x180003f0,
0x04bd000b,
0xf108b4b6,
-   0xf00cd507,
+   0xf00cd407,
0x0b180003,
0xb604bd00,
0x07f108b4,
-   0x03f00cd4,
+   0x03f00cd3,
0x000b1800,
-   0xb4b604bd,
-   0xd307f108,
-   0x0003f00c,
-   0xbd000b18,
-   0x1e0ef404,
-/* 0x07e4: perf_recv_not_host */
-   0x080521f5,
-   0x0ccc07f1,
-   0x980003f0,
+   0x0ef404bd,
+/* 0x07f1: perf_recv_set_slot */
+   0x10c0f02b,
+   0x0504c0b7,
+   0xf400cbd0,
+/* 0x07fe: perf_recv_not_host */
+   0x21f5220e,
+   0x07f1081f,
+   0x03f00ccc,
+   0x000e9800,
+   0x21f504bd,
+   0x21f5022a,
+   0x0ef40256,
+/* 0x0819: perf_recv_host */
+   0x3621f507,
+/* 0x081d: perf_recv_exit */
+/* 0x081f: perf_counter_readout */
+   0xf900f803,
+   0xf920f910,
+   0xf940f930,
+   0xf960f950,
+   0xf180f970,
+   0xb6050817,
+   0x11cf0614,
+   0x1827f100,
+   0x0624b605,
+   0xf10022cf,
+   0xb6052837,
+   0x33cf0634,
+   0x3847f100,
+   0x0644b605,
+   0xf10044cf,
+   0xb6054857,
+   0x55cf0654,
+   0x5867f100,
+   0x0664b605,
+   0xf10066cf,
+   0xb6056877,
+   0x77cf0674,
+   0x7887f100,
+   0x0684b605,
+   0xf10088cf,
+   0xf1e7,
+   0xf18000e3,
+   0xb6050807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6051807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6052807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6053807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6054807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6055807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6056807,
+   0x0ed00604,
+   0xf104bd00,
+   0xb6057807,
+   0x0ed00604,
+   0xcc04bd00,
+   0x2111,
+   0x3c31ff2c,
+   0xff4c41ff,
+   0x61ff5c51,
+   0x7c71ff6c,
+   0xf18c81ff,
+   0xf00cd007,
+   0x0203,
+   0xf104bd00,
+   0xf00cd107,
+   0x0303,
+   0xf104bd00,
+   0xf00cd207,
+   0x0403,
+   0xf104bd00,
+   0xf00cd307,
+   0x0503,
+   0xf104bd00,
+   0xf00cd407,
+   0x0603,
+   0xf104bd00,
+   0xf00cd507,
+  

[Nouveau] [PATCH v3 5/7] pmu: add counter_slots field

2017-06-05 Thread Karol Herbst
v3: seperated change into own commit

Signed-off-by: Karol Herbst 
---
 drm/nouveau/nvkm/subdev/pmu/gf100.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gf119.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gk104.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gk110.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gk208.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gm107.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/gt215.c | 1 +
 drm/nouveau/nvkm/subdev/pmu/priv.h  | 2 ++
 8 files changed, 9 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/pmu/gf100.c 
b/drm/nouveau/nvkm/subdev/pmu/gf100.c
index 0e36d4cb..14c3dd26 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gf100.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gf100.c
@@ -30,6 +30,7 @@ gf100_pmu = {
.code.size = sizeof(gf100_pmu_code),
.data.data = gf100_pmu_data,
.data.size = sizeof(gf100_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gf119.c 
b/drm/nouveau/nvkm/subdev/pmu/gf119.c
index 0e4ba424..9cf0279c 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gf119.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gf119.c
@@ -30,6 +30,7 @@ gf119_pmu = {
.code.size = sizeof(gf119_pmu_code),
.data.data = gf119_pmu_data,
.data.size = sizeof(gf119_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk104.c 
b/drm/nouveau/nvkm/subdev/pmu/gk104.c
index 2ad858d8..cbf1d30d 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gk104.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gk104.c
@@ -109,6 +109,7 @@ gk104_pmu = {
.code.size = sizeof(gk104_pmu_code),
.data.data = gk104_pmu_data,
.data.size = sizeof(gk104_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk110.c 
b/drm/nouveau/nvkm/subdev/pmu/gk110.c
index fc4b8ecf..f7ea4975 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gk110.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gk110.c
@@ -88,6 +88,7 @@ gk110_pmu = {
.code.size = sizeof(gk110_pmu_code),
.data.data = gk110_pmu_data,
.data.size = sizeof(gk110_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk208.c 
b/drm/nouveau/nvkm/subdev/pmu/gk208.c
index e9a91277..252c3c1f 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gk208.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gk208.c
@@ -30,6 +30,7 @@ gk208_pmu = {
.code.size = sizeof(gk208_pmu_code),
.data.data = gk208_pmu_data,
.data.size = sizeof(gk208_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gm107.c 
b/drm/nouveau/nvkm/subdev/pmu/gm107.c
index 9a248ed7..b2917ec9 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gm107.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gm107.c
@@ -32,6 +32,7 @@ gm107_pmu = {
.code.size = sizeof(gm107_pmu_code),
.data.data = gm107_pmu_data,
.data.size = sizeof(gm107_pmu_data),
+   .counter_slots = 8,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/gt215.c 
b/drm/nouveau/nvkm/subdev/pmu/gt215.c
index 90d428b3..4bead2b7 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gt215.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gt215.c
@@ -241,6 +241,7 @@ gt215_pmu = {
.code.size = sizeof(gt215_pmu_code),
.data.data = gt215_pmu_data,
.data.size = sizeof(gt215_pmu_data),
+   .counter_slots = 4,
.reset = gt215_pmu_reset,
.init = gt215_pmu_init,
.fini = gt215_pmu_fini,
diff --git a/drm/nouveau/nvkm/subdev/pmu/priv.h 
b/drm/nouveau/nvkm/subdev/pmu/priv.h
index 096cba06..b66629bc 100644
--- a/drm/nouveau/nvkm/subdev/pmu/priv.h
+++ b/drm/nouveau/nvkm/subdev/pmu/priv.h
@@ -20,6 +20,8 @@ struct nvkm_pmu_func {
u32  size;
} data;
 
+   uint8_t counter_slots;
+
void (*reset)(struct nvkm_pmu *);
int (*init)(struct nvkm_pmu *);
void (*fini)(struct nvkm_pmu *);
-- 
2.13.0

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


[Nouveau] [PATCH v3 0/7] PMU engine counters

2017-06-05 Thread Karol Herbst
I think I am done reworking the series and getting to a point where I think
it is basically finished. The configuration of the slots could be improved
later on when working on dynamic reclocking, but for now it's good enough to
report the current GPU utilization to userspace.

Patches 1-4 imeplement PMU commands to setup and readout the counters.
Patches 5-6 lets Nouveau make use of 1-4.
Patch 7 adds a debugfs file to readout basic GPU loads.

In a follow up one could write a nice NVIF based interface for readoung out
those values to provide them through GALLIUM_HUD.

This feature is required to implement proper dynamic reclocking on GT215 and
newer. On pre GT215 GPUs there is also PCOUNTERS, but this is ugly so that I
only focus on dynamic reclocking starting with GT215 for now.

Karol Herbst (7):
  pmu/fuc: add macros for pmu engine counters
  pmu/fuc: read out counters and store them
  pmu/fuc: implement GET_SLOTS
  pmu/fuc: implement SET_SLOT
  pmu: add counter_slots field
  pmu: setup counters
  nouveau/debugfs: add interface for current load

 drm/nouveau/include/nvif/device.h|   1 +
 drm/nouveau/include/nvkm/subdev/pmu.h|  17 +
 drm/nouveau/nouveau_debugfs.c|  27 +
 drm/nouveau/nvkm/subdev/pmu/base.c   |   8 +
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 838 ---
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 780 +++--
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 732 +--
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 736 +--
 drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc   |   8 +
 drm/nouveau/nvkm/subdev/pmu/fuc/os.h |  16 +
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc | 156 +
 drm/nouveau/nvkm/subdev/pmu/gf100.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gf119.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gk104.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gk110.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gk208.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gm107.c  |   2 +
 drm/nouveau/nvkm/subdev/pmu/gt215.c  |  62 ++
 drm/nouveau/nvkm/subdev/pmu/priv.h   |   5 +
 19 files changed, 2137 insertions(+), 1261 deletions(-)

-- 
2.13.0

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


[Nouveau] [PATCH v3 2/7] pmu/fuc: read out counters and store them

2017-06-05 Thread Karol Herbst
The counter values are read out periodically and divided by the total
amount of ticks divided by 255 to have nice 8 bit values. A higher
precision won't be needed. This way we can have simple PMU-host
interfaces.

The polling is designed in such a way so that we can change the polling
period later if we need it.

Signed-off-by: Karol Herbst 
---
 drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h | 821 +++
 drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h | 763 ++---
 drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h | 711 ---
 drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h | 757 ++--
 drm/nouveau/nvkm/subdev/pmu/fuc/perf.fuc | 120 
 5 files changed, 1826 insertions(+), 1346 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h 
b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
index 0bcf0b30..9ed8e313 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
@@ -1,4 +1,4 @@
-static uint32_t gf100_pmu_data[] = {
+uint32_t gf100_pmu_data[] = {
 /* 0x: proc_kern */
0x52544e49,
0x,
@@ -68,7 +68,7 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
0x46524550,
-   0x075a,
+   0x08c9,
0x0758,
0x,
0x,
@@ -90,8 +90,8 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
0x5f433249,
-   0x0b8a,
-   0x0a2d,
+   0x0d7f,
+   0x0c22,
0x,
0x,
0x,
@@ -112,8 +112,8 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
0x54534554,
-   0x0bb3,
-   0x0b8c,
+   0x0da8,
+   0x0d81,
0x,
0x,
0x,
@@ -134,8 +134,8 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
0x454c4449,
-   0x0bbf,
-   0x0bbd,
+   0x0db4,
+   0x0db2,
0x,
0x,
0x,
@@ -834,7 +834,18 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
 /* 0x0ccc: memx_train_tail */
-/* 0x0ccc: i2c_scl_map */
+/* 0x0ccc: perf_polling_period_us */
+   0x000186a0,
+/* 0x0cd0: perf_slot1 */
+/* 0x0cd1: perf_slot2 */
+/* 0x0cd2: perf_slot3 */
+/* 0x0cd3: perf_slot4 */
+   0x,
+/* 0x0cd4: perf_slot5 */
+/* 0x0cd5: perf_slot6 */
+/* 0x0cd6: perf_slot7 */
+   0x,
+/* 0x0cd8: i2c_scl_map */
0x1000,
0x4000,
0x0001,
@@ -845,7 +856,7 @@ static uint32_t gf100_pmu_data[] = {
0x0100,
0x0400,
0x1000,
-/* 0x0cf4: i2c_sda_map */
+/* 0x0d00: i2c_sda_map */
0x2000,
0x8000,
0x0002,
@@ -856,7 +867,7 @@ static uint32_t gf100_pmu_data[] = {
0x0200,
0x0800,
0x2000,
-/* 0x0d1c: i2c_ctrl */
+/* 0x0d28: i2c_ctrl */
0xe138,
0xe150,
0xe168,
@@ -911,12 +922,9 @@ static uint32_t gf100_pmu_data[] = {
0x,
0x,
0x,
-   0x,
-   0x,
-   0x,
 };
 
-static uint32_t gf100_pmu_code[] = {
+uint32_t gf100_pmu_code[] = {
0x03920ef5,
 /* 0x0004: rd32 */
0x07a007f1,
@@ -1452,412 +1460,479 @@ static uint32_t gf100_pmu_code[] = {
 /* 0x0756: memx_init */
0x00f800f8,
 /* 0x0758: perf_recv */
-/* 0x075a: perf_init */
-   0x00f800f8,
-/* 0x075c: i2c_drive_scl */
-   0xf40036b0,
-   0x07f1110b,
-   0x04b607e0,
-   0x0001d006,
-   0x00f804bd,
-/* 0x0770: i2c_drive_scl_lo */
-   0x07e407f1,
-   0xd00604b6,
-   0x04bd0001,
-/* 0x077e: i2c_drive_sda */
-   0x36b000f8,
-   0x110bf400,
-   0x07e007f1,
-   0xd00604b6,
-   0x04bd0002,
-/* 0x0792: i2c_drive_sda_lo */
-   0x07f100f8,
-   0x04b607e4,
-   0x0002d006,
-   0x00f804bd,
-/* 0x07a0: i2c_sense_scl */
-   0xf10132f4,
-   0xb607c437,
-   0x33cf0634,
-   0x0431fd00,
-   0xf4060bf4,
-/* 0x07b6: i2c_sense_scl_done */
-   0x00f80131,
-/* 0x07b8: i2c_sense_sda */
-   0xf10132f4,
-   0xb607c437,
+   0x4f48a7f1,
+   0x5453a3f1,
+   0xf406eab8,
+   0x0ef4061b,
+/* 0x0769: perf_recv_not_host */
+   0x8321f51b,
+   0xcc07f107,
+   0x0003f00c,
+   0xbd000e98,
+   0x2a21f504,
+   0x5621f502,
+/* 0x0781: perf_recv_exit */
+/* 0x0783: perf_counter_readout */
+   0xf900f802,
+   0xf920f910,
+   0xf940f930,
+   0xf960f950,
+   0xf180f970,
+   0xb6050817,
+   0x11cf0614,
+   0x1827f100,
+   0x0624b605,
+   0xf10022cf,
+   0xb6052837,
0x33cf0634,
-   0x0432fd00,
-   0xf4060bf4,
-/* 0x07ce: i2c_sense_sda_done */
-   0x00f80131,
-/* 

[Nouveau] [PATCH v3 6/7] pmu: setup counters

2017-06-05 Thread Karol Herbst
Generally following Nvidia here, but being more focused on the load groups.

Signed-off-by: Karol Herbst 
---
 drm/nouveau/include/nvkm/subdev/pmu.h |  9 
 drm/nouveau/nvkm/subdev/pmu/gt215.c   | 43 +++
 2 files changed, 52 insertions(+)

diff --git a/drm/nouveau/include/nvkm/subdev/pmu.h 
b/drm/nouveau/include/nvkm/subdev/pmu.h
index e7f04732..b29570eb 100644
--- a/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -26,6 +26,15 @@ struct nvkm_pmu {
} recv;
 };
 
+enum nvkm_pmu_counter_slot {
+   NVKM_PMU_COUNTER_SLOT_TOTAL = 0,
+   NVKM_PMU_COUNTER_SLOT_CORE = 1,
+   NVKM_PMU_COUNTER_SLOT_MEMORY = 2,
+   NVKM_PMU_COUNTER_SLOT_VIDEO = 3,
+   NVKM_PMU_COUNTER_SLOT_PCIE = 4,
+   NVKM_PMU_COUNTER_SLOT_LAST = 8, // we support up to 8 slots for now
+};
+
 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);
diff --git a/drm/nouveau/nvkm/subdev/pmu/gt215.c 
b/drm/nouveau/nvkm/subdev/pmu/gt215.c
index 4bead2b7..b7053cf7 100644
--- a/drm/nouveau/nvkm/subdev/pmu/gt215.c
+++ b/drm/nouveau/nvkm/subdev/pmu/gt215.c
@@ -26,6 +26,48 @@
 
 #include 
 
+static void
+gt215_setup_pmu_counters(struct nvkm_pmu *pmu)
+{
+   struct nvkm_device *device = pmu->subdev.device;
+   u32 core_mask = 0;
+   u32 video_mask = 0;
+   u32 memory_mask = 0;
+
+   if (nvkm_device_engine(device, NVKM_ENGINE_GR))
+   core_mask |= 0x0001;
+   if (nvkm_device_engine(device, NVKM_ENGINE_CE0))
+   core_mask |= 0x0008;
+   if (nvkm_device_engine(device, NVKM_ENGINE_CE1))
+   core_mask |= 0x0010;
+   if (nvkm_device_engine(device, NVKM_ENGINE_CE2))
+   core_mask |= 0x0020;
+
+   if (nvkm_device_engine(device, NVKM_ENGINE_MSVLD))
+   video_mask |= 0x0010;
+   if (nvkm_device_engine(device, NVKM_ENGINE_MSPDEC))
+   video_mask |= 0x0020;
+   if (nvkm_device_engine(device, NVKM_ENGINE_MSPPP))
+   video_mask |= 0x0040;
+   if (nvkm_device_engine(device, NVKM_ENGINE_NVENC0))
+   video_mask |= 0x0002;
+
+   if (device->chipset < 0xc0)
+   memory_mask = 0x100;
+   else
+   memory_mask = 0x80;
+
+   nvkm_pmu_send(pmu, NULL, PROC_PERF, PERF_MSG_SET_SLOT,
+ NVKM_PMU_COUNTER_SLOT_CORE, core_mask);
+   nvkm_pmu_send(pmu, NULL, PROC_PERF, PERF_MSG_SET_SLOT,
+ NVKM_PMU_COUNTER_SLOT_VIDEO, video_mask);
+   nvkm_pmu_send(pmu, NULL, PROC_PERF, PERF_MSG_SET_SLOT,
+ NVKM_PMU_COUNTER_SLOT_MEMORY, memory_mask);
+   if (pmu->func->counter_slots >= NVKM_PMU_COUNTER_SLOT_PCIE)
+   nvkm_pmu_send(pmu, NULL, PROC_PERF, PERF_MSG_SET_SLOT,
+ NVKM_PMU_COUNTER_SLOT_PCIE, 0x2000);
+}
+
 int
 gt215_pmu_send(struct nvkm_pmu *pmu, u32 reply[2],
   u32 process, u32 message, u32 data0, u32 data1)
@@ -232,6 +274,7 @@ gt215_pmu_init(struct nvkm_pmu *pmu)
pmu->recv.size = nvkm_rd32(device, 0x10a4dc) >> 16;
 
nvkm_wr32(device, 0x10a010, 0x00e0);
+   gt215_setup_pmu_counters(pmu);
return 0;
 }
 
-- 
2.13.0

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


[Nouveau] [PATCH v3 1/7] pmu/fuc: add macros for pmu engine counters

2017-06-05 Thread Karol Herbst
v2: removed definitions we won't need anymore
v3: rename IF_NOT_ALL to IF_ANY

Signed-off-by: Karol Herbst 
Reviewed-by: Martin Peres 
---
 drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc | 8 
 1 file changed, 8 insertions(+)

diff --git a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc 
b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
index 3737bd27..d14f2771 100644
--- a/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
+++ b/drm/nouveau/nvkm/subdev/pmu/fuc/macros.fuc
@@ -65,6 +65,14 @@
 #define NV_PPWR_RFIFO_GET0x04cc
 #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  0x8000
+#define NV_PPWR_COUNTER_MODE(i)(0x10 * (i) + 
0x050c)
+#define NV_PPWR_COUNTER_MODE_NEVER0
+#define NV_PPWR_COUNTER_MODE_IF_ALL   1
+#define NV_PPWR_COUNTER_MODE_IF_ANY   2
+#define NV_PPWR_COUNTER_MODE_ALWAYS   3
 #if NVKM_PPWR_CHIPSET < GK208
 #define NV_PPWR_DSCRATCH(i)   (4 * (i) + 
0x05d0)
 #endif
-- 
2.13.0

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


[Nouveau] [Bug 101184] [NVE6] [bisected] Panic on boot with GK106

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101184

Karol Herbst  changed:

   What|Removed |Added

 CC||mrbloo...@hotmail.com

--- Comment #8 from Karol Herbst  ---
*** Bug 101273 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101273] [NV108] Random kernel panic

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101273

Karol Herbst  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #5 from Karol Herbst  ---
it's the same issue others have as well

*** This bug has been marked as a duplicate of bug 101184 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101184] [NVE6] [bisected] Panic on boot with GK106

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101184

--- Comment #7 from Karol Herbst  ---
(In reply to Ben Skeggs from comment #6)
> Created attachment 131704 [details] [review]
> test fix
> 
> Can you give this patch a try please?
> 
> I'm not 100% convinced this is the issue here, but I'd like to rule it
> in/out.  I have identical hardware to a couple of the other reporters of
> this issue, but have been completely unable to reproduce for unknown reasons.

I can reproduce the issue and I never got the crash with this patch, but I also
only tried a few times. Maybe if you ask others with that issue to try it out
you get enough confirmations?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101273] [NV108] Random kernel panic

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101273

--- Comment #4 from mrbloo...@hotmail.com ---
Yes, 4.11.2 works. I just tested it myself and another user also reported[0]
that it works for them.

[0] https://bbs.archlinux.org/viewtopic.php?pid=1715603#p1715603

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101220] xorg-server-1.19.3 crashes when trying to enable HDMI output

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101220

--- Comment #14 from Pacho Ramos  ---
(In reply to Pacho Ramos from comment #7)
[...]
> (additionally, I don't know why on kernel 4.12-rc2 my touchpad stops to
> move... it clicks but doesn't move... but that is probably a different bug
> :( )

This was indeed a different bug that got fixed in rc4 :)... but nouveau still
keeps failing in the same way with rc4 :(, do you need updated logs with that
kernel? (they seem quite similar though) Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101273] [NV108] Random kernel panic

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101273

--- Comment #3 from Karol Herbst  ---
I think on the 4.11 kernel tree it is triggered by this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.11.3=2138faf017517acf837816101f778d5c9cda37ef

could you verify that linux 4.11.2 works?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [Bug 101184] [NVE6] [bisected] Panic on boot with GK106

2017-06-05 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101184

--- Comment #6 from Ben Skeggs  ---
Created attachment 131704
  --> https://bugs.freedesktop.org/attachment.cgi?id=131704=edit
test fix

Can you give this patch a try please?

I'm not 100% convinced this is the issue here, but I'd like to rule it in/out. 
I have identical hardware to a couple of the other reporters of this issue, but
have been completely unable to reproduce for unknown reasons.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau