1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_DISP_HEAD_H__
3 #define __NVKM_DISP_HEAD_H__
7 const struct nvkm_head_func *func;
8 struct nvkm_disp *disp;
11 struct list_head head;
13 struct nvkm_head_state {
24 /* Prior to GF119, these are set by the OR. */
31 int nvkm_head_new_(const struct nvkm_head_func *, struct nvkm_disp *, int id);
32 void nvkm_head_del(struct nvkm_head **);
33 int nvkm_head_mthd_scanoutpos(struct nvkm_object *,
34 struct nvkm_head *, void *, u32);
35 struct nvkm_head *nvkm_head_find(struct nvkm_disp *, int id);
37 struct nvkm_head_func {
38 void (*state)(struct nvkm_head *, struct nvkm_head_state *);
39 void (*rgpos)(struct nvkm_head *, u16 *hline, u16 *vline);
40 void (*rgclk)(struct nvkm_head *, int div);
41 void (*vblank_get)(struct nvkm_head *);
42 void (*vblank_put)(struct nvkm_head *);
45 void nv50_head_rgpos(struct nvkm_head *, u16 *, u16 *);
47 #define HEAD_MSG(h,l,f,a...) do { \
48 struct nvkm_head *_h = (h); \
49 nvkm_##l(&_h->disp->engine.subdev, "head-%d: "f"\n", _h->id, ##a); \
51 #define HEAD_WARN(h,f,a...) HEAD_MSG((h), warn, f, ##a)
52 #define HEAD_DBG(h,f,a...) HEAD_MSG((h), debug, f, ##a)
54 int nv04_head_new(struct nvkm_disp *, int id);
55 int nv50_head_new(struct nvkm_disp *, int id);
56 int gf119_head_new(struct nvkm_disp *, int id);