xref: /linux/drivers/gpu/drm/nouveau/dispnv50/head.h (revision f86fd32d)
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 	struct nv50_msto *msto;
15 };
16 
17 struct nv50_head *nv50_head_create(struct drm_device *, int index);
18 void nv50_head_flush_set(struct nv50_head *, struct nv50_head_atom *);
19 void nv50_head_flush_clr(struct nv50_head *, struct nv50_head_atom *, bool y);
20 
21 struct nv50_head_func {
22 	void (*view)(struct nv50_head *, struct nv50_head_atom *);
23 	void (*mode)(struct nv50_head *, struct nv50_head_atom *);
24 	bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
25 	bool olut_identity;
26 	int  olut_size;
27 	void (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
28 	void (*olut_clr)(struct nv50_head *);
29 	void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
30 	void (*core_set)(struct nv50_head *, struct nv50_head_atom *);
31 	void (*core_clr)(struct nv50_head *);
32 	int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
33 			   struct nv50_head_atom *);
34 	int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
35 			   struct nv50_head_atom *);
36 	void (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
37 	void (*curs_clr)(struct nv50_head *);
38 	void (*base)(struct nv50_head *, struct nv50_head_atom *);
39 	void (*ovly)(struct nv50_head *, struct nv50_head_atom *);
40 	void (*dither)(struct nv50_head *, struct nv50_head_atom *);
41 	void (*procamp)(struct nv50_head *, struct nv50_head_atom *);
42 	void (*or)(struct nv50_head *, struct nv50_head_atom *);
43 };
44 
45 extern const struct nv50_head_func head507d;
46 void head507d_view(struct nv50_head *, struct nv50_head_atom *);
47 void head507d_mode(struct nv50_head *, struct nv50_head_atom *);
48 bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
49 void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
50 void head507d_core_clr(struct nv50_head *);
51 int head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
52 			 struct nv50_head_atom *);
53 int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
54 			 struct nv50_head_atom *);
55 void head507d_base(struct nv50_head *, struct nv50_head_atom *);
56 void head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
57 void head507d_dither(struct nv50_head *, struct nv50_head_atom *);
58 void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
59 
60 extern const struct nv50_head_func head827d;
61 
62 extern const struct nv50_head_func head907d;
63 void head907d_view(struct nv50_head *, struct nv50_head_atom *);
64 void head907d_mode(struct nv50_head *, struct nv50_head_atom *);
65 bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
66 void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
67 void head907d_olut_clr(struct nv50_head *);
68 void head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
69 void head907d_core_clr(struct nv50_head *);
70 void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
71 void head907d_curs_clr(struct nv50_head *);
72 void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
73 void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
74 void head907d_or(struct nv50_head *, struct nv50_head_atom *);
75 
76 extern const struct nv50_head_func head917d;
77 int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
78 			 struct nv50_head_atom *);
79 
80 extern const struct nv50_head_func headc37d;
81 void headc37d_view(struct nv50_head *, struct nv50_head_atom *);
82 void headc37d_core_set(struct nv50_head *, struct nv50_head_atom *);
83 void headc37d_core_clr(struct nv50_head *);
84 int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
85 			 struct nv50_head_atom *);
86 void headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
87 void headc37d_curs_clr(struct nv50_head *);
88 void headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
89 
90 extern const struct nv50_head_func headc57d;
91 #endif
92