forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gp100.c
....@@ -24,6 +24,8 @@
2424 #include "gk104.h"
2525 #include "changk104.h"
2626
27
+#include <subdev/fault.h>
28
+
2729 #include <nvif/class.h>
2830
2931 const struct nvkm_enum
....@@ -50,9 +52,34 @@
5052 {}
5153 };
5254
55
+void
56
+gp100_fifo_intr_fault(struct nvkm_fifo *fifo, int unit)
57
+{
58
+ struct nvkm_device *device = fifo->engine.subdev.device;
59
+ u32 inst = nvkm_rd32(device, 0x002800 + (unit * 0x10));
60
+ u32 valo = nvkm_rd32(device, 0x002804 + (unit * 0x10));
61
+ u32 vahi = nvkm_rd32(device, 0x002808 + (unit * 0x10));
62
+ u32 type = nvkm_rd32(device, 0x00280c + (unit * 0x10));
63
+ struct nvkm_fault_data info;
64
+
65
+ info.inst = (u64)inst << 12;
66
+ info.addr = ((u64)vahi << 32) | valo;
67
+ info.time = 0;
68
+ info.engine = unit;
69
+ info.valid = 1;
70
+ info.gpc = (type & 0x1f000000) >> 24;
71
+ info.hub = (type & 0x00100000) >> 20;
72
+ info.access = (type & 0x00070000) >> 16;
73
+ info.client = (type & 0x00007f00) >> 8;
74
+ info.reason = (type & 0x0000001f);
75
+
76
+ nvkm_fifo_fault(fifo, &info);
77
+}
78
+
5379 static const struct gk104_fifo_func
5480 gp100_fifo = {
55
- .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
81
+ .intr.fault = gp100_fifo_intr_fault,
82
+ .pbdma = &gm200_fifo_pbdma,
5683 .fault.access = gk104_fifo_fault_access,
5784 .fault.engine = gp100_fifo_fault_engine,
5885 .fault.reason = gk104_fifo_fault_reason,