xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/gr/priv.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: priv.h,v 1.3 2021/12/18 23:45:36 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVKM_GR_PRIV_H__
5 #define __NVKM_GR_PRIV_H__
6 #define nvkm_gr(p) container_of((p), struct nvkm_gr, engine)
7 #include <engine/gr.h>
8 #include <core/enum.h>
9 struct nvkm_fb_tile;
10 struct nvkm_fifo_chan;
11 
12 int nvkm_gr_ctor(const struct nvkm_gr_func *, struct nvkm_device *,
13 		 int index, bool enable, struct nvkm_gr *);
14 
15 bool nv04_gr_idle(struct nvkm_gr *);
16 
17 struct nvkm_gr_func {
18 	void *(*dtor)(struct nvkm_gr *);
19 	int (*oneinit)(struct nvkm_gr *);
20 	int (*init)(struct nvkm_gr *);
21 	int (*fini)(struct nvkm_gr *, bool);
22 	void (*intr)(struct nvkm_gr *);
23 	void (*tile)(struct nvkm_gr *, int region, struct nvkm_fb_tile *);
24 	int (*tlb_flush)(struct nvkm_gr *);
25 	int (*chan_new)(struct nvkm_gr *, struct nvkm_fifo_chan *,
26 			const struct nvkm_oclass *, struct nvkm_object **);
27 	int (*object_get)(struct nvkm_gr *, int, struct nvkm_sclass *);
28 	/* Returns chipset-specific counts of units packed into an u64.
29 	 */
30 	u64 (*units)(struct nvkm_gr *);
31 	bool (*chsw_load)(struct nvkm_gr *);
32 	struct {
33 		int (*pause)(struct nvkm_gr *);
34 		int (*resume)(struct nvkm_gr *);
35 		u32 (*inst)(struct nvkm_gr *);
36 	} ctxsw;
37 	struct nvkm_sclass sclass[];
38 };
39 
40 extern const struct nvkm_bitfield nv04_gr_nsource[];
41 extern const struct nvkm_object_func nv04_gr_object;
42 
43 extern const struct nvkm_bitfield nv10_gr_intr_name[];
44 extern const struct nvkm_bitfield nv10_gr_nstatus[];
45 
46 extern const struct nvkm_enum nv50_data_error_names[];
47 #endif
48