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