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"
7struct nv50_disp_root;
8
9struct 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
26struct 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
34int 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 **);
38int 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
43void nv50_disp_chan_intr(struct nv50_disp_chan *, bool);
44u64 nv50_disp_chan_user(struct nv50_disp_chan *, u64 *);
45extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
46extern const struct nv50_disp_chan_func nv50_disp_dmac_func;
47int nv50_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
48extern const struct nv50_disp_chan_func nv50_disp_core_func;
49
50void gf119_disp_chan_intr(struct nv50_disp_chan *, bool);
51extern const struct nv50_disp_chan_func gf119_disp_pioc_func;
52extern const struct nv50_disp_chan_func gf119_disp_dmac_func;
53void gf119_disp_dmac_fini(struct nv50_disp_chan *);
54int gf119_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
55extern const struct nv50_disp_chan_func gf119_disp_core_func;
56void gf119_disp_core_fini(struct nv50_disp_chan *);
57
58extern const struct nv50_disp_chan_func gp102_disp_dmac_func;
59
60u64 gv100_disp_chan_user(struct nv50_disp_chan *, u64 *);
61int gv100_disp_dmac_init(struct nv50_disp_chan *);
62void gv100_disp_dmac_fini(struct nv50_disp_chan *);
63int gv100_disp_dmac_bind(struct nv50_disp_chan *, struct nvkm_object *, u32);
64
65int 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 **);
69int 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 **);
73int 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 **);
78int 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 **);
83int 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
89int nv50_disp_curs_new(const struct nvkm_oclass *, void *, u32,
90 struct nv50_disp *, struct nvkm_object **);
91int nv50_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
92 struct nv50_disp *, struct nvkm_object **);
93int nv50_disp_base_new(const struct nvkm_oclass *, void *, u32,
94 struct nv50_disp *, struct nvkm_object **);
95int nv50_disp_core_new(const struct nvkm_oclass *, void *, u32,
96 struct nv50_disp *, struct nvkm_object **);
97int nv50_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
98 struct nv50_disp *, struct nvkm_object **);
99
100int g84_disp_base_new(const struct nvkm_oclass *, void *, u32,
101 struct nv50_disp *, struct nvkm_object **);
102int g84_disp_core_new(const struct nvkm_oclass *, void *, u32,
103 struct nv50_disp *, struct nvkm_object **);
104int g84_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
105 struct nv50_disp *, struct nvkm_object **);
106
107int g94_disp_core_new(const struct nvkm_oclass *, void *, u32,
108 struct nv50_disp *, struct nvkm_object **);
109
110int gt200_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
111 struct nv50_disp *, struct nvkm_object **);
112
113int gf119_disp_curs_new(const struct nvkm_oclass *, void *, u32,
114 struct nv50_disp *, struct nvkm_object **);
115int gf119_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
116 struct nv50_disp *, struct nvkm_object **);
117int gf119_disp_base_new(const struct nvkm_oclass *, void *, u32,
118 struct nv50_disp *, struct nvkm_object **);
119int gf119_disp_core_new(const struct nvkm_oclass *, void *, u32,
120 struct nv50_disp *, struct nvkm_object **);
121int gf119_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
122 struct nv50_disp *, struct nvkm_object **);
123
124int gk104_disp_core_new(const struct nvkm_oclass *, void *, u32,
125 struct nv50_disp *, struct nvkm_object **);
126int gk104_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
127 struct nv50_disp *, struct nvkm_object **);
128
129int gp102_disp_curs_new(const struct nvkm_oclass *, void *, u32,
130 struct nv50_disp *, struct nvkm_object **);
131int gp102_disp_oimm_new(const struct nvkm_oclass *, void *, u32,
132 struct nv50_disp *, struct nvkm_object **);
133int gp102_disp_base_new(const struct nvkm_oclass *, void *, u32,
134 struct nv50_disp *, struct nvkm_object **);
135int gp102_disp_core_new(const struct nvkm_oclass *, void *, u32,
136 struct nv50_disp *, struct nvkm_object **);
137int gp102_disp_ovly_new(const struct nvkm_oclass *, void *, u32,
138 struct nv50_disp *, struct nvkm_object **);
139
140int gv100_disp_curs_new(const struct nvkm_oclass *, void *, u32,
141 struct nv50_disp *, struct nvkm_object **);
142int gv100_disp_wimm_new(const struct nvkm_oclass *, void *, u32,
143 struct nv50_disp *, struct nvkm_object **);
144int gv100_disp_core_new(const struct nvkm_oclass *, void *, u32,
145 struct nv50_disp *, struct nvkm_object **);
146int gv100_disp_wndw_new(const struct nvkm_oclass *, void *, u32,
147 struct nv50_disp *, struct nvkm_object **);
148
149struct 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
159struct 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
170void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
171
172extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
173extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
174extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
175extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;
176
177extern const struct nv50_disp_chan_mthd g84_disp_core_mthd;
178extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
179extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
180
181extern const struct nv50_disp_chan_mthd g94_disp_core_mthd;
182
183extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base;
184extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac;
185extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor;
186extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior;
187extern const struct nv50_disp_chan_mthd gf119_disp_base_mthd;
188
189extern const struct nv50_disp_chan_mthd gk104_disp_core_mthd;
190extern const struct nv50_disp_chan_mthd gk104_disp_ovly_mthd;
191#endif
192