18c2ecf20Sopenharmony_ci#ifndef __NV50_KMS_HEAD_H__
28c2ecf20Sopenharmony_ci#define __NV50_KMS_HEAD_H__
38c2ecf20Sopenharmony_ci#define nv50_head(c) container_of((c), struct nv50_head, base.base)
48c2ecf20Sopenharmony_ci#include <linux/workqueue.h>
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#include "disp.h"
78c2ecf20Sopenharmony_ci#include "atom.h"
88c2ecf20Sopenharmony_ci#include "crc.h"
98c2ecf20Sopenharmony_ci#include "lut.h"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include "nouveau_crtc.h"
128c2ecf20Sopenharmony_ci#include "nouveau_encoder.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cistruct nv50_head {
158c2ecf20Sopenharmony_ci	const struct nv50_head_func *func;
168c2ecf20Sopenharmony_ci	struct nouveau_crtc base;
178c2ecf20Sopenharmony_ci	struct nv50_crc crc;
188c2ecf20Sopenharmony_ci	struct nv50_lut olut;
198c2ecf20Sopenharmony_ci	struct nv50_msto *msto;
208c2ecf20Sopenharmony_ci};
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_cistruct nv50_head *nv50_head_create(struct drm_device *, int index);
238c2ecf20Sopenharmony_civoid nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh);
248c2ecf20Sopenharmony_civoid nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh);
258c2ecf20Sopenharmony_civoid nv50_head_flush_clr(struct nv50_head *head,
268c2ecf20Sopenharmony_ci			 struct nv50_head_atom *asyh, bool flush);
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_cistruct nv50_head_func {
298c2ecf20Sopenharmony_ci	int (*view)(struct nv50_head *, struct nv50_head_atom *);
308c2ecf20Sopenharmony_ci	int (*mode)(struct nv50_head *, struct nv50_head_atom *);
318c2ecf20Sopenharmony_ci	bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
328c2ecf20Sopenharmony_ci	bool olut_identity;
338c2ecf20Sopenharmony_ci	int  olut_size;
348c2ecf20Sopenharmony_ci	int (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
358c2ecf20Sopenharmony_ci	int (*olut_clr)(struct nv50_head *);
368c2ecf20Sopenharmony_ci	void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
378c2ecf20Sopenharmony_ci	int (*core_set)(struct nv50_head *, struct nv50_head_atom *);
388c2ecf20Sopenharmony_ci	int (*core_clr)(struct nv50_head *);
398c2ecf20Sopenharmony_ci	int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
408c2ecf20Sopenharmony_ci			   struct nv50_head_atom *);
418c2ecf20Sopenharmony_ci	int (*curs_format)(struct nv50_head *, struct nv50_wndw_atom *,
428c2ecf20Sopenharmony_ci			   struct nv50_head_atom *);
438c2ecf20Sopenharmony_ci	int (*curs_set)(struct nv50_head *, struct nv50_head_atom *);
448c2ecf20Sopenharmony_ci	int (*curs_clr)(struct nv50_head *);
458c2ecf20Sopenharmony_ci	int (*base)(struct nv50_head *, struct nv50_head_atom *);
468c2ecf20Sopenharmony_ci	int (*ovly)(struct nv50_head *, struct nv50_head_atom *);
478c2ecf20Sopenharmony_ci	int (*dither)(struct nv50_head *, struct nv50_head_atom *);
488c2ecf20Sopenharmony_ci	int (*procamp)(struct nv50_head *, struct nv50_head_atom *);
498c2ecf20Sopenharmony_ci	int (*or)(struct nv50_head *, struct nv50_head_atom *);
508c2ecf20Sopenharmony_ci	void (*static_wndw_map)(struct nv50_head *, struct nv50_head_atom *);
518c2ecf20Sopenharmony_ci};
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ciextern const struct nv50_head_func head507d;
548c2ecf20Sopenharmony_ciint head507d_view(struct nv50_head *, struct nv50_head_atom *);
558c2ecf20Sopenharmony_ciint head507d_mode(struct nv50_head *, struct nv50_head_atom *);
568c2ecf20Sopenharmony_cibool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
578c2ecf20Sopenharmony_civoid head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
588c2ecf20Sopenharmony_ciint head507d_core_clr(struct nv50_head *);
598c2ecf20Sopenharmony_ciint head507d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
608c2ecf20Sopenharmony_ci			 struct nv50_head_atom *);
618c2ecf20Sopenharmony_ciint head507d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
628c2ecf20Sopenharmony_ci			 struct nv50_head_atom *);
638c2ecf20Sopenharmony_ciint head507d_base(struct nv50_head *, struct nv50_head_atom *);
648c2ecf20Sopenharmony_ciint head507d_ovly(struct nv50_head *, struct nv50_head_atom *);
658c2ecf20Sopenharmony_ciint head507d_dither(struct nv50_head *, struct nv50_head_atom *);
668c2ecf20Sopenharmony_ciint head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciextern const struct nv50_head_func head827d;
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ciextern const struct nv50_head_func head907d;
718c2ecf20Sopenharmony_ciint head907d_view(struct nv50_head *, struct nv50_head_atom *);
728c2ecf20Sopenharmony_ciint head907d_mode(struct nv50_head *, struct nv50_head_atom *);
738c2ecf20Sopenharmony_cibool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
748c2ecf20Sopenharmony_ciint head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
758c2ecf20Sopenharmony_ciint head907d_olut_clr(struct nv50_head *);
768c2ecf20Sopenharmony_ciint head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
778c2ecf20Sopenharmony_ciint head907d_core_clr(struct nv50_head *);
788c2ecf20Sopenharmony_ciint head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
798c2ecf20Sopenharmony_ciint head907d_curs_clr(struct nv50_head *);
808c2ecf20Sopenharmony_ciint head907d_ovly(struct nv50_head *, struct nv50_head_atom *);
818c2ecf20Sopenharmony_ciint head907d_procamp(struct nv50_head *, struct nv50_head_atom *);
828c2ecf20Sopenharmony_ciint head907d_or(struct nv50_head *, struct nv50_head_atom *);
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ciextern const struct nv50_head_func head917d;
858c2ecf20Sopenharmony_ciint head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
868c2ecf20Sopenharmony_ci			 struct nv50_head_atom *);
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ciextern const struct nv50_head_func headc37d;
898c2ecf20Sopenharmony_ciint headc37d_view(struct nv50_head *, struct nv50_head_atom *);
908c2ecf20Sopenharmony_ciint headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
918c2ecf20Sopenharmony_ci			 struct nv50_head_atom *);
928c2ecf20Sopenharmony_ciint headc37d_curs_set(struct nv50_head *, struct nv50_head_atom *);
938c2ecf20Sopenharmony_ciint headc37d_curs_clr(struct nv50_head *);
948c2ecf20Sopenharmony_ciint headc37d_dither(struct nv50_head *, struct nv50_head_atom *);
958c2ecf20Sopenharmony_civoid headc37d_static_wndw_map(struct nv50_head *, struct nv50_head_atom *);
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ciextern const struct nv50_head_func headc57d;
988c2ecf20Sopenharmony_ci#endif
99