summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
blob: aa7b0739d874b8778c1f912c20d3bd53e085eaba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#ifndef __NV50_DISP_H__
#define __NV50_DISP_H__
#define nv50_disp(p) container_of((p), struct nv50_disp, base)
#include "priv.h"
#include "dp.h"

#define NV50_DISP_MTHD_ struct nvkm_object *object,                            \
	struct nv50_disp *disp, void *data, u32 size
#define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp

struct nv50_disp {
	const struct nv50_disp_func *func;
	struct nvkm_disp base;

	struct workqueue_struct *wq;
	struct work_struct supervisor;
	u32 super;

	struct nvkm_event uevent;

	struct {
		u32 lvdsconf;
	} sor;

	struct {
		u8 type[3];
	} pior;

	struct nv50_disp_chan *chan[17];
};

void nv50_disp_super_1(struct nv50_disp *);

int gt215_hda_eld(NV50_DISP_MTHD_V1);
int gf119_hda_eld(NV50_DISP_MTHD_V1);

int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
		   int index, int heads, struct nvkm_disp **);
int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
		    int index, struct nvkm_disp **);

struct nv50_disp_func_outp {
	int (* crt)(struct nvkm_disp *, int index, struct dcb_output *,
		    struct nvkm_output **);
	int (*  tv)(struct nvkm_disp *, int index, struct dcb_output *,
		    struct nvkm_output **);
	int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *,
		    struct nvkm_output **);
	int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *,
		    struct nvkm_output **);
	int (*  dp)(struct nvkm_disp *, int index, struct dcb_output *,
		    struct nvkm_output **);
};

struct nv50_disp_func {
	void (*intr)(struct nv50_disp *);
	void (*intr_error)(struct nv50_disp *, int chid);

	const struct nvkm_event_func *uevent;
	void (*super)(struct work_struct *);

	const struct nvkm_disp_oclass *root;

	struct {
		int (*new)(struct nvkm_disp *, int id);
	} head;

	struct {
		const struct nv50_disp_func_outp internal;
		const struct nv50_disp_func_outp external;
	} outp;

	struct {
		int nr;
		int (*new)(struct nvkm_disp *, int id);
	} dac;

	struct {
		int nr;
		int (*new)(struct nvkm_disp *, int id);
		int (*hda_eld)(NV50_DISP_MTHD_V1);
		void (*magic)(struct nvkm_output *);
	} sor;

	struct {
		int nr;
		int (*new)(struct nvkm_disp *, int id);
	} pior;
};

void nv50_disp_intr(struct nv50_disp *);
void nv50_disp_super(struct work_struct *);

void gf119_disp_intr(struct nv50_disp *);
void gf119_disp_super(struct work_struct *);
void gf119_disp_intr_error(struct nv50_disp *, int);

void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
void nv50_disp_update_sppll1(struct nv50_disp *);
#endif