forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c
....@@ -28,7 +28,7 @@
2828 #include <core/gpuobj.h>
2929 #include <subdev/timer.h>
3030
31
-static int
31
+int
3232 gv100_disp_wndw_cnt(struct nvkm_disp *disp, unsigned long *pmask)
3333 {
3434 struct nvkm_device *device = disp->engine.subdev.device;
....@@ -36,7 +36,7 @@
3636 return (nvkm_rd32(device, 0x610074) & 0x03f00000) >> 20;
3737 }
3838
39
-static void
39
+void
4040 gv100_disp_super(struct work_struct *work)
4141 {
4242 struct nv50_disp *disp =
....@@ -101,12 +101,26 @@
101101 u32 stat = nvkm_rd32(device, 0x611020 + (chid * 12));
102102 u32 type = (stat & 0x00007000) >> 12;
103103 u32 mthd = (stat & 0x00000fff) << 2;
104
- u32 data = nvkm_rd32(device, 0x611024 + (chid * 12));
105
- u32 code = nvkm_rd32(device, 0x611028 + (chid * 12));
104
+ const struct nvkm_enum *reason =
105
+ nvkm_enum_find(nv50_disp_intr_error_type, type);
106106
107
- nvkm_error(subdev, "chid %d %08x [type %d mthd %04x] "
108
- "data %08x code %08x\n",
109
- chid, stat, type, mthd, data, code);
107
+ /*TODO: Suspect 33->41 are for WRBK channel exceptions, but we
108
+ * don't support those currently.
109
+ *
110
+ * CORE+WIN CHIDs map directly to the FE_EXCEPT() slots.
111
+ */
112
+ if (chid <= 32) {
113
+ u32 data = nvkm_rd32(device, 0x611024 + (chid * 12));
114
+ u32 code = nvkm_rd32(device, 0x611028 + (chid * 12));
115
+ nvkm_error(subdev, "chid %d stat %08x reason %d [%s] "
116
+ "mthd %04x data %08x code %08x\n",
117
+ chid, stat, type, reason ? reason->name : "",
118
+ mthd, data, code);
119
+ } else {
120
+ nvkm_error(subdev, "chid %d stat %08x reason %d [%s] "
121
+ "mthd %04x\n",
122
+ chid, stat, type, reason ? reason->name : "", mthd);
123
+ }
110124
111125 if (chid < ARRAY_SIZE(disp->chan) && disp->chan[chid]) {
112126 switch (mthd) {
....@@ -140,6 +154,12 @@
140154 */
141155 if (stat & 0x00000008)
142156 stat &= ~0x00000008;
157
+
158
+ if (stat & 0x00000080) {
159
+ u32 error = nvkm_mask(device, 0x611848, 0x00000000, 0x00000000);
160
+ nvkm_warn(subdev, "error %08x\n", error);
161
+ stat &= ~0x00000080;
162
+ }
143163
144164 if (stat & 0x00000100) {
145165 unsigned long wndws = nvkm_rd32(device, 0x611858);
....@@ -257,7 +277,7 @@
257277 }
258278 }
259279
260
-static void
280
+void
261281 gv100_disp_intr(struct nv50_disp *disp)
262282 {
263283 struct nvkm_subdev *subdev = &disp->base.engine.subdev;
....@@ -297,7 +317,7 @@
297317 nvkm_warn(subdev, "intr %08x\n", stat);
298318 }
299319
300
-static void
320
+void
301321 gv100_disp_fini(struct nv50_disp *disp)
302322 {
303323 struct nvkm_device *device = disp->base.engine.subdev.device;