GNU Linux-libre 4.9-gnu1
[releases.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / channv50.h
1 #ifndef __NV50_DISP_CHAN_H__
2 #define __NV50_DISP_CHAN_H__
3 #define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
4 #include "nv50.h"
5
6 struct nv50_disp_chan {
7         const struct nv50_disp_chan_func *func;
8         const struct nv50_disp_chan_mthd *mthd;
9         struct nv50_disp_root *root;
10         int chid;
11         int head;
12
13         struct nvkm_object object;
14 };
15
16 struct nv50_disp_chan_func {
17         void *(*dtor)(struct nv50_disp_chan *);
18         int (*init)(struct nv50_disp_chan *);
19         void (*fini)(struct nv50_disp_chan *);
20         int (*child_get)(struct nv50_disp_chan *, int index,
21                          struct nvkm_oclass *);
22         int (*child_new)(struct nv50_disp_chan *, const struct nvkm_oclass *,
23                          void *data, u32 size, struct nvkm_object **);
24 };
25
26 int nv50_disp_chan_ctor(const struct nv50_disp_chan_func *,
27                         const struct nv50_disp_chan_mthd *,
28                         struct nv50_disp_root *, int chid, int head,
29                         const struct nvkm_oclass *, struct nv50_disp_chan *);
30 int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
31                         const struct nv50_disp_chan_mthd *,
32                         struct nv50_disp_root *, int chid, int head,
33                         const struct nvkm_oclass *, struct nvkm_object **);
34
35 extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
36 extern const struct nv50_disp_chan_func gf119_disp_pioc_func;
37
38 extern const struct nvkm_event_func nv50_disp_chan_uevent;
39 int  nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
40                                 struct nvkm_notify *);
41 void nv50_disp_chan_uevent_send(struct nv50_disp *, int);
42
43 extern const struct nvkm_event_func gf119_disp_chan_uevent;
44
45 struct nv50_disp_mthd_list {
46         u32 mthd;
47         u32 addr;
48         struct {
49                 u32 mthd;
50                 u32 addr;
51                 const char *name;
52         } data[];
53 };
54
55 struct nv50_disp_chan_mthd {
56         const char *name;
57         u32 addr;
58         s32 prev;
59         struct {
60                 const char *name;
61                 int nr;
62                 const struct nv50_disp_mthd_list *mthd;
63         } data[];
64 };
65
66 void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
67
68 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
69 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
70 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
71 extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;
72
73 extern const struct nv50_disp_chan_mthd g84_disp_core_chan_mthd;
74 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
75 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
76 extern const struct nv50_disp_chan_mthd g84_disp_base_chan_mthd;
77 extern const struct nv50_disp_chan_mthd g84_disp_ovly_chan_mthd;
78
79 extern const struct nv50_disp_chan_mthd g94_disp_core_chan_mthd;
80
81 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base;
82 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac;
83 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor;
84 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior;
85 extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd;
86
87 extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd;
88 extern const struct nv50_disp_chan_mthd gk104_disp_ovly_chan_mthd;
89
90 struct nv50_disp_pioc_oclass {
91         int (*ctor)(const struct nv50_disp_chan_func *,
92                     const struct nv50_disp_chan_mthd *,
93                     struct nv50_disp_root *, int chid,
94                     const struct nvkm_oclass *, void *data, u32 size,
95                     struct nvkm_object **);
96         struct nvkm_sclass base;
97         const struct nv50_disp_chan_func *func;
98         const struct nv50_disp_chan_mthd *mthd;
99         int chid;
100 };
101
102 extern const struct nv50_disp_pioc_oclass nv50_disp_oimm_oclass;
103 extern const struct nv50_disp_pioc_oclass nv50_disp_curs_oclass;
104
105 extern const struct nv50_disp_pioc_oclass g84_disp_oimm_oclass;
106 extern const struct nv50_disp_pioc_oclass g84_disp_curs_oclass;
107
108 extern const struct nv50_disp_pioc_oclass gt215_disp_oimm_oclass;
109 extern const struct nv50_disp_pioc_oclass gt215_disp_curs_oclass;
110
111 extern const struct nv50_disp_pioc_oclass gf119_disp_oimm_oclass;
112 extern const struct nv50_disp_pioc_oclass gf119_disp_curs_oclass;
113
114 extern const struct nv50_disp_pioc_oclass gk104_disp_oimm_oclass;
115 extern const struct nv50_disp_pioc_oclass gk104_disp_curs_oclass;
116
117
118 int nv50_disp_curs_new(const struct nv50_disp_chan_func *,
119                        const struct nv50_disp_chan_mthd *,
120                        struct nv50_disp_root *, int chid,
121                        const struct nvkm_oclass *, void *data, u32 size,
122                        struct nvkm_object **);
123 int nv50_disp_oimm_new(const struct nv50_disp_chan_func *,
124                        const struct nv50_disp_chan_mthd *,
125                        struct nv50_disp_root *, int chid,
126                        const struct nvkm_oclass *, void *data, u32 size,
127                        struct nvkm_object **);
128 #endif