blob: c32b27cdaefc95db9902e6087c78dea7e732af48 [file] [log] [blame]
Ben Skeggs15907002018-05-08 20:39:47 +10001#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"
Ben Skeggs119608a2018-05-08 20:39:47 +10006#include "lut.h"
Ben Skeggs15907002018-05-08 20:39:47 +10007
8#include "nouveau_crtc.h"
9
10struct nv50_head {
11 const struct nv50_head_func *func;
12 struct nouveau_crtc base;
Ben Skeggs119608a2018-05-08 20:39:47 +100013 struct nv50_lut olut;
Lyude Paul5ff0cb12019-09-13 18:03:52 -040014 struct nv50_msto *msto;
Ben Skeggs15907002018-05-08 20:39:47 +100015};
16
Lyude Paul5ff0cb12019-09-13 18:03:52 -040017struct nv50_head *nv50_head_create(struct drm_device *, int index);
Ben Skeggs15907002018-05-08 20:39:47 +100018void nv50_head_flush_set(struct nv50_head *, struct nv50_head_atom *);
19void nv50_head_flush_clr(struct nv50_head *, struct nv50_head_atom *, bool y);
20
21struct nv50_head_func {
22 void (*view)(struct nv50_head *, struct nv50_head_atom *);
23 void (*mode)(struct nv50_head *, struct nv50_head_atom *);
Ilia Mirkin13199272019-09-06 00:13:59 -040024 bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
Ben Skeggscb55cd02018-12-11 14:50:02 +100025 bool olut_identity;
Ilia Mirkin13199272019-09-06 00:13:59 -040026 int olut_size;
Ben Skeggs119608a2018-05-08 20:39:47 +100027 void (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
28 void (*olut_clr)(struct nv50_head *);
Ben Skeggs09e1b782018-05-08 20:39:47 +100029 void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
Ben Skeggs15907002018-05-08 20:39:47 +100030 void (*core_set)(struct nv50_head *, struct nv50_head_atom *);
31 void (*core_clr)(struct nv50_head *);
Ben Skeggs01d380a2018-05-08 20:39:47 +100032 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 *);
Ben Skeggs15907002018-05-08 20:39:47 +100036 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
45extern const struct nv50_head_func head507d;
Ben Skeggs09e1b782018-05-08 20:39:47 +100046void head507d_view(struct nv50_head *, struct nv50_head_atom *);
47void head507d_mode(struct nv50_head *, struct nv50_head_atom *);
Ilia Mirkin13199272019-09-06 00:13:59 -040048bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
Ben Skeggs09e1b782018-05-08 20:39:47 +100049void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
50void head507d_core_clr(struct nv50_head *);
Ben Skeggs01d380a2018-05-08 20:39:47 +100051int head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
52 struct nv50_head_atom *);
53int head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
54 struct nv50_head_atom *);
Ben Skeggs09e1b782018-05-08 20:39:47 +100055void head507d_base(struct nv50_head *, struct nv50_head_atom *);
56void head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
57void head507d_dither(struct nv50_head *, struct nv50_head_atom *);
58void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
59
60extern const struct nv50_head_func head827d;
61
62extern const struct nv50_head_func head907d;
63void head907d_view(struct nv50_head *, struct nv50_head_atom *);
64void head907d_mode(struct nv50_head *, struct nv50_head_atom *);
Ilia Mirkin13199272019-09-06 00:13:59 -040065bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
Ben Skeggs119608a2018-05-08 20:39:47 +100066void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
67void head907d_olut_clr(struct nv50_head *);
Ben Skeggs09e1b782018-05-08 20:39:47 +100068void head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
69void head907d_core_clr(struct nv50_head *);
70void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
71void head907d_curs_clr(struct nv50_head *);
Ben Skeggs09e1b782018-05-08 20:39:47 +100072void head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
73void head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
74void head907d_or(struct nv50_head *, struct nv50_head_atom *);
75
76extern const struct nv50_head_func head917d;
Ben Skeggsfacaed62018-05-08 20:39:48 +100077int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
78 struct nv50_head_atom *);
79
80extern const struct nv50_head_func headc37d;
Ben Skeggs563737c2018-12-11 14:50:02 +100081void headc37d_view(struct nv50_head *, struct nv50_head_atom *);
82void headc37d_core_set(struct nv50_head *, struct nv50_head_atom *);
83void headc37d_core_clr(struct nv50_head *);
84int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
85 struct nv50_head_atom *);
86void headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
87void headc37d_curs_clr(struct nv50_head *);
88void headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
89
90extern const struct nv50_head_func headc57d;
Ben Skeggs15907002018-05-08 20:39:47 +100091#endif