drm/nouveau/disp: audit and version display classes
[deliverable/linux.git] / drivers / gpu / drm / nouveau / core / engine / disp / nv50.h
1 #ifndef __NV50_DISP_H__
2 #define __NV50_DISP_H__
3
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>
9
10 #include <engine/dmaobj.h>
11
12 #include "dport.h"
13 #include "priv.h"
14 #include "outp.h"
15 #include "outpdp.h"
16
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
21
22 struct nv50_disp_priv {
23 struct nouveau_disp base;
24 struct nouveau_oclass *sclass;
25
26 struct work_struct supervisor;
27 u32 super;
28
29 struct {
30 int nr;
31 } head;
32 struct {
33 int nr;
34 int (*power)(NV50_DISP_MTHD_V1);
35 int (*sense)(NV50_DISP_MTHD_V1);
36 } dac;
37 struct {
38 int nr;
39 int (*power)(NV50_DISP_MTHD_V1);
40 int (*hda_eld)(NV50_DISP_MTHD_V1);
41 int (*hdmi)(NV50_DISP_MTHD_V1);
42 u32 lvdsconf;
43 } sor;
44 struct {
45 int nr;
46 int (*power)(NV50_DISP_MTHD_V1);
47 u8 type[3];
48 } pior;
49 };
50
51 struct nv50_disp_impl {
52 struct nouveau_disp_impl base;
53 struct {
54 const struct nv50_disp_mthd_chan *core;
55 const struct nv50_disp_mthd_chan *base;
56 const struct nv50_disp_mthd_chan *ovly;
57 int prev;
58 } mthd;
59 struct {
60 int (*scanoutpos)(NV50_DISP_MTHD_V0);
61 } head;
62 };
63
64 int nv50_disp_base_scanoutpos(NV50_DISP_MTHD_V0);
65 int nv50_disp_base_mthd(struct nouveau_object *, u32, void *, u32);
66
67 int nvd0_disp_base_scanoutpos(NV50_DISP_MTHD_V0);
68
69 int nv50_dac_power(NV50_DISP_MTHD_V1);
70 int nv50_dac_sense(NV50_DISP_MTHD_V1);
71
72 int nva3_hda_eld(NV50_DISP_MTHD_V1);
73 int nvd0_hda_eld(NV50_DISP_MTHD_V1);
74
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);
78
79 int nv50_sor_power(NV50_DISP_MTHD_V1);
80
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,
86 struct dcb_output *);
87 int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
88 struct dcb_output *);
89 int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
90 struct dcb_output *);
91
92 int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
93 struct dcb_output *);
94 int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
95 struct dcb_output *);
96 int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
97 struct dcb_output *);
98
99 int nv50_pior_power(NV50_DISP_MTHD_V1);
100
101 struct nv50_disp_base {
102 struct nouveau_parent base;
103 struct nouveau_ramht *ramht;
104 u32 chan;
105 };
106
107 struct nv50_disp_chan_impl {
108 struct nouveau_ofuncs base;
109 int chid;
110 int (*attach)(struct nouveau_object *, struct nouveau_object *, u32);
111 void (*detach)(struct nouveau_object *, int);
112 };
113
114 struct nv50_disp_chan {
115 struct nouveau_namedb base;
116 int chid;
117 };
118
119 u32 nv50_disp_chan_rd32(struct nouveau_object *, u64);
120 void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32);
121
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))
126
127 struct nv50_disp_dmac {
128 struct nv50_disp_chan base;
129 struct nouveau_dmaobj *pushdma;
130 u32 push;
131 };
132
133 void nv50_disp_dmac_dtor(struct nouveau_object *);
134
135 struct nv50_disp_pioc {
136 struct nv50_disp_chan base;
137 };
138
139 void nv50_disp_pioc_dtor(struct nouveau_object *);
140
141 struct nv50_disp_mthd_list {
142 u32 mthd;
143 u32 addr;
144 struct {
145 u32 mthd;
146 u32 addr;
147 const char *name;
148 } data[];
149 };
150
151 struct nv50_disp_mthd_chan {
152 const char *name;
153 u32 addr;
154 struct {
155 const char *name;
156 int nr;
157 const struct nv50_disp_mthd_list *mthd;
158 } data[];
159 };
160
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;
198
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;
204
205 extern const struct nv50_disp_mthd_chan nv94_disp_mast_mthd_chan;
206
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;
222
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;
225
226 extern struct nvkm_output_dp_impl nv50_pior_dp_impl;
227 extern struct nouveau_oclass *nv50_disp_outp_sclass[];
228
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[];
232
233 extern struct nvkm_output_dp_impl nvd0_sor_dp_impl;
234 extern struct nouveau_oclass *nvd0_disp_outp_sclass[];
235
236 #endif
This page took 0.034672 seconds and 5 git commands to generate.