License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / drivers / gpu / drm / nouveau / include / nvkm / engine / fifo.h
CommitLineData
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
9struct nvkm_fifo_engn {
10 struct nvkm_object *object;
11 int refcount;
12 int usecount;
13};
c420b2dc 14
05c7145d 15struct 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 33struct 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
47void nvkm_fifo_pause(struct nvkm_fifo *, unsigned long *);
48void nvkm_fifo_start(struct nvkm_fifo *, unsigned long *);
8f0649b5 49
344c2d42
BS
50void nvkm_fifo_chan_put(struct nvkm_fifo *, unsigned long flags,
51 struct nvkm_fifo_chan **);
52struct nvkm_fifo_chan *
53nvkm_fifo_chan_inst(struct nvkm_fifo *, u64 inst, unsigned long *flags);
54struct nvkm_fifo_chan *
55nvkm_fifo_chan_chid(struct nvkm_fifo *, int chid, unsigned long *flags);
56
13de7f46
BS
57int nv04_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
58int nv10_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
59int nv17_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
60int nv40_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
61int nv50_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
62int g84_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
63int gf100_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
64int gk104_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
63f8c9b7 65int gk110_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
13de7f46
BS
66int gk208_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
67int gk20a_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
7c4f87c9 68int gm107_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
db1eb528 69int gm200_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
13de7f46 70int gm20b_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
e8ff9794 71int gp100_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
af3a4f7e 72int gp10b_fifo_new(struct nvkm_device *, int, struct nvkm_fifo **);
c420b2dc 73#endif