drm/nv50-/disp: audit and version DAC_LOAD method
[deliverable/linux.git] / drivers / gpu / drm / nouveau / core / engine / disp / nv50.h
CommitLineData
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
17struct 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
bf0eb898
BS
27#define NV50_DISP_MTHD_ struct nouveau_object *object, \
28 struct nv50_disp_priv *priv, void *data, u32 size
29#define NV50_DISP_MTHD_V0 NV50_DISP_MTHD_, int head
30#define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
31
70cabe4a
BS
32struct nv50_disp_priv {
33 struct nouveau_disp base;
34 struct nouveau_oclass *sclass;
5cc027f6
BS
35
36 struct work_struct supervisor;
37 u32 super;
38
70cabe4a
BS
39 struct {
40 int nr;
41 } head;
42 struct {
43 int nr;
bf0eb898 44 int (*power)(NV50_DISP_MTHD_V1);
c4abd317 45 int (*sense)(NV50_DISP_MTHD_V1);
70cabe4a
BS
46 } dac;
47 struct {
48 int nr;
74b66850 49 int (*power)(struct nv50_disp_priv *, int sor, u32 data);
0a9e2b95 50 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32);
1c30cd09 51 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32);
4a230fa6 52 u32 lvdsconf;
70cabe4a 53 } sor;
a2bc283f
BS
54 struct {
55 int nr;
56 int (*power)(struct nv50_disp_priv *, int ext, u32 data);
57 u8 type[3];
a2bc283f 58 } pior;
70cabe4a
BS
59};
60
d2fa7d32
BS
61#define HEAD_MTHD(n) (n), (n) + 0x03
62
63int nv50_disp_base_scanoutpos(struct nouveau_object *, u32, void *, u32);
bf0eb898 64int nv50_disp_base_mthd(struct nouveau_object *, u32, void *, u32);
d2fa7d32 65
35b21d39
BS
66#define DAC_MTHD(n) (n), (n) + 0x03
67
bf0eb898 68int nv50_dac_power(NV50_DISP_MTHD_V1);
c4abd317 69int nv50_dac_sense(NV50_DISP_MTHD_V1);
35b21d39 70
6c5a0424
BS
71#define SOR_MTHD(n) (n), (n) + 0x3f
72
a4feaf4e
BS
73int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
74int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
75
8e9e3d2d
BS
76int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
77int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
a4feaf4e
BS
78int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
79
6c5a0424 80int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
74b66850 81int nv50_sor_power(struct nv50_disp_priv *, int, u32);
6c5a0424 82
8f2abc25
BS
83int nv94_sor_dp_train_init(struct nv50_disp_priv *, int, int, int, u16, u16,
84 u32, struct dcb_output *);
85int nv94_sor_dp_train_fini(struct nv50_disp_priv *, int, int, int, u16, u16,
86 u32, struct dcb_output *);
f7960736
BS
87int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
88 struct dcb_output *);
89int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
90 struct dcb_output *);
91int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
92 struct dcb_output *);
93
6c5a0424
BS
94int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
95 struct dcb_output *);
96int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
97 struct dcb_output *);
98int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
99 struct dcb_output *);
100
a2bc283f
BS
101#define PIOR_MTHD(n) (n), (n) + 0x03
102
103int nv50_pior_mthd(struct nouveau_object *, u32, void *, u32);
104int nv50_pior_power(struct nv50_disp_priv *, int, u32);
105
70cabe4a
BS
106struct nv50_disp_base {
107 struct nouveau_parent base;
370c00f9
BS
108 struct nouveau_ramht *ramht;
109 u32 chan;
70cabe4a
BS
110};
111
2c04ae01
BS
112struct nv50_disp_chan_impl {
113 struct nouveau_ofuncs base;
114 int chid;
115 int (*attach)(struct nouveau_object *, struct nouveau_object *, u32);
116 void (*detach)(struct nouveau_object *, int);
117};
118
70cabe4a 119struct nv50_disp_chan {
370c00f9
BS
120 struct nouveau_namedb base;
121 int chid;
122};
123
370c00f9
BS
124u32 nv50_disp_chan_rd32(struct nouveau_object *, u64);
125void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32);
126
127#define nv50_disp_chan_init(a) \
128 nouveau_namedb_init(&(a)->base)
129#define nv50_disp_chan_fini(a,b) \
130 nouveau_namedb_fini(&(a)->base, (b))
131
370c00f9
BS
132struct nv50_disp_dmac {
133 struct nv50_disp_chan base;
134 struct nouveau_dmaobj *pushdma;
135 u32 push;
136};
137
2c04ae01
BS
138void nv50_disp_dmac_dtor(struct nouveau_object *);
139
370c00f9
BS
140struct nv50_disp_pioc {
141 struct nv50_disp_chan base;
70cabe4a
BS
142};
143
2c04ae01
BS
144void nv50_disp_pioc_dtor(struct nouveau_object *);
145
d67d92c0
BS
146struct nv50_disp_mthd_list {
147 u32 mthd;
148 u32 addr;
149 struct {
150 u32 mthd;
151 u32 addr;
152 const char *name;
153 } data[];
154};
155
156struct nv50_disp_mthd_chan {
157 const char *name;
158 u32 addr;
159 struct {
160 const char *name;
161 int nr;
162 const struct nv50_disp_mthd_list *mthd;
163 } data[];
164};
165
2c04ae01
BS
166extern struct nv50_disp_chan_impl nv50_disp_mast_ofuncs;
167int nv50_disp_mast_ctor(struct nouveau_object *, struct nouveau_object *,
168 struct nouveau_oclass *, void *, u32,
169 struct nouveau_object **);
d67d92c0
BS
170extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_base;
171extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_sor;
172extern const struct nv50_disp_mthd_list nv50_disp_mast_mthd_pior;
2c04ae01
BS
173extern struct nv50_disp_chan_impl nv50_disp_sync_ofuncs;
174int nv50_disp_sync_ctor(struct nouveau_object *, struct nouveau_object *,
175 struct nouveau_oclass *, void *, u32,
176 struct nouveau_object **);
d67d92c0 177extern const struct nv50_disp_mthd_list nv50_disp_sync_mthd_image;
2c04ae01
BS
178extern struct nv50_disp_chan_impl nv50_disp_ovly_ofuncs;
179int nv50_disp_ovly_ctor(struct nouveau_object *, struct nouveau_object *,
180 struct nouveau_oclass *, void *, u32,
181 struct nouveau_object **);
d67d92c0 182extern const struct nv50_disp_mthd_list nv50_disp_ovly_mthd_base;
2c04ae01
BS
183extern struct nv50_disp_chan_impl nv50_disp_oimm_ofuncs;
184int nv50_disp_oimm_ctor(struct nouveau_object *, struct nouveau_object *,
185 struct nouveau_oclass *, void *, u32,
186 struct nouveau_object **);
187extern struct nv50_disp_chan_impl nv50_disp_curs_ofuncs;
188int nv50_disp_curs_ctor(struct nouveau_object *, struct nouveau_object *,
189 struct nouveau_oclass *, void *, u32,
190 struct nouveau_object **);
70cabe4a 191extern struct nouveau_ofuncs nv50_disp_base_ofuncs;
79ca2770
BS
192int nv50_disp_base_ctor(struct nouveau_object *, struct nouveau_object *,
193 struct nouveau_oclass *, void *, u32,
194 struct nouveau_object **);
195void nv50_disp_base_dtor(struct nouveau_object *);
70cabe4a 196extern struct nouveau_oclass nv50_disp_cclass;
d67d92c0
BS
197void nv50_disp_mthd_chan(struct nv50_disp_priv *, int debug, int head,
198 const struct nv50_disp_mthd_chan *);
5cc027f6 199void nv50_disp_intr_supervisor(struct work_struct *);
70cabe4a 200void nv50_disp_intr(struct nouveau_subdev *);
79ca2770 201extern const struct nvkm_event_func nv50_disp_vblank_func;
70cabe4a 202
d67d92c0
BS
203extern const struct nv50_disp_mthd_chan nv84_disp_mast_mthd_chan;
204extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_dac;
205extern const struct nv50_disp_mthd_list nv84_disp_mast_mthd_head;
206extern const struct nv50_disp_mthd_chan nv84_disp_sync_mthd_chan;
207extern const struct nv50_disp_mthd_chan nv84_disp_ovly_mthd_chan;
ef22c8bb
BS
208extern struct nouveau_omthds nv84_disp_base_omthds[];
209
d67d92c0
BS
210extern const struct nv50_disp_mthd_chan nv94_disp_mast_mthd_chan;
211
2c04ae01 212extern struct nv50_disp_chan_impl nvd0_disp_mast_ofuncs;
d67d92c0
BS
213extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_base;
214extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_dac;
215extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_sor;
216extern const struct nv50_disp_mthd_list nvd0_disp_mast_mthd_pior;
2c04ae01
BS
217extern struct nv50_disp_chan_impl nvd0_disp_sync_ofuncs;
218extern struct nv50_disp_chan_impl nvd0_disp_ovly_ofuncs;
d67d92c0 219extern const struct nv50_disp_mthd_chan nvd0_disp_sync_mthd_chan;
2c04ae01
BS
220extern struct nv50_disp_chan_impl nvd0_disp_oimm_ofuncs;
221extern struct nv50_disp_chan_impl nvd0_disp_curs_ofuncs;
d2fa7d32 222extern struct nouveau_omthds nvd0_disp_base_omthds[];
46654061
BS
223extern struct nouveau_ofuncs nvd0_disp_base_ofuncs;
224extern struct nouveau_oclass nvd0_disp_cclass;
5cc027f6 225void nvd0_disp_intr_supervisor(struct work_struct *);
46654061 226void nvd0_disp_intr(struct nouveau_subdev *);
79ca2770 227extern const struct nvkm_event_func nvd0_disp_vblank_func;
46654061 228
d67d92c0
BS
229extern const struct nv50_disp_mthd_chan nve0_disp_mast_mthd_chan;
230extern const struct nv50_disp_mthd_chan nve0_disp_ovly_mthd_chan;
231
b8407c9e
BS
232extern struct nvkm_output_dp_impl nv50_pior_dp_impl;
233extern struct nouveau_oclass *nv50_disp_outp_sclass[];
234
235extern struct nvkm_output_dp_impl nv94_sor_dp_impl;
1ecee1cd 236int nv94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
b8407c9e
BS
237extern struct nouveau_oclass *nv94_disp_outp_sclass[];
238
239extern struct nvkm_output_dp_impl nvd0_sor_dp_impl;
240extern struct nouveau_oclass *nvd0_disp_outp_sclass[];
241
70cabe4a 242#endif
This page took 0.129018 seconds and 5 git commands to generate.