Commit | Line | Data |
---|---|---|
b8407c9e BS |
1 | #ifndef __NVKM_DISP_OUTP_DP_H__ |
2 | #define __NVKM_DISP_OUTP_DP_H__ | |
f2c906fc BS |
3 | #define nvkm_output_dp(p) container_of((p), struct nvkm_output_dp, base) |
4 | #ifndef MSG | |
5 | #define MSG(l,f,a...) \ | |
6 | nvkm_##l(&outp->base.disp->engine.subdev, "%02x:%04x:%04x: "f, \ | |
7 | outp->base.index, outp->base.info.hasht, \ | |
8 | outp->base.info.hashm, ##a) | |
9 | #define DBG(f,a...) MSG(debug, f, ##a) | |
10 | #define ERR(f,a...) MSG(error, f, ##a) | |
11 | #endif | |
878da15a | 12 | #include "outp.h" |
b8407c9e | 13 | |
5025407b | 14 | #include <core/notify.h> |
b8407c9e BS |
15 | #include <subdev/bios.h> |
16 | #include <subdev/bios/dp.h> | |
17 | ||
b8407c9e | 18 | struct nvkm_output_dp { |
f2c906fc | 19 | const struct nvkm_output_dp_func *func; |
b8407c9e BS |
20 | struct nvkm_output base; |
21 | ||
22 | struct nvbios_dpout info; | |
23 | u8 version; | |
24 | ||
2aa5eac5 BS |
25 | struct nvkm_i2c_aux *aux; |
26 | ||
79ca2770 | 27 | struct nvkm_notify irq; |
f2c906fc | 28 | struct nvkm_notify hpd; |
bb7ef1ec BS |
29 | bool present; |
30 | u8 dpcd[16]; | |
55f083c3 BS |
31 | |
32 | struct { | |
33 | struct work_struct work; | |
34 | wait_queue_head_t wait; | |
35 | atomic_t done; | |
36 | } lt; | |
b8407c9e BS |
37 | }; |
38 | ||
f2c906fc | 39 | struct nvkm_output_dp_func { |
3b52a1f9 | 40 | int (*pattern)(struct nvkm_output_dp *, int); |
1ecee1cd | 41 | int (*lnk_pwr)(struct nvkm_output_dp *, int nr); |
3b52a1f9 BS |
42 | int (*lnk_ctl)(struct nvkm_output_dp *, int nr, int bw, bool ef); |
43 | int (*drv_ctl)(struct nvkm_output_dp *, int ln, int vs, int pe, int pc); | |
b8407c9e BS |
44 | }; |
45 | ||
55f083c3 | 46 | int nvkm_output_dp_train(struct nvkm_output *, u32 rate, bool wait); |
f2c906fc BS |
47 | |
48 | int nvkm_output_dp_ctor(const struct nvkm_output_dp_func *, struct nvkm_disp *, | |
49 | int index, struct dcb_output *, struct nvkm_i2c_aux *, | |
50 | struct nvkm_output_dp *); | |
51 | int nvkm_output_dp_new_(const struct nvkm_output_dp_func *, struct nvkm_disp *, | |
52 | int index, struct dcb_output *, | |
53 | struct nvkm_output **); | |
54 | ||
0ce41e3c BS |
55 | int nv50_pior_dp_new(struct nvkm_disp *, int, struct dcb_output *, |
56 | struct nvkm_output **); | |
f2c906fc | 57 | |
0ce41e3c BS |
58 | int g94_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, |
59 | struct nvkm_output **); | |
60 | int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int); | |
f2c906fc | 61 | |
0ce41e3c BS |
62 | int gf119_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, |
63 | struct nvkm_output **); | |
64 | int gf119_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool); | |
4691409b | 65 | int gf119_sor_dp_drv_ctl(struct nvkm_output_dp *, int, int, int, int); |
f2c906fc | 66 | |
4691409b BS |
67 | int gm107_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, |
68 | struct nvkm_output **); | |
69 | int gm107_sor_dp_pattern(struct nvkm_output_dp *, int); | |
70 | ||
71 | int gm200_sor_dp_new(struct nvkm_disp *, int, struct dcb_output *, | |
72 | struct nvkm_output **); | |
b8407c9e | 73 | #endif |