1 #ifndef __NV50_DISP_H__
2 #define __NV50_DISP_H__
4 #include <core/parent.h>
5 #include <core/namedb.h>
6 #include <core/ramht.h>
8 #include <engine/dmaobj.h>
9 #include <engine/disp.h>
13 struct nv50_disp_priv {
14 struct nouveau_disp base;
15 struct nouveau_oclass *sclass;
21 int (*power)(struct nv50_disp_priv *, int dac, u32 data);
22 int (*sense)(struct nv50_disp_priv *, int dac, u32 load);
26 int (*power)(struct nv50_disp_priv *, int sor, u32 data);
27 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32);
28 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32);
29 int (*dp_train)(struct nv50_disp_priv *, int sor, int link,
30 u16 type, u16 mask, u32 data,
32 int (*dp_lnkctl)(struct nv50_disp_priv *, int sor, int link,
33 int head, u16 type, u16 mask, u32 data,
35 int (*dp_drvctl)(struct nv50_disp_priv *, int sor, int link,
36 int lane, u16 type, u16 mask, u32 data,
42 #define DAC_MTHD(n) (n), (n) + 0x03
44 int nv50_dac_mthd(struct nouveau_object *, u32, void *, u32);
45 int nv50_dac_power(struct nv50_disp_priv *, int, u32);
46 int nv50_dac_sense(struct nv50_disp_priv *, int, u32);
48 #define SOR_MTHD(n) (n), (n) + 0x3f
50 int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
51 int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
53 int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
54 int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
55 int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
57 int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
58 int nv50_sor_power(struct nv50_disp_priv *, int, u32);
60 int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
62 int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
64 int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
67 int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
69 int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
71 int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
74 struct nv50_disp_base {
75 struct nouveau_parent base;
76 struct nouveau_ramht *ramht;
80 struct nv50_disp_chan {
81 struct nouveau_namedb base;
85 int nv50_disp_chan_create_(struct nouveau_object *, struct nouveau_object *,
86 struct nouveau_oclass *, int, int, void **);
87 void nv50_disp_chan_destroy(struct nv50_disp_chan *);
88 u32 nv50_disp_chan_rd32(struct nouveau_object *, u64);
89 void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32);
91 #define nv50_disp_chan_init(a) \
92 nouveau_namedb_init(&(a)->base)
93 #define nv50_disp_chan_fini(a,b) \
94 nouveau_namedb_fini(&(a)->base, (b))
96 int nv50_disp_dmac_create_(struct nouveau_object *, struct nouveau_object *,
97 struct nouveau_oclass *, u32, int, int, void **);
98 void nv50_disp_dmac_dtor(struct nouveau_object *);
100 struct nv50_disp_dmac {
101 struct nv50_disp_chan base;
102 struct nouveau_dmaobj *pushdma;
106 struct nv50_disp_pioc {
107 struct nv50_disp_chan base;
110 extern struct nouveau_ofuncs nv50_disp_mast_ofuncs;
111 extern struct nouveau_ofuncs nv50_disp_sync_ofuncs;
112 extern struct nouveau_ofuncs nv50_disp_ovly_ofuncs;
113 extern struct nouveau_ofuncs nv50_disp_oimm_ofuncs;
114 extern struct nouveau_ofuncs nv50_disp_curs_ofuncs;
115 extern struct nouveau_ofuncs nv50_disp_base_ofuncs;
116 extern struct nouveau_oclass nv50_disp_cclass;
117 void nv50_disp_intr(struct nouveau_subdev *);
119 extern struct nouveau_omthds nv84_disp_base_omthds[];
121 extern struct nouveau_omthds nva3_disp_base_omthds[];
123 extern struct nouveau_ofuncs nvd0_disp_mast_ofuncs;
124 extern struct nouveau_ofuncs nvd0_disp_sync_ofuncs;
125 extern struct nouveau_ofuncs nvd0_disp_ovly_ofuncs;
126 extern struct nouveau_ofuncs nvd0_disp_oimm_ofuncs;
127 extern struct nouveau_ofuncs nvd0_disp_curs_ofuncs;
128 extern struct nouveau_ofuncs nvd0_disp_base_ofuncs;
129 extern struct nouveau_oclass nvd0_disp_cclass;
130 void nvd0_disp_intr(struct nouveau_subdev *);