xref: /linux/drivers/gpu/drm/nouveau/dispnv50/head.h (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
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 <linux/workqueue.h>
5 
6 #include "disp.h"
7 #include "atom.h"
8 #include "crc.h"
9 #include "lut.h"
10 
11 #include "nouveau_crtc.h"
12 #include "nouveau_encoder.h"
13 
14 struct nv50_head {
15 	const struct nv50_head_func *func;
16 	struct nouveau_crtc base;
17 	struct nv50_crc crc;
18 	struct nv50_lut olut;
19 	struct nv50_msto *msto;
20 };
21 
22 struct nv50_head *nv50_head_create(struct drm_device *, int index);
23 void nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh);
24 void nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh);
25 void nv50_head_flush_clr(struct nv50_head *head,
26 			 struct nv50_head_atom *asyh, bool flush);
27 
28 struct nv50_head_func {
29 	int (*view)(struct nv50_head *, struct nv50_head_atom *);
30 	int (*mode)(struct nv50_head *, struct nv50_head_atom *);
31 	bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
32 	bool (*ilut_check)(int size);
33 	bool olut_identity;
34 	int  olut_size;
35 	int (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
36 	int (*olut_clr)(struct nv50_head *);
37 	void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
38 	int (*core_set)(struct nv50_head *, struct nv50_head_atom *);
39 	int (*core_clr)(struct nv50_head *);
40 	int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
41 			   struct nv50_head_atom *);
42 	int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
43 			   struct nv50_head_atom *);
44 	int (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
45 	int (*curs_clr)(struct nv50_head *);
46 	int (*base)(struct nv50_head *, struct nv50_head_atom *);
47 	int (*ovly)(struct nv50_head *, struct nv50_head_atom *);
48 	int (*dither)(struct nv50_head *, struct nv50_head_atom *);
49 	int (*procamp)(struct nv50_head *, struct nv50_head_atom *);
50 	int (*or)(struct nv50_head *, struct nv50_head_atom *);
51 	void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *);
52 	int (*display_id)(struct nv50_head *, u32 display_id);
53 };
54 
55 extern const struct nv50_head_func head507d;
56 int head507d_view(struct nv50_head *, struct nv50_head_atom *);
57 int head507d_mode(struct nv50_head *, struct nv50_head_atom *);
58 bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
59 void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
60 int head507d_core_clr(struct nv50_head *);
61 int head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
62 			 struct nv50_head_atom *);
63 int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
64 			 struct nv50_head_atom *);
65 int head507d_base(struct nv50_head *, struct nv50_head_atom *);
66 int head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
67 int head507d_dither(struct nv50_head *, struct nv50_head_atom *);
68 int head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
69 
70 extern const struct nv50_head_func head827d;
71 
72 extern const struct nv50_head_func head907d;
73 int head907d_view(struct nv50_head *, struct nv50_head_atom *);
74 int head907d_mode(struct nv50_head *, struct nv50_head_atom *);
75 bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
76 bool head907d_ilut_check(int size);
77 int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
78 int head907d_olut_clr(struct nv50_head *);
79 int head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
80 int head907d_core_clr(struct nv50_head *);
81 int head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
82 int head907d_curs_clr(struct nv50_head *);
83 int head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
84 int head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
85 int head907d_or(struct nv50_head *, struct nv50_head_atom *);
86 
87 extern const struct nv50_head_func head917d;
88 int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
89 			 struct nv50_head_atom *);
90 
91 extern const struct nv50_head_func headc37d;
92 int headc37d_view(struct nv50_head *, struct nv50_head_atom *);
93 int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
94 			 struct nv50_head_atom *);
95 int headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
96 int headc37d_curs_clr(struct nv50_head *);
97 int headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
98 void headc37d_static_wndw_map(struct nv50_head *, struct nv50_head_atom *);
99 
100 extern const struct nv50_head_func headc57d;
101 #endif
102