forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gm107.c
....@@ -25,6 +25,7 @@
2525 #include "changk104.h"
2626
2727 #include <core/gpuobj.h>
28
+#include <subdev/fault.h>
2829
2930 #include <nvif/class.h>
3031
....@@ -41,6 +42,7 @@
4142 .size = 8,
4243 .cgrp = gk110_fifo_runlist_cgrp,
4344 .chan = gm107_fifo_runlist_chan,
45
+ .commit = gk104_fifo_runlist_commit,
4446 };
4547
4648 const struct nvkm_enum
....@@ -66,9 +68,34 @@
6668 {}
6769 };
6870
71
+void
72
+gm107_fifo_intr_fault(struct nvkm_fifo *fifo, int unit)
73
+{
74
+ struct nvkm_device *device = fifo->engine.subdev.device;
75
+ u32 inst = nvkm_rd32(device, 0x002800 + (unit * 0x10));
76
+ u32 valo = nvkm_rd32(device, 0x002804 + (unit * 0x10));
77
+ u32 vahi = nvkm_rd32(device, 0x002808 + (unit * 0x10));
78
+ u32 type = nvkm_rd32(device, 0x00280c + (unit * 0x10));
79
+ struct nvkm_fault_data info;
80
+
81
+ info.inst = (u64)inst << 12;
82
+ info.addr = ((u64)vahi << 32) | valo;
83
+ info.time = 0;
84
+ info.engine = unit;
85
+ info.valid = 1;
86
+ info.gpc = (type & 0x1f000000) >> 24;
87
+ info.client = (type & 0x00003f00) >> 8;
88
+ info.access = (type & 0x00000080) >> 7;
89
+ info.hub = (type & 0x00000040) >> 6;
90
+ info.reason = (type & 0x0000000f);
91
+
92
+ nvkm_fifo_fault(fifo, &info);
93
+}
94
+
6995 static const struct gk104_fifo_func
7096 gm107_fifo = {
71
- .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
97
+ .intr.fault = gm107_fifo_intr_fault,
98
+ .pbdma = &gk208_fifo_pbdma,
7299 .fault.access = gk104_fifo_fault_access,
73100 .fault.engine = gm107_fifo_fault_engine,
74101 .fault.reason = gk104_fifo_fault_reason,