xref: /linux/drivers/gpu/drm/nouveau/dispnv50/core.h (revision 23ca32e4ead48f68e37000f2552b973ef1439acb)
1 #ifndef __NV50_KMS_CORE_H__
2 #define __NV50_KMS_CORE_H__
3 #include "disp.h"
4 #include "atom.h"
5 #include "crc.h"
6 #include <nouveau_encoder.h>
7 
8 struct nv50_core {
9 	const struct nv50_core_func *func;
10 	struct nv50_disp *disp;
11 
12 	struct nv50_dmac chan;
13 
14 	bool assign_windows;
15 };
16 
17 int nv50_core_new(struct nouveau_drm *, struct nv50_core **);
18 void nv50_core_del(struct nv50_core **);
19 
20 struct nv50_core_func {
21 	int (*init)(struct nv50_core *);
22 	void (*ntfy_init)(struct nouveau_bo *, u32 offset);
23 	int (*caps_init)(struct nouveau_drm *, struct nv50_disp *);
24 	u32 caps_class;
25 	int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
26 			      struct nvif_device *);
27 	int (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
28 
29 	struct {
30 		int (*owner)(struct nv50_core *);
31 	} wndw;
32 
33 	const struct nv50_head_func *head;
34 #if IS_ENABLED(CONFIG_DEBUG_FS)
35 	const struct nv50_crc_func *crc;
36 #endif
37 	const struct nv50_outp_func {
38 		int (*ctrl)(struct nv50_core *, int or, u32 ctrl,
39 			     struct nv50_head_atom *);
40 		/* XXX: Only used by SORs and PIORs for now */
41 		void (*get_caps)(struct nv50_disp *,
42 				 struct nouveau_encoder *, int or);
43 	} *dac, *pior, *sor;
44 };
45 
46 int core507d_new(struct nouveau_drm *, s32, struct nv50_core **);
47 int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32,
48 		  struct nv50_core **);
49 int core507d_init(struct nv50_core *);
50 void core507d_ntfy_init(struct nouveau_bo *, u32);
51 int core507d_read_caps(struct nv50_disp *disp);
52 int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *);
53 int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
54 int core507d_update(struct nv50_core *, u32 *, bool);
55 
56 extern const struct nv50_outp_func dac507d;
57 extern const struct nv50_outp_func sor507d;
58 extern const struct nv50_outp_func pior507d;
59 
60 int core827d_new(struct nouveau_drm *, s32, struct nv50_core **);
61 
62 int core907d_new(struct nouveau_drm *, s32, struct nv50_core **);
63 int core907d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp);
64 extern const struct nv50_outp_func dac907d;
65 extern const struct nv50_outp_func sor907d;
66 
67 int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
68 
69 int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
70 int corec37d_caps_init(struct nouveau_drm *, struct nv50_disp *);
71 int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
72 int corec37d_update(struct nv50_core *, u32 *, bool);
73 int corec37d_wndw_owner(struct nv50_core *);
74 extern const struct nv50_outp_func sorc37d;
75 
76 int corec57d_new(struct nouveau_drm *, s32, struct nv50_core **);
77 
78 int coreca7d_new(struct nouveau_drm *, s32, struct nv50_core **);
79 #endif
80