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)
8 #include <subdev/mmu.h>
10 struct gk104_fifo_chan
;
12 const struct gk104_fifo_func
*func
;
13 struct nvkm_fifo base
;
16 struct work_struct work
;
24 struct nvkm_engine
*engine
;
31 struct nvkm_memory
*mem
[2];
33 wait_queue_head_t wait
;
34 struct list_head chan
;
40 struct nvkm_memory
*mem
;
45 struct gk104_fifo_func
{
47 const struct nvkm_enum
*engine
;
48 const struct nvkm_enum
*reason
;
49 const struct nvkm_enum
*hubclient
;
50 const struct nvkm_enum
*gpcclient
;
53 const struct nvkm_fifo_chan_oclass
*chan
[];
56 int gk104_fifo_new_(const struct gk104_fifo_func
*, struct nvkm_device
*,
57 int index
, int nr
, struct nvkm_fifo
**);
58 void gk104_fifo_runlist_insert(struct gk104_fifo
*, struct gk104_fifo_chan
*);
59 void gk104_fifo_runlist_remove(struct gk104_fifo
*, struct gk104_fifo_chan
*);
60 void gk104_fifo_runlist_commit(struct gk104_fifo
*, int runl
);
63 gk104_fifo_engine_subdev(int engine
)
66 case 0: return (1ULL << NVKM_ENGINE_GR
) |
67 (1ULL << NVKM_ENGINE_SW
) |
68 (1ULL << NVKM_ENGINE_CE2
);
69 case 1: return (1ULL << NVKM_ENGINE_MSPDEC
);
70 case 2: return (1ULL << NVKM_ENGINE_MSPPP
);
71 case 3: return (1ULL << NVKM_ENGINE_MSVLD
);
72 case 4: return (1ULL << NVKM_ENGINE_CE0
);
73 case 5: return (1ULL << NVKM_ENGINE_CE1
);
74 case 6: return (1ULL << NVKM_ENGINE_MSENC
);
81 extern const struct nvkm_enum gk104_fifo_fault_engine
[];
82 extern const struct nvkm_enum gk104_fifo_fault_reason
[];
83 extern const struct nvkm_enum gk104_fifo_fault_hubclient
[];
84 extern const struct nvkm_enum gk104_fifo_fault_gpcclient
[];
86 extern const struct nvkm_enum gm107_fifo_fault_engine
[];
87 extern const struct nvkm_enum gp100_fifo_fault_engine
[];