xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/dispnv50/core.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: core.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $	*/
2 
3 #ifndef __NV50_KMS_CORE_H__
4 #define __NV50_KMS_CORE_H__
5 #include "disp.h"
6 #include "atom.h"
7 
8 struct nv50_core {
9 	const struct nv50_core_func *func;
10 	struct nv50_dmac chan;
11 	bool assign_windows;
12 };
13 
14 int nv50_core_new(struct nouveau_drm *, struct nv50_core **);
15 void nv50_core_del(struct nv50_core **);
16 
17 struct nv50_core_func {
18 	void (*init)(struct nv50_core *);
19 	void (*ntfy_init)(struct nouveau_bo *, u32 offset);
20 	int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
21 			      struct nvif_device *);
22 	void (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
23 
24 	struct {
25 		void (*owner)(struct nv50_core *);
26 	} wndw;
27 
28 	const struct nv50_head_func *head;
29 	const struct nv50_outp_func {
30 		void (*ctrl)(struct nv50_core *, int or, u32 ctrl,
31 			     struct nv50_head_atom *);
32 	} *dac, *pior, *sor;
33 };
34 
35 int core507d_new(struct nouveau_drm *, s32, struct nv50_core **);
36 int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32,
37 		  struct nv50_core **);
38 void core507d_init(struct nv50_core *);
39 void core507d_ntfy_init(struct nouveau_bo *, u32);
40 int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
41 void core507d_update(struct nv50_core *, u32 *, bool);
42 
43 extern const struct nv50_outp_func dac507d;
44 extern const struct nv50_outp_func sor507d;
45 extern const struct nv50_outp_func pior507d;
46 
47 int core827d_new(struct nouveau_drm *, s32, struct nv50_core **);
48 
49 int core907d_new(struct nouveau_drm *, s32, struct nv50_core **);
50 extern const struct nv50_outp_func dac907d;
51 extern const struct nv50_outp_func sor907d;
52 
53 int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
54 
55 int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
56 int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
57 void corec37d_update(struct nv50_core *, u32 *, bool);
58 void corec37d_wndw_owner(struct nv50_core *);
59 extern const struct nv50_outp_func sorc37d;
60 
61 int corec57d_new(struct nouveau_drm *, s32, struct nv50_core **);
62 #endif
63