drm/nv50-/disp: handle supervisor tasks from workqueue
[deliverable/linux.git] / drivers / gpu / drm / nouveau / core / engine / disp / nv50.h
CommitLineData
70cabe4a
BS
1#ifndef __NV50_DISP_H__
2#define __NV50_DISP_H__
3
4#include <core/parent.h>
370c00f9 5#include <core/namedb.h>
1d7c71a3 6#include <core/engctx.h>
370c00f9 7#include <core/ramht.h>
1d7c71a3 8#include <core/event.h>
370c00f9
BS
9
10#include <engine/dmaobj.h>
70cabe4a
BS
11#include <engine/disp.h>
12
6c5a0424
BS
13struct dcb_output;
14
70cabe4a
BS
15struct nv50_disp_priv {
16 struct nouveau_disp base;
17 struct nouveau_oclass *sclass;
5cc027f6
BS
18
19 struct work_struct supervisor;
20 u32 super;
21
70cabe4a
BS
22 struct {
23 int nr;
24 } head;
25 struct {
26 int nr;
35b21d39 27 int (*power)(struct nv50_disp_priv *, int dac, u32 data);
7ebb38b5 28 int (*sense)(struct nv50_disp_priv *, int dac, u32 load);
70cabe4a
BS
29 } dac;
30 struct {
31 int nr;
74b66850 32 int (*power)(struct nv50_disp_priv *, int sor, u32 data);
0a9e2b95 33 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32);
1c30cd09 34 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32);
8f2abc25
BS
35 int (*dp_train_init)(struct nv50_disp_priv *, int sor, int link,
36 int head, u16 type, u16 mask, u32 data,
37 struct dcb_output *);
38 int (*dp_train_fini)(struct nv50_disp_priv *, int sor, int link,
39 int head, u16 type, u16 mask, u32 data,
40 struct dcb_output *);
6c5a0424
BS
41 int (*dp_train)(struct nv50_disp_priv *, int sor, int link,
42 u16 type, u16 mask, u32 data,
43 struct dcb_output *);
44 int (*dp_lnkctl)(struct nv50_disp_priv *, int sor, int link,
45 int head, u16 type, u16 mask, u32 data,
46 struct dcb_output *);
47 int (*dp_drvctl)(struct nv50_disp_priv *, int sor, int link,
48 int lane, u16 type, u16 mask, u32 data,
49 struct dcb_output *);
4a230fa6 50 u32 lvdsconf;
70cabe4a
BS
51 } sor;
52};
53
35b21d39
BS
54#define DAC_MTHD(n) (n), (n) + 0x03
55
56int nv50_dac_mthd(struct nouveau_object *, u32, void *, u32);
57int nv50_dac_power(struct nv50_disp_priv *, int, u32);
7ebb38b5 58int nv50_dac_sense(struct nv50_disp_priv *, int, u32);
35b21d39 59
6c5a0424
BS
60#define SOR_MTHD(n) (n), (n) + 0x3f
61
a4feaf4e
BS
62int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
63int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32);
64
8e9e3d2d
BS
65int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
66int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
a4feaf4e
BS
67int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32);
68
6c5a0424 69int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32);
74b66850 70int nv50_sor_power(struct nv50_disp_priv *, int, u32);
6c5a0424 71
8f2abc25
BS
72int nv94_sor_dp_train_init(struct nv50_disp_priv *, int, int, int, u16, u16,
73 u32, struct dcb_output *);
74int nv94_sor_dp_train_fini(struct nv50_disp_priv *, int, int, int, u16, u16,
75 u32, struct dcb_output *);
f7960736
BS
76int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
77 struct dcb_output *);
78int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
79 struct dcb_output *);
80int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
81 struct dcb_output *);
82
6c5a0424
BS
83int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32,
84 struct dcb_output *);
85int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
86 struct dcb_output *);
87int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32,
88 struct dcb_output *);
89
70cabe4a
BS
90struct nv50_disp_base {
91 struct nouveau_parent base;
370c00f9
BS
92 struct nouveau_ramht *ramht;
93 u32 chan;
70cabe4a
BS
94};
95
96struct nv50_disp_chan {
370c00f9
BS
97 struct nouveau_namedb base;
98 int chid;
99};
100
101int nv50_disp_chan_create_(struct nouveau_object *, struct nouveau_object *,
102 struct nouveau_oclass *, int, int, void **);
103void nv50_disp_chan_destroy(struct nv50_disp_chan *);
104u32 nv50_disp_chan_rd32(struct nouveau_object *, u64);
105void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32);
106
107#define nv50_disp_chan_init(a) \
108 nouveau_namedb_init(&(a)->base)
109#define nv50_disp_chan_fini(a,b) \
110 nouveau_namedb_fini(&(a)->base, (b))
111
112int nv50_disp_dmac_create_(struct nouveau_object *, struct nouveau_object *,
113 struct nouveau_oclass *, u32, int, int, void **);
114void nv50_disp_dmac_dtor(struct nouveau_object *);
115
116struct nv50_disp_dmac {
117 struct nv50_disp_chan base;
118 struct nouveau_dmaobj *pushdma;
119 u32 push;
120};
121
122struct nv50_disp_pioc {
123 struct nv50_disp_chan base;
70cabe4a
BS
124};
125
126extern struct nouveau_ofuncs nv50_disp_mast_ofuncs;
370c00f9
BS
127extern struct nouveau_ofuncs nv50_disp_sync_ofuncs;
128extern struct nouveau_ofuncs nv50_disp_ovly_ofuncs;
129extern struct nouveau_ofuncs nv50_disp_oimm_ofuncs;
130extern struct nouveau_ofuncs nv50_disp_curs_ofuncs;
70cabe4a
BS
131extern struct nouveau_ofuncs nv50_disp_base_ofuncs;
132extern struct nouveau_oclass nv50_disp_cclass;
5cc027f6 133void nv50_disp_intr_supervisor(struct work_struct *);
70cabe4a
BS
134void nv50_disp_intr(struct nouveau_subdev *);
135
ef22c8bb
BS
136extern struct nouveau_omthds nv84_disp_base_omthds[];
137
138extern struct nouveau_omthds nva3_disp_base_omthds[];
139
46654061
BS
140extern struct nouveau_ofuncs nvd0_disp_mast_ofuncs;
141extern struct nouveau_ofuncs nvd0_disp_sync_ofuncs;
142extern struct nouveau_ofuncs nvd0_disp_ovly_ofuncs;
143extern struct nouveau_ofuncs nvd0_disp_oimm_ofuncs;
144extern struct nouveau_ofuncs nvd0_disp_curs_ofuncs;
145extern struct nouveau_ofuncs nvd0_disp_base_ofuncs;
146extern struct nouveau_oclass nvd0_disp_cclass;
5cc027f6 147void nvd0_disp_intr_supervisor(struct work_struct *);
46654061
BS
148void nvd0_disp_intr(struct nouveau_subdev *);
149
70cabe4a 150#endif
This page took 0.057986 seconds and 5 git commands to generate.