1 /* SPDX-License-Identifier: GPL-2.0 */
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)
7 struct nv50_disp_chan
{
8 const struct nv50_disp_chan_func
*func
;
9 const struct nv50_disp_chan_mthd
*mthd
;
10 struct nv50_disp_root
*root
;
18 struct nvkm_object object
;
21 struct nv50_disp_chan_func
{
22 void *(*dtor
)(struct nv50_disp_chan
*);
23 int (*init
)(struct nv50_disp_chan
*);
24 void (*fini
)(struct nv50_disp_chan
*);
25 int (*child_get
)(struct nv50_disp_chan
*, int index
,
26 struct nvkm_oclass
*);
27 int (*child_new
)(struct nv50_disp_chan
*, const struct nvkm_oclass
*,
28 void *data
, u32 size
, struct nvkm_object
**);
31 int nv50_disp_chan_ctor(const struct nv50_disp_chan_func
*,
32 const struct nv50_disp_chan_mthd
*,
33 struct nv50_disp_root
*, int ctrl
, int user
, int head
,
34 const struct nvkm_oclass
*, struct nv50_disp_chan
*);
35 int nv50_disp_chan_new_(const struct nv50_disp_chan_func
*,
36 const struct nv50_disp_chan_mthd
*,
37 struct nv50_disp_root
*, int ctrl
, int user
, int head
,
38 const struct nvkm_oclass
*, struct nvkm_object
**);
40 extern const struct nv50_disp_chan_func nv50_disp_pioc_func
;
41 extern const struct nv50_disp_chan_func gf119_disp_pioc_func
;
43 extern const struct nvkm_event_func nv50_disp_chan_uevent
;
44 int nv50_disp_chan_uevent_ctor(struct nvkm_object
*, void *, u32
,
45 struct nvkm_notify
*);
46 void nv50_disp_chan_uevent_send(struct nv50_disp
*, int);
48 extern const struct nvkm_event_func gf119_disp_chan_uevent
;
50 struct nv50_disp_mthd_list
{
60 struct nv50_disp_chan_mthd
{
67 const struct nv50_disp_mthd_list
*mthd
;
71 void nv50_disp_chan_mthd(struct nv50_disp_chan
*, int debug
);
73 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base
;
74 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor
;
75 extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior
;
76 extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image
;
78 extern const struct nv50_disp_chan_mthd g84_disp_core_chan_mthd
;
79 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac
;
80 extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head
;
81 extern const struct nv50_disp_chan_mthd g84_disp_base_chan_mthd
;
82 extern const struct nv50_disp_chan_mthd g84_disp_ovly_chan_mthd
;
84 extern const struct nv50_disp_chan_mthd g94_disp_core_chan_mthd
;
86 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base
;
87 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac
;
88 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor
;
89 extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior
;
90 extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd
;
92 extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd
;
93 extern const struct nv50_disp_chan_mthd gk104_disp_ovly_chan_mthd
;
95 struct nv50_disp_pioc_oclass
{
96 int (*ctor
)(const struct nv50_disp_chan_func
*,
97 const struct nv50_disp_chan_mthd
*,
98 struct nv50_disp_root
*, int ctrl
, int user
,
99 const struct nvkm_oclass
*, void *data
, u32 size
,
100 struct nvkm_object
**);
101 struct nvkm_sclass base
;
102 const struct nv50_disp_chan_func
*func
;
103 const struct nv50_disp_chan_mthd
*mthd
;
110 extern const struct nv50_disp_pioc_oclass nv50_disp_oimm_oclass
;
111 extern const struct nv50_disp_pioc_oclass nv50_disp_curs_oclass
;
113 extern const struct nv50_disp_pioc_oclass g84_disp_oimm_oclass
;
114 extern const struct nv50_disp_pioc_oclass g84_disp_curs_oclass
;
116 extern const struct nv50_disp_pioc_oclass gt215_disp_oimm_oclass
;
117 extern const struct nv50_disp_pioc_oclass gt215_disp_curs_oclass
;
119 extern const struct nv50_disp_pioc_oclass gf119_disp_oimm_oclass
;
120 extern const struct nv50_disp_pioc_oclass gf119_disp_curs_oclass
;
122 extern const struct nv50_disp_pioc_oclass gk104_disp_oimm_oclass
;
123 extern const struct nv50_disp_pioc_oclass gk104_disp_curs_oclass
;
125 extern const struct nv50_disp_pioc_oclass gp102_disp_oimm_oclass
;
126 extern const struct nv50_disp_pioc_oclass gp102_disp_curs_oclass
;
128 int nv50_disp_curs_new(const struct nv50_disp_chan_func
*,
129 const struct nv50_disp_chan_mthd
*,
130 struct nv50_disp_root
*, int ctrl
, int user
,
131 const struct nvkm_oclass
*, void *data
, u32 size
,
132 struct nvkm_object
**);
133 int nv50_disp_oimm_new(const struct nv50_disp_chan_func
*,
134 const struct nv50_disp_chan_mthd
*,
135 struct nv50_disp_root
*, int ctrl
, int user
,
136 const struct nvkm_oclass
*, void *data
, u32 size
,
137 struct nvkm_object
**);