1 #ifndef __GK104_FIFO_H__
2 #define __GK104_FIFO_H__
3 #define gk104_fifo(p) container_of((p), struct gk104_fifo, base)
6 #include <subdev/mmu.h>
8 struct gk104_fifo_chan;
9 struct gk104_fifo_engn {
10 struct nvkm_memory *runlist[2];
12 wait_queue_head_t wait;
13 struct list_head chan;
17 struct nvkm_fifo base;
19 struct work_struct fault;
24 struct gk104_fifo_engn engine[7];
26 struct nvkm_memory *mem;
31 int gk104_fifo_new_(const struct nvkm_fifo_func *, struct nvkm_device *,
32 int index, int nr, struct nvkm_fifo **);
33 void *gk104_fifo_dtor(struct nvkm_fifo *);
34 int gk104_fifo_oneinit(struct nvkm_fifo *);
35 void gk104_fifo_init(struct nvkm_fifo *);
36 void gk104_fifo_fini(struct nvkm_fifo *);
37 void gk104_fifo_intr(struct nvkm_fifo *);
38 void gk104_fifo_uevent_init(struct nvkm_fifo *);
39 void gk104_fifo_uevent_fini(struct nvkm_fifo *);
40 void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *);
41 void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *);
42 void gk104_fifo_runlist_commit(struct gk104_fifo *, u32 engine);
45 gk104_fifo_engine_subdev(int engine)
48 case 0: return (1ULL << NVKM_ENGINE_GR) |
49 (1ULL << NVKM_ENGINE_SW) |
50 (1ULL << NVKM_ENGINE_CE2);
51 case 1: return (1ULL << NVKM_ENGINE_MSPDEC);
52 case 2: return (1ULL << NVKM_ENGINE_MSPPP);
53 case 3: return (1ULL << NVKM_ENGINE_MSVLD);
54 case 4: return (1ULL << NVKM_ENGINE_CE0);
55 case 5: return (1ULL << NVKM_ENGINE_CE1);
56 case 6: return (1ULL << NVKM_ENGINE_MSENC);
64 gk104_fifo_subdev_engine(int subdev)
69 case NVKM_ENGINE_CE2 : return 0;
70 case NVKM_ENGINE_MSPDEC: return 1;
71 case NVKM_ENGINE_MSPPP : return 2;
72 case NVKM_ENGINE_MSVLD : return 3;
73 case NVKM_ENGINE_CE0 : return 4;
74 case NVKM_ENGINE_CE1 : return 5;
75 case NVKM_ENGINE_MSENC : return 6;