nv50.h 7.1 KB
Newer Older
1 2
#ifndef __NV50_DISP_H__
#define __NV50_DISP_H__
3
#include "priv.h"
4 5
struct nvkm_output;
struct nvkm_output_dp;
6

7
#define NV50_DISP_MTHD_ struct nvkm_object *object,                            \
8 9 10 11
	struct nv50_disp_priv *priv, void *data, u32 size
#define NV50_DISP_MTHD_V0 NV50_DISP_MTHD_, int head
#define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp

12
struct nv50_disp_priv {
13 14
	struct nvkm_disp base;
	struct nvkm_oclass *sclass;
15 16 17 18

	struct work_struct supervisor;
	u32 super;

19 20
	struct nvkm_event uevent;

21 22 23 24 25
	struct {
		int nr;
	} head;
	struct {
		int nr;
26
		int (*power)(NV50_DISP_MTHD_V1);
27
		int (*sense)(NV50_DISP_MTHD_V1);
28 29 30
	} dac;
	struct {
		int nr;
31
		int (*power)(NV50_DISP_MTHD_V1);
32
		int (*hda_eld)(NV50_DISP_MTHD_V1);
33
		int (*hdmi)(NV50_DISP_MTHD_V1);
34
		u32 lvdsconf;
35
		void (*magic)(struct nvkm_output *);
36
	} sor;
37 38
	struct {
		int nr;
39
		int (*power)(NV50_DISP_MTHD_V1);
40 41
		u8 type[3];
	} pior;
42 43
};

44
struct nv50_disp_impl {
45
	struct nvkm_disp_impl base;
46 47 48 49 50 51 52 53 54 55
	struct {
		const struct nv50_disp_mthd_chan *core;
		const struct nv50_disp_mthd_chan *base;
		const struct nv50_disp_mthd_chan *ovly;
		int prev;
	} mthd;
	struct {
		int (*scanoutpos)(NV50_DISP_MTHD_V0);
	} head;
};
56

57
int nv50_disp_main_scanoutpos(NV50_DISP_MTHD_V0);
58
int nv50_disp_main_mthd(struct nvkm_object *, u32, void *, u32);
59

60
int gf110_disp_main_scanoutpos(NV50_DISP_MTHD_V0);
61

62
int nv50_dac_power(NV50_DISP_MTHD_V1);
63
int nv50_dac_sense(NV50_DISP_MTHD_V1);
64

65 66
int gt215_hda_eld(NV50_DISP_MTHD_V1);
int gf110_hda_eld(NV50_DISP_MTHD_V1);
67

68 69 70 71
int g84_hdmi_ctrl(NV50_DISP_MTHD_V1);
int gt215_hdmi_ctrl(NV50_DISP_MTHD_V1);
int gf110_hdmi_ctrl(NV50_DISP_MTHD_V1);
int gk104_hdmi_ctrl(NV50_DISP_MTHD_V1);
72

73
int nv50_sor_power(NV50_DISP_MTHD_V1);
74
int nv50_pior_power(NV50_DISP_MTHD_V1);
75

76 77
#include <core/parent.h>

78
struct nv50_disp_base {
79 80
	struct nvkm_parent base;
	struct nvkm_ramht *ramht;
81
	u32 chan;
82 83
};

84
struct nv50_disp_chan_impl {
85
	struct nvkm_ofuncs base;
86
	int chid;
87 88
	int  (*attach)(struct nvkm_object *, struct nvkm_object *, u32);
	void (*detach)(struct nvkm_object *, int);
89 90
};

91 92
#include <core/namedb.h>

93
struct nv50_disp_chan {
94
	struct nvkm_namedb base;
95 96 97
	int chid;
};

98 99 100 101
int  nv50_disp_chan_ntfy(struct nvkm_object *, u32, struct nvkm_event **);
int  nv50_disp_chan_map(struct nvkm_object *, u64 *, u32 *);
u32  nv50_disp_chan_rd32(struct nvkm_object *, u64);
void nv50_disp_chan_wr32(struct nvkm_object *, u64, u32);
102
extern const struct nvkm_event_func nv50_disp_chan_uevent;
103
int  nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
104 105 106
				struct nvkm_notify *);
void nv50_disp_chan_uevent_send(struct nv50_disp_priv *, int);

107
extern const struct nvkm_event_func gf110_disp_chan_uevent;
108 109

#define nv50_disp_chan_init(a)                                                 \
110
	nvkm_namedb_init(&(a)->base)
111
#define nv50_disp_chan_fini(a,b)                                               \
112
	nvkm_namedb_fini(&(a)->base, (b))
113 114 115

struct nv50_disp_dmac {
	struct nv50_disp_chan base;
116
	struct nvkm_dmaobj *pushdma;
117 118 119
	u32 push;
};

120
void nv50_disp_dmac_dtor(struct nvkm_object *);
121

122 123
struct nv50_disp_pioc {
	struct nv50_disp_chan base;
124 125
};

126
void nv50_disp_pioc_dtor(struct nvkm_object *);
127

128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
struct nv50_disp_mthd_list {
	u32 mthd;
	u32 addr;
	struct {
		u32 mthd;
		u32 addr;
		const char *name;
	} data[];
};

