1 #ifndef __NV50_KMS_HEAD_H__
2 #define __NV50_KMS_HEAD_H__
3 #define nv50_head(c) container_of((c), struct nv50_head, base.base)
4 #include "disp.h"
5 #include "atom.h"
6 #include "lut.h"
7 
8 #include "nouveau_crtc.h"
9 
10 struct nv50_head {
11 	const struct nv50_head_func *func;
12 	struct nouveau_crtc base;
13 	struct nv50_lut olut;
14 };
15 
16 int nv50_head_create(struct drm_device *, int index);
17 void nv50_head_flush_set(struct nv50_head *, struct nv50_head_atom *);
18 void nv50_head_flush_clr(struct nv50_head *, struct nv50_head_atom *, bool y);
19 
20 struct nv50_head_func {
21 	void (*view)(struct nv50_head *, struct nv50_head_atom *);
22 	void (*mode)(struct nv50_head *, struct nv50_head_atom *);
23 	void (*olut)(struct nv50_head *, struct nv50_head_atom *);
24 	void (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
25 	void (*olut_clr)(struct nv50_head *);
26 	void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
27 	void (*core_set)(struct nv50_head *, struct nv50_head_atom *);
28 	void (*core_clr)(struct nv50_head *);
29 	int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
30 			   struct nv50_head_atom *);
31 	int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
32 			   struct nv50_head_atom *);
33 	void (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
34 	void (*curs_clr)(struct nv50_head *);
35 	void (*base)(struct nv50_head *, struct nv50_head_atom *);
36 	void (*ovly)(struct nv50_head *, struct nv50_head_atom *);
37 	void (*dither)(struct nv50_head *, struct nv50_head_atom *);
38 	void (*procamp)(struct nv50_head *, struct nv50_head_atom *);
39 	void (*or)(struct nv50_head *, struct nv50_head_atom *);
40 };
41 
42 extern const struct nv50_head_func head507d;
43 void head507d_view(struct nv50_head *, struct nv50_head_atom *);
44 void head507d_mode(struct nv50_head *, struct nv50_head_atom *);
45 void head507d_olut(struct nv50_head *, struct nv50_head_atom *);
46 void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
47 void head507d_core_clr(struct nv50_head *);
48 int head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
49 			 struct nv50_head_atom *);
50 int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
51 			 struct nv50_head_atom *);
52 void head507d_base(struct nv50_head *, struct nv50_head_atom *);
53 void head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
54 void head507d_dither(struct nv50_head *, struct nv50_head_atom *);
55 void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
56 
57 extern const struct nv50_head_func head827d;
58 
59 extern const struct nv50_head_func head907d;
60 void head907d_view(struct nv50_head *, struct nv50_head_atom *);
61 void head907d_mode(struct nv50_head *, struct nv50_head_atom *);
62 void head907d_olut(struct nv50_head *, struct nv50_head_atom *);
63 void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
64 void head907d_olut_clr(struct nv50_head *);
65 void head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
66 void head907d_core_clr(struct nv50_head *);
67 void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
68 void head907d_curs_clr(struct nv50_head *);
69 void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
70 void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
71 void head907d_or(struct nv50_head *, struct nv50_head_atom *);
72 
73 extern const struct nv50_head_func head917d;
74 int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
75 			 struct nv50_head_atom *);
76 
77 extern const struct nv50_head_func headc37d;
78 #endif
79