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>
15 struct nv50_disp_impl {
16 struct nouveau_disp_impl base;
18 const struct nv50_disp_mthd_chan *core;
19 const struct nv50_disp_mthd_chan *base;
20 const struct nv50_disp_mthd_chan *ovly;
25 struct nv50_disp_priv {
26 struct nouveau_disp base;
27 struct nouveau_oclass *sclass;
29 struct work_struct supervisor;
37 int (*power)(struct nv50_disp_priv *, int dac, u32 data);
38 int (*sense)(struct nv50_disp_priv *, int dac, u32 load);
42 int (*power)(struct nv50_disp_priv *, int sor, u32 data);
43 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32);
44 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32);
46 const struct nouveau_dp_func *dp;
50 int (*power)(struct nv50_disp_priv *, int ext, u32 data);
52 const struct nouveau_dp_func *dp;
56 #define HEAD_MTHD(n) (n), (n) + 0x03
58 int nv50_disp_base_scanoutpos(struct nouveau_object *, u32, void *, u32);
60 #define DAC_MTHD(n) (n), (n) + 0x03
62 int nv50_dac_mthd(struct nouveau_object *, u32, void *, u32);
63 int nv50_dac_power(struct nv50_disp_priv *, int, u32);
64 int nv50_dac_sense(struct nv50_disp_priv *, int, u32);
66 #define SOR_MTHD(n) (n), (n) + 0x3f
68 int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
69 int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
71 int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
72 int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
73 int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
75 int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
76 int nv50_sor_power(struct nv50_disp_priv *, int, u32);
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 *);
82 int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
84 int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
86 int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
89 int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
91 int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
93 int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
96 #define PIOR_MTHD(n) (n), (n) + 0x03
98 int nv50_pior_mthd(struct nouveau_object *, u32, void *, u32);
99 int nv50_pior_power(struct nv50_disp_priv *, int, u32);
101 struct nv50_disp_base {
102 struct nouveau_parent base;
103 struct nouveau_ramht *ramht;
107 struct nv50_disp_chan {
108 struct nouveau_namedb base;
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);
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))
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 *);
127 struct nv50_disp_dmac {
128 struct nv50_disp_chan base;
129 struct nouveau_dmaobj *pushdma;
133 struct nv50_disp_pioc {
134 struct nv50_disp_chan base;
137 struct nv50_disp_mthd_list {
147 struct nv50_disp_mthd_chan {
153 const struct nv50_disp_mthd_list *mthd;
157 extern struct nouveau_ofuncs nv50_disp_mast_ofuncs;
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;
161 extern struct nouveau_ofuncs nv50_disp_sync_ofuncs;
162 extern const struct nv50_disp_mthd_list nv50_disp_sync_mthd_image;
163 extern struct nouveau_ofuncs nv50_disp_ovly_ofuncs;
164 extern const struct nv50_disp_mthd_list nv50_disp_ovly_mthd_base;
165 extern struct nouveau_ofuncs nv50_disp_oimm_ofuncs;
166 extern struct nouveau_ofuncs nv50_disp_curs_ofuncs;
167 extern struct nouveau_ofuncs nv50_disp_base_ofuncs;
168 extern struct nouveau_oclass nv50_disp_cclass;
169 void nv50_disp_mthd_chan(struct nv50_disp_priv *, int debug, int head,
170 const struct nv50_disp_mthd_chan *);
171 void nv50_disp_intr_supervisor(struct work_struct *);
172 void nv50_disp_intr(struct nouveau_subdev *);
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;
179 extern struct nouveau_omthds nv84_disp_base_omthds[];
181 extern const struct nv50_disp_mthd_chan nv94_disp_mast_mthd_chan;
183 extern struct nouveau_ofuncs nvd0_disp_mast_ofuncs;
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;
188 extern struct nouveau_ofuncs nvd0_disp_sync_ofuncs;
189 extern struct nouveau_ofuncs nvd0_disp_ovly_ofuncs;
190 extern const struct nv50_disp_mthd_chan nvd0_disp_sync_mthd_chan;
191 extern struct nouveau_ofuncs nvd0_disp_oimm_ofuncs;
192 extern struct nouveau_ofuncs nvd0_disp_curs_ofuncs;
193 extern struct nouveau_omthds nvd0_disp_base_omthds[];
194 extern struct nouveau_ofuncs nvd0_disp_base_ofuncs;
195 extern struct nouveau_oclass nvd0_disp_cclass;
196 void nvd0_disp_intr_supervisor(struct work_struct *);
197 void nvd0_disp_intr(struct nouveau_subdev *);
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;