struct nv50_disp_mthd_chan {
	const char *name;
	u32 addr;
	struct {
		const char *name;
		int nr;
		const struct nv50_disp_mthd_list *mthd;
	} data[];
};

148
extern struct nv50_disp_chan_impl nv50_disp_core_ofuncs;
149 150 151
int nv50_disp_core_ctor(struct nvkm_object *, struct nvkm_object *,
			struct nvkm_oclass *, void *, u32,
			struct nvkm_object **);
152 153 154 155
extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
extern struct nv50_disp_chan_impl nv50_disp_base_ofuncs;
156 157 158
int nv50_disp_base_ctor(struct nvkm_object *, struct nvkm_object *,
			struct nvkm_oclass *, void *, u32,
			struct nvkm_object **);
159
extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;
160
extern struct nv50_disp_chan_impl nv50_disp_ovly_ofuncs;
161 162 163
int nv50_disp_ovly_ctor(struct nvkm_object *, struct nvkm_object *,
			struct nvkm_oclass *, void *, u32,
			struct nvkm_object **);
164
extern const struct nv50_disp_mthd_list nv50_disp_ovly_mthd_base;
165
extern struct nv50_disp_chan_impl nv50_disp_oimm_ofuncs;
166 167 168
int nv50_disp_oimm_ctor(struct nvkm_object *, struct nvkm_object *,
			struct nvkm_oclass *, void *, u32,
			struct nvkm_object **);
169
extern struct nv50_disp_chan_impl nv50_disp_curs_ofuncs;
170 171 172 173 174 175 176 177 178 179
int nv50_disp_curs_ctor(struct nvkm_object *, struct nvkm_object *,
			struct nvkm_oclass *, void *, u32,
			struct nvkm_object **);
extern struct nvkm_ofuncs nv50_disp_main_ofuncs;
int  nv50_disp_main_ctor(struct nvkm_object *, struct nvkm_object *,
			 struct nvkm_oclass *, void *, u32,
			 struct nvkm_object **);
void nv50_disp_main_dtor(struct nvkm_object *);
extern struct nvkm_omthds nv50_disp_main_omthds[];
extern struct nvkm_oclass nv50_disp_cclass;
180 181
void nv50_disp_mthd_chan(struct nv50_disp_priv *, int debug, int head,
			 const struct nv50_disp_mthd_chan *);
182
void nv50_disp_intr_supervisor(struct work_struct *);
183
void nv50_disp_intr(struct nvkm_subdev *);
184
extern const struct nvkm_event_func nv50_disp_vblank_func;
185

186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
extern const struct nv50_disp_mthd_chan g84_disp_core_mthd_chan;
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
extern const struct nv50_disp_mthd_chan g84_disp_base_mthd_chan;
extern const struct nv50_disp_mthd_chan g84_disp_ovly_mthd_chan;

extern const struct nv50_disp_mthd_chan g94_disp_core_mthd_chan;

extern struct nv50_disp_chan_impl gf110_disp_core_ofuncs;
extern const struct nv50_disp_mthd_list gf110_disp_core_mthd_base;
extern const struct nv50_disp_mthd_list gf110_disp_core_mthd_dac;
extern const struct nv50_disp_mthd_list gf110_disp_core_mthd_sor;
extern const struct nv50_disp_mthd_list gf110_disp_core_mthd_pior;
extern struct nv50_disp_chan_impl gf110_disp_base_ofuncs;
extern struct nv50_disp_chan_impl gf110_disp_ovly_ofuncs;
extern const struct nv50_disp_mthd_chan gf110_disp_base_mthd_chan;
extern struct nv50_disp_chan_impl gf110_disp_oimm_ofuncs;
extern struct nv50_disp_chan_impl gf110_disp_curs_ofuncs;
extern struct nvkm_ofuncs gf110_disp_main_ofuncs;
extern struct nvkm_oclass gf110_disp_cclass;
void gf110_disp_intr_supervisor(struct work_struct *);
void gf110_disp_intr(struct nvkm_subdev *);
extern const struct nvkm_event_func gf110_disp_vblank_func;

extern const struct nv50_disp_mthd_chan gk104_disp_core_mthd_chan;
extern const struct nv50_disp_mthd_chan gk104_disp_ovly_mthd_chan;
212

213
extern struct nvkm_output_dp_impl nv50_pior_dp_impl;
214
extern struct nvkm_oclass *nv50_disp_outp_sclass[];
215

216 217 218
extern struct nvkm_output_dp_impl g94_sor_dp_impl;
int g94_sor_dp_lnk_pwr(struct nvkm_output_dp *, int);
extern struct nvkm_oclass *g94_disp_outp_sclass[];
219

220 221 222
extern struct nvkm_output_dp_impl gf110_sor_dp_impl;
int gf110_sor_dp_lnk_ctl(struct nvkm_output_dp *, int, int, bool);
extern struct nvkm_oclass *gf110_disp_outp_sclass[];
223

224
void gm204_sor_magic(struct nvkm_output *outp);
B
Ben Skeggs 已提交
225
extern struct nvkm_output_dp_impl gm204_sor_dp_impl;
226
#endif