GNU Linux-libre 4.14.313-gnu1
[releases.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / nv50.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NV50_DISP_H__
3 #define __NV50_DISP_H__
4 #define nv50_disp(p) container_of((p), struct nv50_disp, base)
5 #include "priv.h"
6 struct nvkm_head;
7
8 struct nv50_disp {
9         const struct nv50_disp_func *func;
10         struct nvkm_disp base;
11
12         struct workqueue_struct *wq;
13         struct work_struct supervisor;
14         u32 super;
15
16         struct nvkm_event uevent;
17
18         struct {
19                 u32 lvdsconf;
20         } sor;
21
22         struct {
23                 u8 type[3];
24         } pior;
25
26         struct nv50_disp_chan *chan[21];
27 };
28
29 void nv50_disp_super_1(struct nv50_disp *);
30 void nv50_disp_super_1_0(struct nv50_disp *, struct nvkm_head *);
31 void nv50_disp_super_2_0(struct nv50_disp *, struct nvkm_head *);
32 void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *);
33 void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *);
34 void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *);
35
36 int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
37                    int index, int heads, struct nvkm_disp **);
38 int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
39                     int index, struct nvkm_disp **);
40
41 struct nv50_disp_func {
42         void (*intr)(struct nv50_disp *);
43         void (*intr_error)(struct nv50_disp *, int chid);
44
45         const struct nvkm_event_func *uevent;
46         void (*super)(struct work_struct *);
47
48         const struct nvkm_disp_oclass *root;
49
50         struct {
51                 int (*new)(struct nvkm_disp *, int id);
52         } head;
53
54         struct {
55                 int nr;
56                 int (*new)(struct nvkm_disp *, int id);
57         } dac;
58
59         struct {
60                 int nr;
61                 int (*new)(struct nvkm_disp *, int id);
62         } sor;
63
64         struct {
65                 int nr;
66                 int (*new)(struct nvkm_disp *, int id);
67         } pior;
68 };
69
70 void nv50_disp_intr(struct nv50_disp *);
71 void nv50_disp_super(struct work_struct *);
72
73 void gf119_disp_intr(struct nv50_disp *);
74 void gf119_disp_super(struct work_struct *);
75 void gf119_disp_intr_error(struct nv50_disp *, int);
76
77 void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
78 void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
79 void nv50_disp_update_sppll1(struct nv50_disp *);
80 #endif