These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / gpu / drm / nouveau / nvkm / engine / disp / outp.h
1 #ifndef __NVKM_DISP_OUTP_H__
2 #define __NVKM_DISP_OUTP_H__
3 #include <engine/disp.h>
4
5 #include <subdev/bios.h>
6 #include <subdev/bios/dcb.h>
7
8 struct nvkm_output {
9         const struct nvkm_output_func *func;
10         struct nvkm_disp *disp;
11         int index;
12         struct dcb_output info;
13
14         // whatever (if anything) is pointed at by the dcb device entry
15         struct nvkm_i2c_bus *i2c;
16         int or;
17
18         struct list_head head;
19         struct nvkm_connector *conn;
20 };
21
22 struct nvkm_output_func {
23         void *(*dtor)(struct nvkm_output *);
24         void (*init)(struct nvkm_output *);
25         void (*fini)(struct nvkm_output *);
26 };
27
28 void nvkm_output_ctor(const struct nvkm_output_func *, struct nvkm_disp *,
29                       int index, struct dcb_output *, struct nvkm_output *);
30 int nvkm_output_new_(const struct nvkm_output_func *, struct nvkm_disp *,
31                      int index, struct dcb_output *, struct nvkm_output **);
32 void nvkm_output_del(struct nvkm_output **);
33 void nvkm_output_init(struct nvkm_output *);
34 void nvkm_output_fini(struct nvkm_output *);
35
36 int nv50_dac_output_new(struct nvkm_disp *, int, struct dcb_output *,
37                         struct nvkm_output **);
38 int nv50_sor_output_new(struct nvkm_disp *, int, struct dcb_output *,
39                         struct nvkm_output **);
40 int nv50_pior_output_new(struct nvkm_disp *, int, struct dcb_output *,
41                          struct nvkm_output **);
42
43 u32 g94_sor_dp_lane_map(struct nvkm_device *, u8 lane);
44
45 void gm204_sor_magic(struct nvkm_output *outp);
46
47 #define OUTP_MSG(o,l,f,a...) do {                                              \
48         struct nvkm_output *_outp = (o);                                       \
49         nvkm_##l(&_outp->disp->engine.subdev, "outp %02x:%04x:%04x: "f"\n",    \
50                  _outp->index, _outp->info.hasht, _outp->info.hashm, ##a);     \
51 } while(0)
52 #define OUTP_ERR(o,f,a...) OUTP_MSG((o), error, f, ##a)
53 #define OUTP_DBG(o,f,a...) OUTP_MSG((o), debug, f, ##a)
54 #define OUTP_TRACE(o,f,a...) OUTP_MSG((o), trace, f, ##a)
55 #endif