]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
drm/nouveau/disp: common implementation of scanoutpos method in nvkm_head
[mirror_ubuntu-artful-kernel.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / nv50.h
CommitLineData
70cabe4a
BS
1#ifndef __NV50_DISP_H__
2#define __NV50_DISP_H__
0ce41e3c 3#define nv50_disp(p) container_of((p), struct nv50_disp, base)
a8f8b489 4#include "priv.h"
af85389c 5#include "dp.h"
a8f8b489 6
878da15a 7#define NV50_DISP_MTHD_ struct nvkm_object *object, \
fd166a18 8 struct nv50_disp *disp, void *data, u32 size
bf0eb898
BS
9#define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
10
fd166a18 11struct nv50_disp {
70aa8670 12 const struct nv50_disp_func *func;
878da15a 13 struct nvkm_disp base;
5cc027f6
BS
14
15 struct work_struct supervisor;
16 u32 super;
17
b38a2322
BS
18 struct nvkm_event uevent;
19
70cabe4a 20 struct {
4a230fa6 21 u32 lvdsconf;
70cabe4a 22 } sor;
70aa8670 23
a2bc283f 24 struct {
a2bc283f 25 u8 type[3];
a2bc283f 26 } pior;
0ce41e3c
BS
27
28 struct nv50_disp_chan *chan[17];
70cabe4a
BS
29};
30
bf0eb898 31int nv50_dac_power(NV50_DISP_MTHD_V1);
c4abd317 32int nv50_dac_sense(NV50_DISP_MTHD_V1);
35b21d39 33
878da15a 34int gt215_hda_eld(NV50_DISP_MTHD_V1);
2a7909c0 35int gf119_hda_eld(NV50_DISP_MTHD_V1);
a4feaf4e 36
878da15a
BS
37int g84_hdmi_ctrl(NV50_DISP_MTHD_V1);
38int gt215_hdmi_ctrl(NV50_DISP_MTHD_V1);
2a7909c0 39int gf119_hdmi_ctrl(NV50_DISP_MTHD_V1);
878da15a 40int gk104_hdmi_ctrl(NV50_DISP_MTHD_V1);
a4feaf4e 41
d55b4af9 42int nv50_sor_power(NV50_DISP_MTHD_V1);
67cb49c4 43int nv50_pior_power(NV50_DISP_MTHD_V1);
a2bc283f 44
70aa8670
BS
45int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
46 int index, int heads, struct nvkm_disp **);
47int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
48 int index, struct nvkm_disp **);
49
50struct 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
63struct nv50_disp_func {
64 void (*intr)(struct nv50_disp *);
fd47877f 65 void (*intr_error)(struct nv50_disp *, int chid);
70aa8670
BS
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 {
a1c93078 73 int (*new)(struct nvkm_disp *, int id);
70aa8670
BS
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
70aa8670 101void nv50_disp_intr(struct nv50_disp *);
af85389c 102void nv50_disp_super(struct work_struct *);
70cabe4a 103
70aa8670 104void gf119_disp_intr(struct nv50_disp *);
af85389c 105void gf119_disp_super(struct work_struct *);
fd47877f 106void gf119_disp_intr_error(struct nv50_disp *, int);
af85389c
BS
107
108void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
109void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
110void nv50_disp_update_sppll1(struct nv50_disp *);
70cabe4a 111#endif