xref: /linux/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_DISP_PRIV_H__
3 #define __NVKM_DISP_PRIV_H__
4 #define nvkm_udisp(p) container_of((p), struct nvkm_disp, client.object)
5 #include <engine/disp.h>
6 #include <core/enum.h>
7 struct nvkm_head;
8 struct nvkm_outp;
9 struct dcb_output;
10 
11 int r535_disp_new(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
12 		  struct nvkm_disp **);
13 
14 int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
15 		   struct nvkm_disp *);
16 int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
17 		   struct nvkm_disp **);
18 void nvkm_disp_vblank(struct nvkm_disp *, int head);
19 
20 struct nvkm_disp_func {
21 	void (*dtor)(struct nvkm_disp *);
22 	int (*oneinit)(struct nvkm_disp *);
23 	int (*init)(struct nvkm_disp *);
24 	void (*fini)(struct nvkm_disp *, bool suspend);
25 	void (*intr)(struct nvkm_disp *);
26 	void (*intr_error)(struct nvkm_disp *, int chid);
27 
28 	void (*super)(struct work_struct *);
29 
30 	const struct nvkm_event_func *uevent;
31 
32 	struct {
33 		int (*cnt)(struct nvkm_disp *, unsigned long *mask);
34 		int (*new)(struct nvkm_disp *, int id);
35 	} wndw, head, dac, sor, pior;
36 
37 	u16 ramht_size;
38 
39 	struct nvkm_sclass root;
40 
41 	struct nvkm_disp_user {
42 		struct nvkm_sclass base;
43 		int (*ctor)(const struct nvkm_oclass *, void *argv, u32 argc,
44 			    struct nvkm_object **);
45 		const struct nvkm_disp_chan_user *chan;
46 	} user[];
47 };
48 
49 int nv50_disp_oneinit(struct nvkm_disp *);
50 int nv50_disp_init(struct nvkm_disp *);
51 void nv50_disp_fini(struct nvkm_disp *, bool suspend);
52 void nv50_disp_intr(struct nvkm_disp *);
53 extern const struct nvkm_enum nv50_disp_intr_error_type[];
54 void nv50_disp_super(struct work_struct *);
55 void nv50_disp_super_1(struct nvkm_disp *);
56 void nv50_disp_super_1_0(struct nvkm_disp *, struct nvkm_head *);
57 void nv50_disp_super_2_0(struct nvkm_disp *, struct nvkm_head *);
58 void nv50_disp_super_2_1(struct nvkm_disp *, struct nvkm_head *);
59 void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *);
60 void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *);
61 
62 int gf119_disp_init(struct nvkm_disp *);
63 void gf119_disp_fini(struct nvkm_disp *, bool suspend);
64 void gf119_disp_intr(struct nvkm_disp *);
65 void gf119_disp_super(struct work_struct *);
66 void gf119_disp_intr_error(struct nvkm_disp *, int);
67 
68 void gv100_disp_fini(struct nvkm_disp *, bool suspend);
69 void gv100_disp_intr(struct nvkm_disp *);
70 void gv100_disp_super(struct work_struct *);
71 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
72 int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
73 
74 int tu102_disp_init(struct nvkm_disp *);
75 
76 void nv50_disp_dptmds_war_2(struct nvkm_disp *, struct dcb_output *);
77 void nv50_disp_dptmds_war_3(struct nvkm_disp *, struct dcb_output *);
78 void nv50_disp_update_sppll1(struct nvkm_disp *);
79 
80 extern const struct nvkm_event_func nv50_disp_chan_uevent;
81 void nv50_disp_chan_uevent_send(struct nvkm_disp *, int);
82 
83 extern const struct nvkm_event_func gf119_disp_chan_uevent;
84 extern const struct nvkm_event_func gv100_disp_chan_uevent;
85 
86 int nvkm_udisp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
87 int nvkm_uconn_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
88 int nvkm_uoutp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
89 int nvkm_uhead_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
90 #endif
91