Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / gpu / drm / nouveau / include / nvkm / engine / fifo.h
blobc17b3a9bf8fbc0411c6655459e91a0078303d913
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_FIFO_H__
3 #define __NVKM_FIFO_H__
4 #include <core/engine.h>
5 #include <core/object.h>
6 #include <core/event.h>
8 #define NVKM_FIFO_CHID_NR 4096
10 struct nvkm_fifo_engn {
11 struct nvkm_object *object;
12 int refcount;
13 int usecount;
16 struct nvkm_fifo_chan {
17 const struct nvkm_fifo_chan_func *func;
18 struct nvkm_fifo *fifo;
19 u64 engines;
20 struct nvkm_object object;
22 struct list_head head;
23 u16 chid;
24 struct nvkm_gpuobj *inst;
25 struct nvkm_gpuobj *push;
26 struct nvkm_vmm *vmm;
27 void __iomem *user;
28 u64 addr;
29 u32 size;
31 struct nvkm_fifo_engn engn[NVKM_SUBDEV_NR];
34 struct nvkm_fifo {
35 const struct nvkm_fifo_func *func;
36 struct nvkm_engine engine;
38 DECLARE_BITMAP(mask, NVKM_FIFO_CHID_NR);
39 int nr;
40 struct list_head chan;
41 spinlock_t lock;
43 struct nvkm_event uevent; /* async user trigger */
44 struct nvkm_event cevent; /* channel creation event */
45 struct nvkm_event kevent; /* channel killed */
48 void nvkm_fifo_pause(struct nvkm_fifo *, unsigned long *);
49 void nvkm_fifo_start(struct nvkm_fifo *, unsigned long *);
51 void nvkm_fifo_chan_put(struct nvkm_fifo *, unsigned long flags,
52 struct nvkm_fifo_chan **);
53 struct nvkm_fifo_chan *
54 nvkm_fifo_chan_inst(struct nvkm_fifo *, u64 inst, unsigned long *flags);
55 struct nvkm_fifo_chan *
56 nvkm_fifo_chan_chid(struct nvkm_fifo *, int chid, unsigned long *flags);
58 int nv04_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
59 int nv10_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
60 int nv17_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
61 int nv40_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
62 int nv50_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
63 int g84_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
64 int gf100_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
65 int gk104_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
66 int gk110_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
67 int gk208_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
68 int gk20a_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
69 int gm107_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
70 int gm200_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
71 int gm20b_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
72 int gp100_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
73 int gp10b_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
74 #endif