• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 struct nvkm_output;
6 struct nvkm_output_dp;
7 
8 #define NV50_DISP_MTHD_ struct nvkm_object *object,                            \
9 	struct nv50_disp *disp, void *data, u32 size
10 #define NV50_DISP_MTHD_V0 NV50_DISP_MTHD_, int head
11 #define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
12 
13 struct nv50_disp {
14 	const struct nv50_disp_func *func;
15 	struct nvkm_disp base;
16 
17 	struct work_struct supervisor;
18 	u32 super;
19 
20 	struct nvkm_event uevent;
21 
22 	struct {
23 		u32 lvdsconf;
24 	} sor;
25 
26 	struct {
27 		u8 type[3];
28 	} pior;
29 
30 	struct nv50_disp_chan *chan[17];
31 };
32 
33 int nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0);
34 
35 int gf119_disp_root_scanoutpos(NV50_DISP_MTHD_V0);
36 
37 int nv50_dac_power(NV50_DISP_MTHD_V1);
38 int nv50_dac_sense(NV50_DISP_MTHD_V1);
39 
40 int gt215_hda_eld(NV50_DISP_MTHD_V1);
41 int gf119_hda_eld(NV50_DISP_MTHD_V1);
42 
43 int g84_hdmi_ctrl(NV50_DISP_MTHD_V1);
44 int gt215_hdmi_ctrl(NV50_DISP_MTHD_V1);
45 int gf119_hdmi_ctrl(NV50_DISP_MTHD_V1);
46 int gk104_hdmi_ctrl(NV50_DISP_MTHD_V1);
47 
48 int nv50_sor_power(NV50_DISP_MTHD_V1);
49 int nv50_pior_power(NV50_DISP_MTHD_V1);
50 
51 int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
52 		   int index, int heads, struct nvkm_disp **);
53 int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
54 		    int index, struct nvkm_disp **);
55 
56 struct nv50_disp_func_outp {
57 	int (* crt)(struct nvkm_disp *, int index, struct dcb_output *,
58 		    struct nvkm_output **);
59 	int (*  tv)(struct nvkm_disp *, int index, struct dcb_output *,
60 		    struct nvkm_output **);
61 	int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *,
62 		    struct nvkm_output **);
63 	int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *,
64 		    struct nvkm_output **);
65 	int (*  dp)(struct nvkm_disp *, int index, struct dcb_output *,
66 		    struct nvkm_output **);
67 };
68 
69 struct nv50_disp_func {
70 	void (*intr)(struct nv50_disp *);
71 
72 	const struct nvkm_event_func *uevent;
73 	void (*super)(struct work_struct *);
74 
75 	const struct nvkm_disp_oclass *root;
76 
77 	struct {
78 		void (*vblank_init)(struct nv50_disp *, int head);
79 		void (*vblank_fini)(struct nv50_disp *, int head);
80 		int (*scanoutpos)(NV50_DISP_MTHD_V0);
81 	} head;
82 
83 	struct {
84 		const struct nv50_disp_func_outp internal;
85 		const struct nv50_disp_func_outp external;
86 	} outp;
87 
88 	struct {
89 		int nr;
90 		int (*power)(NV50_DISP_MTHD_V1);
91 		int (*sense)(NV50_DISP_MTHD_V1);
92 	} dac;
93 
94 	struct {
95 		int nr;
96 		int (*power)(NV50_DISP_MTHD_V1);
97 		int (*hda_eld)(NV50_DISP_MTHD_V1);
98 		int (*hdmi)(NV50_DISP_MTHD_V1);
99 		void (*magic)(struct nvkm_output *);
100 	} sor;
101 
102 	struct {
103 		int nr;
104 		int (*power)(NV50_DISP_MTHD_V1);
105 	} pior;
106 };
107 
108 void nv50_disp_vblank_init(struct nv50_disp *, int);
109 void nv50_disp_vblank_fini(struct nv50_disp *, int);
110 void nv50_disp_intr(struct nv50_disp *);
111 void nv50_disp_intr_supervisor(struct work_struct *);
112 
113 void gf119_disp_vblank_init(struct nv50_disp *, int);
114 void gf119_disp_vblank_fini(struct nv50_disp *, int);
115 void gf119_disp_intr(struct nv50_disp *);
116 void gf119_disp_intr_supervisor(struct work_struct *);
117 #endif
118