]>
Commit | Line | Data |
---|---|---|
d5752b9b BS |
1 | #ifndef __NVKM_PM_PRIV_H__ |
2 | #define __NVKM_PM_PRIV_H__ | |
d5752b9b BS |
3 | #include <engine/pm.h> |
4 | ||
4d34686e | 5 | struct nvkm_perfctr { |
d5752b9b | 6 | struct list_head head; |
6137b5a7 | 7 | u8 domain; |
0f380436 | 8 | u8 signal[4]; |
6137b5a7 | 9 | u64 source[4][8]; |
d5752b9b BS |
10 | int slot; |
11 | u32 logic_op; | |
d5752b9b BS |
12 | u32 ctr; |
13 | }; | |
14 | ||
e82661e2 SP |
15 | struct nvkm_specmux { |
16 | u32 mask; | |
17 | u8 shift; | |
18 | const char *name; | |
19 | bool enable; | |
20 | }; | |
21 | ||
22 | struct nvkm_specsrc { | |
23 | u32 addr; | |
24 | const struct nvkm_specmux *mux; | |
25 | const char *name; | |
26 | }; | |
27 | ||
28 | struct nvkm_perfsrc { | |
29 | struct list_head head; | |
30 | char *name; | |
31 | u32 addr; | |
32 | u32 mask; | |
33 | u8 shift; | |
34 | bool enable; | |
35 | }; | |
36 | ||
06b7972d SP |
37 | extern const struct nvkm_specsrc nv50_zcull_sources[]; |
38 | extern const struct nvkm_specsrc nv50_zrop_sources[]; | |
39 | extern const struct nvkm_specsrc g84_vfetch_sources[]; | |
40 | extern const struct nvkm_specsrc gt200_crop_sources[]; | |
41 | extern const struct nvkm_specsrc gt200_prop_sources[]; | |
42 | extern const struct nvkm_specsrc gt200_tex_sources[]; | |
43 | ||
4d34686e | 44 | struct nvkm_specsig { |
d5752b9b BS |
45 | u8 signal; |
46 | const char *name; | |
e82661e2 | 47 | const struct nvkm_specsrc *source; |
d5752b9b BS |
48 | }; |
49 | ||
4d34686e | 50 | struct nvkm_perfsig { |
d5752b9b | 51 | const char *name; |
e82661e2 | 52 | u8 source[8]; |
d5752b9b BS |
53 | }; |
54 | ||
4d34686e | 55 | struct nvkm_specdom { |
d5752b9b | 56 | u16 signal_nr; |
4d34686e BS |
57 | const struct nvkm_specsig *signal; |
58 | const struct nvkm_funcdom *func; | |
d5752b9b BS |
59 | }; |
60 | ||
5ffeb84b BS |
61 | #define nvkm_perfdom(p) container_of((p), struct nvkm_perfdom, object) |
62 | ||
4d34686e | 63 | struct nvkm_perfdom { |
5ffeb84b BS |
64 | struct nvkm_object object; |
65 | struct nvkm_perfmon *perfmon; | |
d5752b9b BS |
66 | struct list_head head; |
67 | struct list_head list; | |
4d34686e | 68 | const struct nvkm_funcdom *func; |
0f380436 | 69 | struct nvkm_perfctr *ctr[4]; |
d5752b9b BS |
70 | char name[32]; |
71 | u32 addr; | |
0f380436 SP |
72 | u8 mode; |
73 | u32 clk; | |
e4047599 | 74 | u16 signal_nr; |
4d34686e | 75 | struct nvkm_perfsig signal[]; |
d5752b9b BS |
76 | }; |
77 | ||
4d34686e BS |
78 | struct nvkm_funcdom { |
79 | void (*init)(struct nvkm_pm *, struct nvkm_perfdom *, | |
80 | struct nvkm_perfctr *); | |
81 | void (*read)(struct nvkm_pm *, struct nvkm_perfdom *, | |
82 | struct nvkm_perfctr *); | |
83 | void (*next)(struct nvkm_pm *, struct nvkm_perfdom *); | |
d5752b9b BS |
84 | }; |
85 | ||
4d34686e BS |
86 | int nvkm_perfdom_new(struct nvkm_pm *, const char *, u32, u32, u32, u32, |
87 | const struct nvkm_specdom *); | |
d5752b9b | 88 | |
5ffeb84b BS |
89 | #define nvkm_perfmon(p) container_of((p), struct nvkm_perfmon, object) |
90 | ||
91 | struct nvkm_perfmon { | |
92 | struct nvkm_object object; | |
93 | struct nvkm_pm *pm; | |
94 | }; | |
95 | ||
4d34686e BS |
96 | #define nvkm_pm_create(p,e,o,d) \ |
97 | nvkm_pm_create_((p), (e), (o), sizeof(**d), (void **)d) | |
98 | #define nvkm_pm_dtor(p) ({ \ | |
99 | struct nvkm_pm *c = (p); \ | |
100 | _nvkm_pm_dtor(nv_object(c)); \ | |
d5752b9b | 101 | }) |
4d34686e BS |
102 | #define nvkm_pm_init(p) ({ \ |
103 | struct nvkm_pm *c = (p); \ | |
104 | _nvkm_pm_init(nv_object(c)); \ | |
d5752b9b | 105 | }) |
4d34686e BS |
106 | #define nvkm_pm_fini(p,s) ({ \ |
107 | struct nvkm_pm *c = (p); \ | |
108 | _nvkm_pm_fini(nv_object(c), (s)); \ | |
d5752b9b BS |
109 | }) |
110 | ||
4d34686e BS |
111 | int nvkm_pm_create_(struct nvkm_object *, struct nvkm_object *, |
112 | struct nvkm_oclass *, int, void **); | |
113 | void _nvkm_pm_dtor(struct nvkm_object *); | |
114 | int _nvkm_pm_init(struct nvkm_object *); | |
115 | int _nvkm_pm_fini(struct nvkm_object *, bool); | |
d5752b9b | 116 | #endif |