1 #ifndef __NV50_DISP_H__
2 #define __NV50_DISP_H__
4 #include <core/parent.h>
5 #include <core/namedb.h>
6 #include <core/engctx.h>
7 #include <core/ramht.h>
8 #include <core/event.h>
10 #include <engine/dmaobj.h>
17 #define NV50_DISP_MTHD_ struct nouveau_object *object, \
18 struct nv50_disp_priv *priv, void *data, u32 size
19 #define NV50_DISP_MTHD_V0 NV50_DISP_MTHD_, int head
20 #define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
22 struct nv50_disp_priv
{
23 struct nouveau_disp base
;
24 struct nouveau_oclass
*sclass
;
26 struct work_struct supervisor
;
34 int (*power
)(NV50_DISP_MTHD_V1
);
35 int (*sense
)(NV50_DISP_MTHD_V1
);
39 int (*power
)(NV50_DISP_MTHD_V1
);
40 int (*hda_eld
)(NV50_DISP_MTHD_V1
);
41 int (*hdmi
)(NV50_DISP_MTHD_V1
);
46 int (*power
)(NV50_DISP_MTHD_V1
);
51 struct nv50_disp_impl
{
52 struct nouveau_disp_impl base
;
54 const struct nv50_disp_mthd_chan
*core
;
55 const struct nv50_disp_mthd_chan
*base
;
56 const struct nv50_disp_mthd_chan
*ovly
;
60 int (*scanoutpos
)(NV50_DISP_MTHD_V0
);
64 int nv50_disp_base_scanoutpos(NV50_DISP_MTHD_V0
);
65 int nv50_disp_base_mthd(struct nouveau_object
*, u32
, void *, u32
);
67 int nvd0_disp_base_scanoutpos(NV50_DISP_MTHD_V0
);
69 int nv50_dac_power(NV50_DISP_MTHD_V1
);
70 int nv50_dac_sense(NV50_DISP_MTHD_V1
);
72 int nva3_hda_eld(NV50_DISP_MTHD_V1
);
73 int nvd0_hda_eld(NV50_DISP_MTHD_V1
);
75 int nv84_hdmi_ctrl(NV50_DISP_MTHD_V1
);
76 int nva3_hdmi_ctrl(NV50_DISP_MTHD_V1
);
77 int nvd0_hdmi_ctrl(NV50_DISP_MTHD_V1
);
79 int nv50_sor_power(NV50_DISP_MTHD_V1
);
81 int nv94_sor_dp_train_init(struct nv50_disp_priv
*, int, int, int, u16
, u16
,
82 u32
, struct dcb_output
*);
83 int nv94_sor_dp_train_fini(struct nv50_disp_priv
*, int, int, int, u16
, u16
,
84 u32
, struct dcb_output
*);
85 int nv94_sor_dp_train(struct nv50_disp_priv
*, int, int, u16
, u16
, u32
,
87 int nv94_sor_dp_lnkctl(struct nv50_disp_priv
*, int, int, int, u16
, u16
, u32
,
89 int nv94_sor_dp_drvctl(struct nv50_disp_priv
*, int, int, int, u16
, u16
, u32
,
92 int nvd0_sor_dp_train(struct nv50_disp_priv
*, int, int, u16
, u16
, u32
,
94 int nvd0_sor_dp_lnkctl(struct nv50_disp_priv
*, int, int, int, u16
, u16
, u32
,
96 int nvd0_sor_dp_drvctl(struct nv50_disp_priv
*, int, int, int, u16
, u16
, u32
,
99 int nv50_pior_power(NV50_DISP_MTHD_V1
);
101 struct nv50_disp_base
{
102 struct nouveau_parent base
;
103 struct nouveau_ramht
*ramht
;
107 struct nv50_disp_chan_impl
{
108 struct nouveau_ofuncs base
;
110 int (*attach
)(struct nouveau_object
*, struct nouveau_object
*, u32
);
111 void (*detach
)(struct nouveau_object
*, int);
114 struct nv50_disp_chan
{
115 struct nouveau_namedb base
;
119 u32
nv50_disp_chan_rd32(struct nouveau_object
*, u64
);
120 void nv50_disp_chan_wr32(struct nouveau_object
*, u64
, u32
);
122 #define nv50_disp_chan_init(a) \
123 nouveau_namedb_init(&(a)->base)
124 #define nv50_disp_chan_fini(a,b) \
125 nouveau_namedb_fini(&(a)->base, (b))
127 struct nv50_disp_dmac
{
128 struct nv50_disp_chan base
;
129 struct nouveau_dmaobj
*pushdma
;
133 void nv50_disp_dmac_dtor(struct nouveau_object
*);
135 struct nv50_disp_pioc
{
136 struct nv50_disp_chan base
;
139 void nv50_disp_pioc_dtor(struct nouveau_object
*);
141 struct nv50_disp_mthd_list
{
151 struct nv50_disp_mthd_chan
{
157 const struct nv50_disp_mthd_list
*mthd
;
161 extern struct nv50_disp_chan_impl nv50_disp_mast_ofuncs
;
162 int nv50_disp_mast_ctor(struct nouveau_object
*, struct nouveau_object
*,
163 struct nouveau_oclass
*, void *, u32
,
164 struct nouveau_object
**);
165 extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_base
;
166 extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_sor
;
167 extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_pior
;
168 extern struct nv50_disp_chan_impl nv50_disp_sync_ofuncs
;
169 int nv50_disp_sync_ctor(struct nouveau_object
*, struct nouveau_object
*,
170 struct nouveau_oclass
*, void *, u32
,
171 struct nouveau_object
**);
172 extern const struct nv50_disp_mthd_list nv50_disp_sync_mthd_image
;
173 extern struct nv50_disp_chan_impl nv50_disp_ovly_ofuncs
;
174 int nv50_disp_ovly_ctor(struct nouveau_object
*, struct nouveau_object
*,
175 struct nouveau_oclass
*, void *, u32
,
176 struct nouveau_object
**);
177 extern const struct nv50_disp_mthd_list nv50_disp_ovly_mthd_base
;
178 extern struct nv50_disp_chan_impl nv50_disp_oimm_ofuncs
;
179 int nv50_disp_oimm_ctor(struct nouveau_object
*, struct nouveau_object
*,
180 struct nouveau_oclass
*, void *, u32
,
181 struct nouveau_object
**);
182 extern struct nv50_disp_chan_impl nv50_disp_curs_ofuncs
;
183 int nv50_disp_curs_ctor(struct nouveau_object
*, struct nouveau_object
*,
184 struct nouveau_oclass
*, void *, u32
,
185 struct nouveau_object
**);
186 extern struct nouveau_ofuncs nv50_disp_base_ofuncs
;
187 int nv50_disp_base_ctor(struct nouveau_object
*, struct nouveau_object
*,
188 struct nouveau_oclass
*, void *, u32
,
189 struct nouveau_object
**);
190 void nv50_disp_base_dtor(struct nouveau_object
*);
191 extern struct nouveau_omthds nv50_disp_base_omthds
[];
192 extern struct nouveau_oclass nv50_disp_cclass
;
193 void nv50_disp_mthd_chan(struct nv50_disp_priv
*, int debug
, int head
,
194 const struct nv50_disp_mthd_chan
*);
195 void nv50_disp_intr_supervisor(struct work_struct
*);
196 void nv50_disp_intr(struct nouveau_subdev
*);
197 extern const struct nvkm_event_func nv50_disp_vblank_func
;
199 extern const struct nv50_disp_mthd_chan nv84_disp_mast_mthd_chan
;
200 extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_dac
;
201 extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_head
;
202 extern const struct nv50_disp_mthd_chan nv84_disp_sync_mthd_chan
;
203 extern const struct nv50_disp_mthd_chan nv84_disp_ovly_mthd_chan
;
205 extern const struct nv50_disp_mthd_chan nv94_disp_mast_mthd_chan
;
207 extern struct nv50_disp_chan_impl nvd0_disp_mast_ofuncs
;
208 extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_base
;
209 extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_dac
;
210 extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_sor
;
211 extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_pior
;
212 extern struct nv50_disp_chan_impl nvd0_disp_sync_ofuncs
;
213 extern struct nv50_disp_chan_impl nvd0_disp_ovly_ofuncs
;
214 extern const struct nv50_disp_mthd_chan nvd0_disp_sync_mthd_chan
;
215 extern struct nv50_disp_chan_impl nvd0_disp_oimm_ofuncs
;
216 extern struct nv50_disp_chan_impl nvd0_disp_curs_ofuncs
;
217 extern struct nouveau_ofuncs nvd0_disp_base_ofuncs
;
218 extern struct nouveau_oclass nvd0_disp_cclass
;
219 void nvd0_disp_intr_supervisor(struct work_struct
*);
220 void nvd0_disp_intr(struct nouveau_subdev
*);
221 extern const struct nvkm_event_func nvd0_disp_vblank_func
;
223 extern const struct nv50_disp_mthd_chan nve0_disp_mast_mthd_chan
;
224 extern const struct nv50_disp_mthd_chan nve0_disp_ovly_mthd_chan
;
226 extern struct nvkm_output_dp_impl nv50_pior_dp_impl
;
227 extern struct nouveau_oclass
*nv50_disp_outp_sclass
[];
229 extern struct nvkm_output_dp_impl nv94_sor_dp_impl
;
230 int nv94_sor_dp_lnk_pwr(struct nvkm_output_dp
*, int);
231 extern struct nouveau_oclass
*nv94_disp_outp_sclass
[];
233 extern struct nvkm_output_dp_impl nvd0_sor_dp_impl
;
234 extern struct nouveau_oclass
*nvd0_disp_outp_sclass
[];