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;
22 struct gk104_fifo_engn engine[7];
24 struct nvkm_memory *mem;
30 int gk104_fifo_new_(const struct nvkm_fifo_func *, struct nvkm_device *,
31 int index, int nr, struct nvkm_fifo **);
32 void *gk104_fifo_dtor(struct nvkm_fifo *);
33 int gk104_fifo_oneinit(struct nvkm_fifo *);
34 void gk104_fifo_init(struct nvkm_fifo *);
35 void gk104_fifo_fini(struct nvkm_fifo *);
36 void gk104_fifo_intr(struct nvkm_fifo *);
37 void gk104_fifo_uevent_init(struct nvkm_fifo *);
38 void gk104_fifo_uevent_fini(struct nvkm_fifo *);
39 void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *);
40 void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *);
41 void gk104_fifo_runlist_commit(struct gk104_fifo *, u32 engine);
44 gk104_fifo_engine_subdev(int engine)
47 case 0: return (1ULL << NVKM_ENGINE_GR) |
48 (1ULL << NVKM_ENGINE_SW) |
49 (1ULL << NVKM_ENGINE_CE2);
50 case 1: return (1ULL << NVKM_ENGINE_MSPDEC);
51 case 2: return (1ULL << NVKM_ENGINE_MSPPP);
52 case 3: return (1ULL << NVKM_ENGINE_MSVLD);
53 case 4: return (1ULL << NVKM_ENGINE_CE0);
54 case 5: return (1ULL << NVKM_ENGINE_CE1);
55 case 6: return (1ULL << NVKM_ENGINE_MSENC);
63 gk104_fifo_subdev_engine(int subdev)
68 case NVKM_ENGINE_CE2 : return 0;
69 case NVKM_ENGINE_MSPDEC: return 1;
70 case NVKM_ENGINE_MSPPP : return 2;
71 case NVKM_ENGINE_MSVLD : return 3;
72 case NVKM_ENGINE_CE0 : return 4;
73 case NVKM_ENGINE_CE1 : return 5;
74 case NVKM_ENGINE_MSENC : return 6;