xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/fifo/changk104.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: changk104.h,v 1.3 2021/12/18 23:45:35 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __GK104_FIFO_CHAN_H__
5 #define __GK104_FIFO_CHAN_H__
6 #define gk104_fifo_chan(p) container_of((p), struct gk104_fifo_chan, base)
7 #include "chan.h"
8 #include "gk104.h"
9 
10 struct gk104_fifo_chan {
11 	struct nvkm_fifo_chan base;
12 	struct gk104_fifo *fifo;
13 	int runl;
14 
15 	struct nvkm_fifo_cgrp *cgrp;
16 	struct list_head head;
17 	bool killed;
18 
19 	struct nvkm_memory *mthd;
20 
21 	struct {
22 		struct nvkm_gpuobj *inst;
23 		struct nvkm_vma *vma;
24 	} engn[NVKM_SUBDEV_NR];
25 };
26 
27 extern const struct nvkm_fifo_chan_func gk104_fifo_gpfifo_func;
28 
29 int gk104_fifo_gpfifo_new(struct gk104_fifo *, const struct nvkm_oclass *,
30 			  void *data, u32 size, struct nvkm_object **);
31 void *gk104_fifo_gpfifo_dtor(struct nvkm_fifo_chan *);
32 void gk104_fifo_gpfifo_init(struct nvkm_fifo_chan *);
33 void gk104_fifo_gpfifo_fini(struct nvkm_fifo_chan *);
34 int gk104_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *, struct nvkm_engine *,
35 				  struct nvkm_object *);
36 void gk104_fifo_gpfifo_engine_dtor(struct nvkm_fifo_chan *,
37 				   struct nvkm_engine *);
38 int gk104_fifo_gpfifo_kick(struct gk104_fifo_chan *);
39 int gk104_fifo_gpfifo_kick_locked(struct gk104_fifo_chan *);
40 
41 int gv100_fifo_gpfifo_new(struct gk104_fifo *, const struct nvkm_oclass *,
42 			  void *data, u32 size, struct nvkm_object **);
43 int gv100_fifo_gpfifo_new_(const struct nvkm_fifo_chan_func *,
44 			   struct gk104_fifo *, u64 *, u16 *, u64, u64, u64,
45 			   u64 *, bool, u32 *, const struct nvkm_oclass *,
46 			   struct nvkm_object **);
47 int gv100_fifo_gpfifo_engine_init(struct nvkm_fifo_chan *,
48 				  struct nvkm_engine *);
49 int gv100_fifo_gpfifo_engine_fini(struct nvkm_fifo_chan *,
50 				  struct nvkm_engine *, bool);
51 
52 int tu102_fifo_gpfifo_new(struct gk104_fifo *, const struct nvkm_oclass *,
53 			  void *data, u32 size, struct nvkm_object **);
54 #endif
55