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