]>
Commit | Line | Data |
---|---|---|
70cabe4a BS |
1 | #ifndef __NV50_DISP_H__ |
2 | #define __NV50_DISP_H__ | |
3 | ||
4 | #include <core/parent.h> | |
370c00f9 | 5 | #include <core/namedb.h> |
1d7c71a3 | 6 | #include <core/engctx.h> |
370c00f9 | 7 | #include <core/ramht.h> |
1d7c71a3 | 8 | #include <core/event.h> |
370c00f9 BS |
9 | |
10 | #include <engine/dmaobj.h> | |
70cabe4a | 11 | |
0a0afd28 | 12 | #include "dport.h" |
a8f8b489 | 13 | #include "priv.h" |
7a014a87 | 14 | #include "outp.h" |
b8407c9e | 15 | #include "outpdp.h" |
a8f8b489 BS |
16 | |
17 | struct nv50_disp_impl { | |
18 | struct nouveau_disp_impl base; | |
d67d92c0 BS |
19 | struct { |
20 | const struct nv50_disp_mthd_chan *core; | |
21 | const struct nv50_disp_mthd_chan *base; | |
22 | const struct nv50_disp_mthd_chan *ovly; | |
23 | int prev; | |
24 | } mthd; | |
a8f8b489 | 25 | }; |
6c5a0424 | 26 | |
70cabe4a BS |
27 | struct nv50_disp_priv { |
28 | struct nouveau_disp base; | |
29 | struct nouveau_oclass *sclass; | |
5cc027f6 BS |
30 | |
31 | struct work_struct supervisor; | |
32 | u32 super; | |
33 | ||
70cabe4a BS |
34 | struct { |
35 | int nr; | |
36 | } head; | |
37 | struct { | |
38 | int nr; | |
35b21d39 | 39 | int (*power)(struct nv50_disp_priv *, int dac, u32 data); |
7ebb38b5 | 40 | int (*sense)(struct nv50_disp_priv *, int dac, u32 load); |
70cabe4a BS |
41 | } dac; |
42 | struct { | |
43 | int nr; | |
74b66850 | 44 | int (*power)(struct nv50_disp_priv *, int sor, u32 data); |
0a9e2b95 | 45 | int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32); |
1c30cd09 | 46 | int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32); |
4a230fa6 | 47 | u32 lvdsconf; |
70cabe4a | 48 | } sor; |
a2bc283f BS |
49 | struct { |
50 | int nr; | |
51 | int (*power)(struct nv50_disp_priv *, int ext, u32 data); | |
52 | u8 type[3]; | |
a2bc283f | 53 | } pior; |
70cabe4a BS |
54 | }; |
55 | ||
d2fa7d32 BS |
56 | #define HEAD_MTHD(n) (n), (n) + 0x03 |
57 | ||
58 | int nv50_disp_base_scanoutpos(struct nouveau_object *, u32, void *, u32); | |
59 | ||
35b21d39 BS |
60 | #define DAC_MTHD(n) (n), (n) + 0x03 |
61 | ||
62 | int nv50_dac_mthd(struct nouveau_object *, u32, void *, u32); | |
63 | int nv50_dac_power(struct nv50_disp_priv *, int, u32); | |
7ebb38b5 | 64 | int nv50_dac_sense(struct nv50_disp_priv *, int, u32); |
35b21d39 | 65 | |
6c5a0424 BS |
66 | #define SOR_MTHD(n) (n), (n) + 0x3f |
67 | ||
a4feaf4e BS |
68 | int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32); |
69 | int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32); | |
70 | ||
8e9e3d2d BS |
71 | int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); |
72 | int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); | |
a4feaf4e BS |
73 | int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); |
74 | ||
6c5a0424 | 75 | int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32); |
74b66850 | 76 | int nv50_sor_power(struct nv50_disp_priv *, int, u32); |
6c5a0424 | 77 | |
8f2abc25 BS |
78 | int nv94_sor_dp_train_init(struct nv50_disp_priv *, int, int, int, u16, u16, |
79 | u32, struct dcb_output *); | |
80 | int nv94_sor_dp_train_fini(struct nv50_disp_priv *, int, int, int, u16, u16, | |
81 | u32, struct dcb_output *); | |
f7960736 BS |
82 | int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32, |
83 | struct dcb_output *); | |
84 | int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, | |
85 | struct dcb_output *); | |
86 | int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, | |
87 | struct dcb_output *); | |
88 | ||
6c5a0424 BS |
89 | int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32, |
90 | struct dcb_output *); | |
91 | int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, | |
92 | struct dcb_output *); | |
93 | int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, | |
94 | struct dcb_output *); | |
95 | ||
a2bc283f BS |
96 | #define PIOR_MTHD(n) (n), (n) + 0x03 |
97 | ||
98 | int nv50_pior_mthd(struct nouveau_object *, u32, void *, u32); | |
99 | int nv50_pior_power(struct nv50_disp_priv *, int, u32); | |
100 | ||
70cabe4a BS |
101 | struct nv50_disp_base { |
102 | struct nouveau_parent base; | |
370c00f9 BS |
103 | struct nouveau_ramht *ramht; |
104 | u32 chan; | |
70cabe4a BS |
105 | }; |
106 | ||
107 | struct nv50_disp_chan { | |
370c00f9 BS |
108 | struct nouveau_namedb base; |
109 | int chid; | |
110 | }; | |
111 | ||
112 | int nv50_disp_chan_create_(struct nouveau_object *, struct nouveau_object *, | |
113 | struct nouveau_oclass *, int, int, void **); | |
114 | void nv50_disp_chan_destroy(struct nv50_disp_chan *); | |
115 | u32 nv50_disp_chan_rd32(struct nouveau_object *, u64); | |
116 | void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32); | |
117 | ||
118 | #define nv50_disp_chan_init(a) \ | |
119 | nouveau_namedb_init(&(a)->base) | |
120 | #define nv50_disp_chan_fini(a,b) \ | |
121 | nouveau_namedb_fini(&(a)->base, (b)) | |
122 | ||
123 | int nv50_disp_dmac_create_(struct nouveau_object *, struct nouveau_object *, | |
124 | struct nouveau_oclass *, u32, int, int, void **); | |
125 | void nv50_disp_dmac_dtor(struct nouveau_object *); | |
126 | ||
127 | struct nv50_disp_dmac { | |
128 | struct nv50_disp_chan base; | |
129 | struct nouveau_dmaobj *pushdma; | |
130 | u32 push; | |
131 | }; | |
132 | ||
133 | struct nv50_disp_pioc { | |
134 | struct nv50_disp_chan base; | |
70cabe4a BS |
135 | }; |
136 | ||
d67d92c0 BS |
137 | struct nv50_disp_mthd_list { |
138 | u32 mthd; | |
139 | u32 addr; | |
140 | struct { | |
141 | u32 mthd; | |
142 | u32 addr; | |
143 | const char *name; | |
144 | } data[]; | |
145 | }; | |
146 | ||
147 | struct nv50_disp_mthd_chan { | |
148 | const char *name; | |
149 | u32 addr; | |
150 | struct { | |
151 | const char *name; | |
152 | int nr; | |
153 | const struct nv50_disp_mthd_list *mthd; | |
154 | } data[]; | |
155 | }; | |
156 | ||
70cabe4a | 157 | extern struct nouveau_ofuncs nv50_disp_mast_ofuncs; |
d67d92c0 BS |
158 | extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_base; |
159 | extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_sor; | |
160 | extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_pior; | |
370c00f9 | 161 | extern struct nouveau_ofuncs nv50_disp_sync_ofuncs; |
d67d92c0 | 162 | extern const struct nv50_disp_mthd_list nv50_disp_sync_mthd_image; |
370c00f9 | 163 | extern struct nouveau_ofuncs nv50_disp_ovly_ofuncs; |
d67d92c0 | 164 | extern const struct nv50_disp_mthd_list nv50_disp_ovly_mthd_base; |
370c00f9 BS |
165 | extern struct nouveau_ofuncs nv50_disp_oimm_ofuncs; |
166 | extern struct nouveau_ofuncs nv50_disp_curs_ofuncs; | |
70cabe4a BS |
167 | extern struct nouveau_ofuncs nv50_disp_base_ofuncs; |
168 | extern struct nouveau_oclass nv50_disp_cclass; | |
d67d92c0 BS |
169 | void nv50_disp_mthd_chan(struct nv50_disp_priv *, int debug, int head, |
170 | const struct nv50_disp_mthd_chan *); | |
5cc027f6 | 171 | void nv50_disp_intr_supervisor(struct work_struct *); |
70cabe4a BS |
172 | void nv50_disp_intr(struct nouveau_subdev *); |
173 | ||
d67d92c0 BS |
174 | extern const struct nv50_disp_mthd_chan nv84_disp_mast_mthd_chan; |
175 | extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_dac; | |
176 | extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_head; | |
177 | extern const struct nv50_disp_mthd_chan nv84_disp_sync_mthd_chan; | |
178 | extern const struct nv50_disp_mthd_chan nv84_disp_ovly_mthd_chan; | |
ef22c8bb BS |
179 | extern struct nouveau_omthds nv84_disp_base_omthds[]; |
180 | ||
d67d92c0 BS |
181 | extern const struct nv50_disp_mthd_chan nv94_disp_mast_mthd_chan; |
182 | ||
46654061 | 183 | extern struct nouveau_ofuncs nvd0_disp_mast_ofuncs; |
d67d92c0 BS |
184 | extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_base; |
185 | extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_dac; | |
186 | extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_sor; | |
187 | extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_pior; | |
46654061 BS |
188 | extern struct nouveau_ofuncs nvd0_disp_sync_ofuncs; |
189 | extern struct nouveau_ofuncs nvd0_disp_ovly_ofuncs; | |
d67d92c0 | 190 | extern const struct nv50_disp_mthd_chan nvd0_disp_sync_mthd_chan; |
46654061 BS |
191 | extern struct nouveau_ofuncs nvd0_disp_oimm_ofuncs; |
192 | extern struct nouveau_ofuncs nvd0_disp_curs_ofuncs; | |
d2fa7d32 | 193 | extern struct nouveau_omthds nvd0_disp_base_omthds[]; |
46654061 BS |
194 | extern struct nouveau_ofuncs nvd0_disp_base_ofuncs; |
195 | extern struct nouveau_oclass nvd0_disp_cclass; | |
5cc027f6 | 196 | void nvd0_disp_intr_supervisor(struct work_struct *); |
46654061 BS |
197 | void nvd0_disp_intr(struct nouveau_subdev *); |
198 | ||
d67d92c0 BS |
199 | extern const struct nv50_disp_mthd_chan nve0_disp_mast_mthd_chan; |
200 | extern const struct nv50_disp_mthd_chan nve0_disp_ovly_mthd_chan; | |
201 | ||
b8407c9e BS |
202 | extern struct nvkm_output_dp_impl nv50_pior_dp_impl; |
203 | extern struct nouveau_oclass *nv50_disp_outp_sclass[]; | |
204 | ||
205 | extern struct nvkm_output_dp_impl nv94_sor_dp_impl; | |
206 | extern struct nouveau_oclass *nv94_disp_outp_sclass[]; | |
207 | ||
208 | extern struct nvkm_output_dp_impl nvd0_sor_dp_impl; | |
209 | extern struct nouveau_oclass *nvd0_disp_outp_sclass[]; | |
210 | ||
70cabe4a | 211 | #endif |