1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __GK104_FIFO_H__
3 #define __GK104_FIFO_H__
4 #define gk104_fifo(p) container_of((p), struct gk104_fifo, base)
9 #include <subdev/mmu.h>
11 struct gk104_fifo_chan;
13 const struct gk104_fifo_func *func;
14 struct nvkm_fifo base;
17 struct work_struct work;
25 struct nvkm_engine *engine;
32 struct nvkm_memory *mem[2];
34 wait_queue_head_t wait;
35 struct list_head cgrp;
36 struct list_head chan;
42 struct nvkm_memory *mem;
47 struct gk104_fifo_func {
48 void (*init_pbdma_timeout)(struct gk104_fifo *);
51 const struct nvkm_enum *access;
52 const struct nvkm_enum *engine;
53 const struct nvkm_enum *reason;
54 const struct nvkm_enum *hubclient;
55 const struct nvkm_enum *gpcclient;
58 const struct gk104_fifo_runlist_func {
60 void (*cgrp)(struct nvkm_fifo_cgrp *,
61 struct nvkm_memory *, u32 offset);
62 void (*chan)(struct gk104_fifo_chan *,
63 struct nvkm_memory *, u32 offset);
66 struct gk104_fifo_user_user {
67 struct nvkm_sclass user;
68 int (*ctor)(const struct nvkm_oclass *, void *, u32,
69 struct nvkm_object **);
72 struct gk104_fifo_chan_user {
73 struct nvkm_sclass user;
74 int (*ctor)(struct gk104_fifo *, const struct nvkm_oclass *,
75 void *, u32, struct nvkm_object **);
80 int gk104_fifo_new_(const struct gk104_fifo_func *, struct nvkm_device *,
81 int index, int nr, struct nvkm_fifo **);
82 void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *);
83 void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *);
84 void gk104_fifo_runlist_commit(struct gk104_fifo *, int runl);
86 extern const struct nvkm_enum gk104_fifo_fault_access[];
87 extern const struct nvkm_enum gk104_fifo_fault_engine[];
88 extern const struct nvkm_enum gk104_fifo_fault_reason[];
89 extern const struct nvkm_enum gk104_fifo_fault_hubclient[];
90 extern const struct nvkm_enum gk104_fifo_fault_gpcclient[];
91 extern const struct gk104_fifo_runlist_func gk104_fifo_runlist;
92 void gk104_fifo_runlist_chan(struct gk104_fifo_chan *,
93 struct nvkm_memory *, u32);
95 extern const struct gk104_fifo_runlist_func gk110_fifo_runlist;
96 void gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *,
97 struct nvkm_memory *, u32);
99 void gk208_fifo_init_pbdma_timeout(struct gk104_fifo *);
101 extern const struct nvkm_enum gm107_fifo_fault_engine[];
102 extern const struct gk104_fifo_runlist_func gm107_fifo_runlist;
104 extern const struct nvkm_enum gp100_fifo_fault_engine[];