• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
89 struct nv50_disp_pioc_oclass {
90 	int (*ctor)(const struct nv50_disp_chan_func *,
91 		    const struct nv50_disp_chan_mthd *,
92 		    struct nv50_disp_root *, int chid,
93 		    const struct nvkm_oclass *, void *data, u32 size,
94 		    struct nvkm_object **);
95 	struct nvkm_sclass base;
96 	const struct nv50_disp_chan_func *func;
97 	const struct nv50_disp_chan_mthd *mthd;
98 	int chid;
99 };
100 
101 extern const struct nv50_disp_pioc_oclass nv50_disp_oimm_oclass;
102 extern const struct nv50_disp_pioc_oclass nv50_disp_curs_oclass;
103 
104 extern const struct nv50_disp_pioc_oclass g84_disp_oimm_oclass;
105 extern const struct nv50_disp_pioc_oclass g84_disp_curs_oclass;
106 
107 extern const struct nv50_disp_pioc_oclass gt215_disp_oimm_oclass;
108 extern const struct nv50_disp_pioc_oclass gt215_disp_curs_oclass;
109 
110 extern const struct nv50_disp_pioc_oclass gf119_disp_oimm_oclass;
111 extern const struct nv50_disp_pioc_oclass gf119_disp_curs_oclass;
112 
113 extern const struct nv50_disp_pioc_oclass gk104_disp_oimm_oclass;
114 extern const struct nv50_disp_pioc_oclass gk104_disp_curs_oclass;
115 
116 
117 int nv50_disp_curs_new(const struct nv50_disp_chan_func *,
118 		       const struct nv50_disp_chan_mthd *,
119 		       struct nv50_disp_root *, int chid,
120 		       const struct nvkm_oclass *, void *data, u32 size,
121 		       struct nvkm_object **);
122 int nv50_disp_oimm_new(const struct nv50_disp_chan_func *,
123 		       const struct nv50_disp_chan_mthd *,
124 		       struct nv50_disp_root *, int chid,
125 		       const struct nvkm_oclass *, void *data, u32 size,
126 		       struct nvkm_object **);
127 #endif
128