drm/nvd0/disp: calculate U script id in supervisor interrupt
[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/ramht.h>
7
8 #include <engine/dmaobj.h>
9 #include <engine/disp.h>
10
11 struct dcb_output;
12
13 struct nv50_disp_priv {
14 struct nouveau_disp base;
15 struct nouveau_oclass *sclass;
16 struct {
17 int nr;
18 } head;
19 struct {
20 int nr;
21 int (*power)(struct nv50_disp_priv *, int dac, u32 data);
22 int (*sense)(struct nv50_disp_priv *, int dac, u32 load);
23 } dac;
24 struct {
25 int nr;
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,
31 struct dcb_output *);
32 int (*dp_lnkctl)(struct nv50_disp_priv *, int sor, int link,
33 int head, u16 type, u16 mask, u32 data,
34 struct dcb_output *);
35 int (*dp_drvctl)(struct nv50_disp_priv *, int sor, int link,
36 int lane, u16 type, u16 mask, u32 data,
37 struct dcb_output *);
38 u32 lvdsconf;
39 } sor;
40 };
41
42 #define DAC_MTHD(n) (n), (n) + 0x03
43
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);
47
48 #define SOR_MTHD(n) (n), (n) + 0x3f
49
50 int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
51 int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
52
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);
56
57 int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
58 int nv50_sor_power(struct nv50_disp_priv *, int, u32);
59
60 int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
61 struct dcb_output *);
62 int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
63 struct dcb_output *);
64 int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
65 struct dcb_output *);
66
67 int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
68 struct dcb_output *);
69 int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
70 struct dcb_output *);
71 int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
72 struct dcb_output *);
73
74 struct nv50_disp_base {
75 struct nouveau_parent base;
76 struct nouveau_ramht *ramht;
77 u32 chan;
78 };
79
80 struct nv50_disp_chan {
81 struct nouveau_namedb base;
82 int chid;
83 };
84
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);
90
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))
95
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 *);
99
100 struct nv50_disp_dmac {
101 struct nv50_disp_chan base;
102 struct nouveau_dmaobj *pushdma;
103 u32 push;
104 };
105
106 struct nv50_disp_pioc {
107 struct nv50_disp_chan base;
108 };
109
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 *);
118
119 extern struct nouveau_omthds nv84_disp_base_omthds[];
120
121 extern struct nouveau_omthds nva3_disp_base_omthds[];
122
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 *);
131
132 #endif
This page took 0.136103 seconds and 5 git commands to generate.