Commit | Line | Data |
---|---|---|
05c7145d BS |
1 | #ifndef __NVKM_FIFO_H__ |
2 | #define __NVKM_FIFO_H__ | |
8f0649b5 BS |
3 | #include <core/engine.h> |
4 | #include <core/event.h> | |
5 | ||
6 | #define NVKM_FIFO_CHID_NR 4096 | |
7 | ||
8 | struct nvkm_fifo_engn { | |
9 | struct nvkm_object *object; | |
10 | int refcount; | |
11 | int usecount; | |
12 | }; | |
c420b2dc | 13 | |
05c7145d | 14 | struct nvkm_fifo_chan { |
8f0649b5 BS |
15 | const struct nvkm_fifo_chan_func *func; |
16 | struct nvkm_fifo *fifo; | |
17 | u64 engines; | |
18 | struct nvkm_object object; | |
19 | ||
20 | struct list_head head; | |
21 | u16 chid; | |
22 | struct nvkm_gpuobj *inst; | |
23 | struct nvkm_gpuobj *push; | |
24 | struct nvkm_vm *vm; | |
ebb945a9 | 25 | void __iomem *user; |
6c6ae061 | 26 | u64 addr; |
ebb945a9 | 27 | u32 size; |
8f0649b5 | 28 | |
68f3f702 | 29 | struct nvkm_fifo_engn engn[NVKM_SUBDEV_NR]; |
ebb945a9 BS |
30 | }; |
31 | ||
05c7145d | 32 | struct nvkm_fifo { |
8f0649b5 | 33 | const struct nvkm_fifo_func *func; |
13de7f46 | 34 | struct nvkm_engine engine; |
9bd2ddba | 35 | |
8f0649b5 BS |
36 | DECLARE_BITMAP(mask, NVKM_FIFO_CHID_NR); |
37 | int nr; | |
38 | struct list_head chan; | |
ebb945a9 | 39 | spinlock_t lock; |
ebb945a9 | 40 | |
13de7f46 BS |
41 | struct nvkm_event uevent; /* async user trigger */ |
42 | struct nvkm_event cevent; /* channel creation event */ | |
ebb945a9 BS |
43 | }; |
44 | ||
13de7f46 BS |
45 | void nvkm_fifo_pause(struct nvkm_fifo *, unsigned long *); |
46 | void nvkm_fifo_start(struct nvkm_fifo *, unsigned long *); | |
8f0649b5 | 47 | |
344c2d42 BS |
48 | void nvkm_fifo_chan_put(struct nvkm_fifo *, unsigned long flags, |
49 | struct nvkm_fifo_chan **); | |
50 | struct nvkm_fifo_chan * | |
51 | nvkm_fifo_chan_inst(struct nvkm_fifo *, u64 inst, unsigned long *flags); | |
52 | struct nvkm_fifo_chan * | |
53 | nvkm_fifo_chan_chid(struct nvkm_fifo *, int chid, unsigned long *flags); | |
54 | ||
13de7f46 BS |
55 | int nv04_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
56 | int nv10_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
57 | int nv17_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
58 | int nv40_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
59 | int nv50_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
60 | int g84_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
61 | int gf100_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
62 | int gk104_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
63f8c9b7 | 63 | int gk110_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
13de7f46 BS |
64 | int gk208_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
65 | int gk20a_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); | |
7c4f87c9 | 66 | int gm107_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
db1eb528 | 67 | int gm200_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
13de7f46 | 68 | int gm20b_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **); |
c420b2dc | 69 | #endif |