xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/priv.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: priv.h,v 1.3 2021/12/18 23:45:35 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVKM_FIFO_PRIV_H__
5 #define __NVKM_FIFO_PRIV_H__
6 #define nvkm_fifo(p) container_of((p), struct nvkm_fifo, engine)
7 #include <engine/fifo.h>
8 
9 int nvkm_fifo_ctor(const struct nvkm_fifo_func *, struct nvkm_device *,
10 		   int index, int nr, struct nvkm_fifo *);
11 void nvkm_fifo_uevent(struct nvkm_fifo *);
12 void nvkm_fifo_cevent(struct nvkm_fifo *);
13 void nvkm_fifo_kevent(struct nvkm_fifo *, int chid);
14 void nvkm_fifo_recover_chan(struct nvkm_fifo *, int chid);
15 
16 struct nvkm_fifo_chan *
17 nvkm_fifo_chan_inst_locked(struct nvkm_fifo *, u64 inst);
18 
19 struct nvkm_fifo_chan_oclass;
20 struct nvkm_fifo_func {
21 	void *(*dtor)(struct nvkm_fifo *);
22 	int (*oneinit)(struct nvkm_fifo *);
23 	int (*info)(struct nvkm_fifo *, u64 mthd, u64 *data);
24 	void (*init)(struct nvkm_fifo *);
25 	void (*fini)(struct nvkm_fifo *);
26 	void (*intr)(struct nvkm_fifo *);
27 	void (*fault)(struct nvkm_fifo *, struct nvkm_fault_data *);
28 	void (*pause)(struct nvkm_fifo *, unsigned long *);
29 	void (*start)(struct nvkm_fifo *, unsigned long *);
30 	void (*uevent_init)(struct nvkm_fifo *);
31 	void (*uevent_fini)(struct nvkm_fifo *);
32 	void (*recover_chan)(struct nvkm_fifo *, int chid);
33 	int (*class_get)(struct nvkm_fifo *, int index, struct nvkm_oclass *);
34 	int (*class_new)(struct nvkm_fifo *, const struct nvkm_oclass *,
35 			 void *, u32, struct nvkm_object **);
36 	const struct nvkm_fifo_chan_oclass *chan[];
37 };
38 
39 void nv04_fifo_intr(struct nvkm_fifo *);
40 void nv04_fifo_pause(struct nvkm_fifo *, unsigned long *);
41 void nv04_fifo_start(struct nvkm_fifo *, unsigned long *);
42 
43 void gf100_fifo_intr_fault(struct nvkm_fifo *, int);
44 #endif
45