1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_FIFO_CHAN_H__
3 #define __NVKM_FIFO_CHAN_H__
4 #define nvkm_fifo_chan(p) container_of((p), struct nvkm_fifo_chan, object)
5 #include "priv.h"
6 
7 struct nvkm_fifo_chan_func {
8 	void *(*dtor)(struct nvkm_fifo_chan *);
9 	void (*init)(struct nvkm_fifo_chan *);
10 	void (*fini)(struct nvkm_fifo_chan *);
11 	int (*ntfy)(struct nvkm_fifo_chan *, u32 type, struct nvkm_event **);
12 	int  (*engine_ctor)(struct nvkm_fifo_chan *, struct nvkm_engine *,
13 			    struct nvkm_object *);
14 	void (*engine_dtor)(struct nvkm_fifo_chan *, struct nvkm_engine *);
15 	int  (*engine_init)(struct nvkm_fifo_chan *, struct nvkm_engine *);
16 	int  (*engine_fini)(struct nvkm_fifo_chan *, struct nvkm_engine *,
17 			    bool suspend);
18 	int  (*object_ctor)(struct nvkm_fifo_chan *, struct nvkm_object *);
19 	void (*object_dtor)(struct nvkm_fifo_chan *, int);
20 	u32 (*submit_token)(struct nvkm_fifo_chan *);
21 };
22 
23 int nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *, struct nvkm_fifo *,
24 			u32 size, u32 align, bool zero, u64 vm, u64 push,
25 			u64 engines, int bar, u32 base, u32 user,
26 			const struct nvkm_oclass *, struct nvkm_fifo_chan *);
27 
28 struct nvkm_fifo_chan_oclass {
29 	int (*ctor)(struct nvkm_fifo *, const struct nvkm_oclass *,
30 		    void *data, u32 size, struct nvkm_object **);
31 	struct nvkm_sclass base;
32 };
33 
34 int gf100_fifo_chan_ntfy(struct nvkm_fifo_chan *, u32, struct nvkm_event **);
35 #endif
36