1
2 #ifndef __NV50_DISP_CHAN_H__
3 #define __NV50_DISP_CHAN_H__
4 #define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
5 #include <core/object.h>
6 #include "nv50.h"
7 struct nv50_disp_root;
8
9 struct nv50_disp_chan {
10 const struct nv50_disp_chan_func *func;
11 const struct nv50_disp_chan_mthd *mthd;
12 struct nv50_disp *disp;
13
14 struct {
15 int ctrl;
16 int user;
17 } chid;
18 int head;
19
20 struct nvkm_object object;
21
22 struct nvkm_memory *memory;
23 u64 push;
24 };
25
26 struct nv50_disp_chan_func {
27 int (*init)(struct nv50_disp_chan *);
28 void (*fini)(struct nv50_disp_chan *);
29 void (*intr)(struct nv50_disp_chan *, bool en);
30 u64 (*user)(struct nv50_disp_chan *, u64 *size);
31 int (*bind)(struct nv50_disp_chan *, struct nvkm_object *, u32 handle);
32 };
33
34 int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
35 const struct nv50_disp_chan_mthd *,
36 struct nv50_disp *, int ctrl, int user, int head,
37 const struct nvkm_oclass *, struct nvkm_object **);
38 int nv50_disp_dmac_new_(const struct nv50_disp_chan_func *,
39 const struct nv50_disp_chan_mthd *,
40 struct nv50_disp *, int chid, int head, u64 push,
41 const struct nvkm_oclass *, struct nvkm_object **);
42
43 void nv50_disp_chan_intr(struct nv50_disp_chan *, bool);
44 u64 nv50_disp_chan_user(struct nv50_disp_chan *, u64 *);
45 extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
46 extern const struct nv50_disp_chan_func nv50_disp_dmac_func;
47 int nv50_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
48 extern const struct nv50_disp_chan_func nv50_disp_core_func;
49
50 void gf119_disp_chan_intr(struct nv50_disp_chan *, bool);
51 extern const struct nv50_disp_chan_func gf119_disp_pioc_func;
52 extern const struct nv50_disp_chan_func gf119_disp_dmac_func;
53 void gf119_disp_dmac_fini(struct nv50_disp_chan *);
54 int gf119_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
55 extern const struct nv50_disp_chan_func gf119_disp_core_func;
56 void gf119_disp_core_fini(struct nv50_disp_chan *);
57
58 extern const struct nv50_disp_chan_func gp102_disp_dmac_func;
59
60 u64 gv100_disp_chan_user(struct nv50_disp_chan *, u64 *);
61 int gv100_disp_dmac_init(struct nv50_disp_chan *);
62 void gv100_disp_dmac_fini(struct nv50_disp_chan *);
63 int gv100_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
64
65 int nv50_disp_curs_new_(const struct nv50_disp_chan_func *,
66 struct nv50_disp *, int ctrl, int user,
67 const struct nvkm_oclass *, void *argv, u32 argc,
68 struct nvkm_object **);
69 int nv50_disp_oimm_new_(const struct nv50_disp_chan_func *,
70 struct nv50_disp *, int ctrl, int user,
71 const struct nvkm_oclass *, void *argv, u32 argc,
72 struct nvkm_object **);
73 int nv50_disp_base_new_(const struct nv50_disp_chan_func *,
74 const struct nv50_disp_chan_mthd *,
75 struct nv50_disp *, int chid,
76 const struct nvkm_oclass *, void *argv, u32 argc,
77 struct nvkm_object **);
78 int nv50_disp_core_new_(const struct nv50_disp_chan_func *,
79 const struct nv50_disp_chan_mthd *,
80 struct nv50_disp *, int chid,
81 const struct nvkm_oclass *oclass, void *argv, u32 argc,
82 struct nvkm_object **);
83 int nv50_disp_ovly_new_(const struct nv50_disp_chan_func *,
84 const struct nv50_disp_chan_mthd *,
85 struct nv50_disp *, int chid,
86 const struct nvkm_oclass *, void *argv, u32 argc,
87 struct nvkm_object **);
88
89 int nv50_disp_curs_new(const struct nvkm_oclass *, void *, u32,
90 struct nv50_disp *, struct nvkm_object **);
91 int nv50_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
92 struct nv50_disp *, struct nvkm_object **);
93 int nv50_disp_base_new(const struct nvkm_oclass *, void *, u32,
94 struct nv50_disp *, struct nvkm_object **);
95 int nv50_disp_core_new(const struct nvkm_oclass *, void *, u32,
96 struct nv50_disp *, struct nvkm_object **);
97 int nv50_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
98 struct nv50_disp *, struct nvkm_object **);
99
100 int g84_disp_base_new(const struct nvkm_oclass *, void *, u32,
101 struct nv50_disp *, struct nvkm_object **);
102 int g84_disp_core_new(const struct nvkm_oclass *, void *, u32,
103 struct nv50_disp *, struct nvkm_object **);
104 int g84_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
105 struct nv50_disp *, struct nvkm_object **);
106
107 int g94_disp_core_new(const struct nvkm_oclass *, void *, u32,
108 struct nv50_disp *, struct nvkm_object **);
109
110 int gt200_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
111 struct nv50_disp *, struct nvkm_object **);
112
113 int gf119_disp_curs_new(const struct nvkm_oclass *, void *, u32,
114 struct nv50_disp *, struct nvkm_object **);
115 int gf119_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
116 struct nv50_disp *, struct nvkm_object **);
117 int gf119_disp_base_new(const struct nvkm_oclass *, void *, u32,
118 struct nv50_disp *, struct nvkm_object **);
119 int gf119_disp_core_new(const struct nvkm_oclass *, void *, u32,
120 struct nv50_disp *, struct nvkm_object **);
121 int gf119_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
122 struct nv50_disp *, struct nvkm_object **);
123
124 int gk104_disp_core_new(const struct nvkm_oclass *, void *, u32,
125 struct nv50_disp *, struct nvkm_object **);
126 int gk104_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
127 struct nv50_disp *, struct nvkm_object **);
128
129 int gp102_disp_curs_new(const struct nvkm_oclass *, void *, u32,
130 struct nv50_disp *, struct nvkm_object **);
131 int gp102_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
132 struct nv50_disp *, struct nvkm_object **);
133 int gp102_disp_base_new(const struct nvkm_oclass *, void *, u32,
134 struct nv50_disp *, struct nvkm_object **);
135 int gp102_disp_core_new(const struct nvkm_oclass *, void *, u32,
136 struct nv50_disp *, struct nvkm_object **);
137 int gp102_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
138 struct nv50_disp *, struct nvkm_object **);
139
140 int gv100_disp_curs_new(const struct nvkm_oclass *, void *, u32,
141 struct nv50_disp *, struct nvkm_object **);
142 int gv100_disp_wimm_new(const struct nvkm_oclass *, void *, u32,
143 struct nv50_disp *, struct nvkm_object **);
144 int gv100_disp_core_new(const struct nvkm_oclass *, void *, u32,
145 struct nv50_disp *, struct nvkm_object **);
146 int gv100_disp_wndw_new(const struct nvkm_oclass *, void *, u32,
147 struct nv50_disp *, struct nvkm_object **);
148
149 struct nv50_disp_mthd_list {
150 u32 mthd;
151 u32 addr;
152 struct {
153 u32 mthd;
154 u32 addr;
155 const char *name;
156 } data[];
157 };
158
159 struct nv50_disp_chan_mthd {
160 const char *name;
161 u32 addr;
162 s32 prev;
163 struct {
164 const char *name;
165 int nr;
166 const struct nv50_disp_mthd_list *mthd;
167 } data[];
168 };
169
170 void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
171
172 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
173 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
174 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
175 extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;
176
177 extern const struct nv50_disp_chan_mthd g84_disp_core_mthd;
178 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
179 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
180
181 extern const struct nv50_disp_chan_mthd g94_disp_core_mthd;
182
183 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base;
184 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac;
185 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor;
186 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior;
187 extern const struct nv50_disp_chan_mthd gf119_disp_base_mthd;
188
189 extern const struct nv50_disp_chan_mthd gk104_disp_core_mthd;
190 extern const struct nv50_disp_chan_mthd gk104_disp_ovly_mthd;
191 #endif