forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
....@@ -1,4 +1,4 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
1
+/* SPDX-License-Identifier: MIT */
22 #ifndef __GK104_FIFO_H__
33 #define __GK104_FIFO_H__
44 #define gk104_fifo(p) container_of((p), struct gk104_fifo, base)
....@@ -45,7 +45,15 @@
4545 };
4646
4747 struct gk104_fifo_func {
48
- void (*init_pbdma_timeout)(struct gk104_fifo *);
48
+ struct {
49
+ void (*fault)(struct nvkm_fifo *, int unit);
50
+ } intr;
51
+
52
+ const struct gk104_fifo_pbdma_func {
53
+ int (*nr)(struct gk104_fifo *);
54
+ void (*init)(struct gk104_fifo *);
55
+ void (*init_timeout)(struct gk104_fifo *);
56
+ } *pbdma;
4957
5058 struct {
5159 const struct nvkm_enum *access;
....@@ -61,6 +69,8 @@
6169 struct nvkm_memory *, u32 offset);
6270 void (*chan)(struct gk104_fifo_chan *,
6371 struct nvkm_memory *, u32 offset);
72
+ void (*commit)(struct gk104_fifo *, int runl,
73
+ struct nvkm_memory *, int entries);
6474 } *runlist;
6575
6676 struct gk104_fifo_user_user {
....@@ -81,8 +91,11 @@
8191 int index, int nr, struct nvkm_fifo **);
8292 void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *);
8393 void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *);
84
-void gk104_fifo_runlist_commit(struct gk104_fifo *, int runl);
94
+void gk104_fifo_runlist_update(struct gk104_fifo *, int runl);
8595
96
+extern const struct gk104_fifo_pbdma_func gk104_fifo_pbdma;
97
+int gk104_fifo_pbdma_nr(struct gk104_fifo *);
98
+void gk104_fifo_pbdma_init(struct gk104_fifo *);
8699 extern const struct nvkm_enum gk104_fifo_fault_access[];
87100 extern const struct nvkm_enum gk104_fifo_fault_engine[];
88101 extern const struct nvkm_enum gk104_fifo_fault_reason[];
....@@ -91,15 +104,32 @@
91104 extern const struct gk104_fifo_runlist_func gk104_fifo_runlist;
92105 void gk104_fifo_runlist_chan(struct gk104_fifo_chan *,
93106 struct nvkm_memory *, u32);
107
+void gk104_fifo_runlist_commit(struct gk104_fifo *, int runl,
108
+ struct nvkm_memory *, int);
94109
95110 extern const struct gk104_fifo_runlist_func gk110_fifo_runlist;
96111 void gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *,
97112 struct nvkm_memory *, u32);
98113
99
-void gk208_fifo_init_pbdma_timeout(struct gk104_fifo *);
114
+extern const struct gk104_fifo_pbdma_func gk208_fifo_pbdma;
115
+void gk208_fifo_pbdma_init_timeout(struct gk104_fifo *);
100116
117
+void gm107_fifo_intr_fault(struct nvkm_fifo *, int);
101118 extern const struct nvkm_enum gm107_fifo_fault_engine[];
102119 extern const struct gk104_fifo_runlist_func gm107_fifo_runlist;
103120
121
+extern const struct gk104_fifo_pbdma_func gm200_fifo_pbdma;
122
+int gm200_fifo_pbdma_nr(struct gk104_fifo *);
123
+
124
+void gp100_fifo_intr_fault(struct nvkm_fifo *, int);
104125 extern const struct nvkm_enum gp100_fifo_fault_engine[];
126
+
127
+extern const struct nvkm_enum gv100_fifo_fault_access[];
128
+extern const struct nvkm_enum gv100_fifo_fault_reason[];
129
+extern const struct nvkm_enum gv100_fifo_fault_hubclient[];
130
+extern const struct nvkm_enum gv100_fifo_fault_gpcclient[];
131
+void gv100_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *,
132
+ struct nvkm_memory *, u32);
133
+void gv100_fifo_runlist_chan(struct gk104_fifo_chan *,
134
+ struct nvkm_memory *, u32);
105135 #endif