]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
42c2dd83fe569033c5ab28b8964df2fdf287ee68
[karo-tx-linux.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / nv50.h
1 #ifndef __NV50_DISP_H__
2 #define __NV50_DISP_H__
3 #define nv50_disp(p) container_of((p), struct nv50_disp, base)
4 #include "priv.h"
5 #include "dp.h"
6
7 #define NV50_DISP_MTHD_ struct nvkm_object *object,                            \
8         struct nv50_disp *disp, void *data, u32 size
9 #define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
10
11 struct nv50_disp {
12         const struct nv50_disp_func *func;
13         struct nvkm_disp base;
14
15         struct work_struct supervisor;
16         u32 super;
17
18         struct nvkm_event uevent;
19
20         struct {
21                 u32 lvdsconf;
22         } sor;
23
24         struct {
25                 u8 type[3];
26         } pior;
27
28         struct nv50_disp_chan *chan[17];
29 };
30
31 int nv50_dac_power(NV50_DISP_MTHD_V1);
32 int nv50_dac_sense(NV50_DISP_MTHD_V1);
33
34 int gt215_hda_eld(NV50_DISP_MTHD_V1);
35 int gf119_hda_eld(NV50_DISP_MTHD_V1);
36
37 int g84_hdmi_ctrl(NV50_DISP_MTHD_V1);
38 int gt215_hdmi_ctrl(NV50_DISP_MTHD_V1);
39 int gf119_hdmi_ctrl(NV50_DISP_MTHD_V1);
40 int gk104_hdmi_ctrl(NV50_DISP_MTHD_V1);
41
42 int nv50_sor_power(NV50_DISP_MTHD_V1);
43 int nv50_pior_power(NV50_DISP_MTHD_V1);
44
45 int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
46                    int index, int heads, struct nvkm_disp **);
47 int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
48                     int index, struct nvkm_disp **);
49
50 struct nv50_disp_func_outp {
51         int (* crt)(struct nvkm_disp *, int index, struct dcb_output *,
52                     struct nvkm_output **);
53         int (*  tv)(struct nvkm_disp *, int index, struct dcb_output *,
54                     struct nvkm_output **);
55         int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *,
56                     struct nvkm_output **);
57         int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *,
58                     struct nvkm_output **);
59         int (*  dp)(struct nvkm_disp *, int index, struct dcb_output *,
60                     struct nvkm_output **);
61 };
62
63 struct nv50_disp_func {
64         void (*intr)(struct nv50_disp *);
65         void (*intr_error)(struct nv50_disp *, int chid);
66
67         const struct nvkm_event_func *uevent;
68         void (*super)(struct work_struct *);
69
70         const struct nvkm_disp_oclass *root;
71
72         struct {
73                 int (*new)(struct nvkm_disp *, int id);
74         } head;
75
76         struct {
77                 const struct nv50_disp_func_outp internal;
78                 const struct nv50_disp_func_outp external;
79         } outp;
80
81         struct {
82                 int nr;
83                 int (*power)(NV50_DISP_MTHD_V1);
84                 int (*sense)(NV50_DISP_MTHD_V1);
85         } dac;
86
87         struct {
88                 int nr;
89                 int (*power)(NV50_DISP_MTHD_V1);
90                 int (*hda_eld)(NV50_DISP_MTHD_V1);
91                 int (*hdmi)(NV50_DISP_MTHD_V1);
92                 void (*magic)(struct nvkm_output *);
93         } sor;
94
95         struct {
96                 int nr;
97                 int (*power)(NV50_DISP_MTHD_V1);
98         } pior;
99 };
100
101 void nv50_disp_intr(struct nv50_disp *);
102 void nv50_disp_super(struct work_struct *);
103
104 void gf119_disp_intr(struct nv50_disp *);
105 void gf119_disp_super(struct work_struct *);
106 void gf119_disp_intr_error(struct nv50_disp *, int);
107
108 void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
109 void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
110 void nv50_disp_update_sppll1(struct nv50_disp *);
111 #endif