1 #ifndef __NVKM_PM_PRIV_H__
2 #define __NVKM_PM_PRIV_H__
6 struct nouveau_perfctr {
7 struct nouveau_object base;
9 struct nouveau_perfsig *signal[4];
16 extern struct nouveau_oclass nouveau_pm_sclass[];
18 struct nouveau_perfctx {
19 struct nouveau_engctx base;
22 extern struct nouveau_oclass nouveau_pm_cclass;
24 struct nouveau_specsig {
29 struct nouveau_perfsig {
33 struct nouveau_perfdom;
34 struct nouveau_perfctr *
35 nouveau_perfsig_wrap(struct nouveau_pm *, const char *,
36 struct nouveau_perfdom **);
38 struct nouveau_specdom {
40 const struct nouveau_specsig *signal;
41 const struct nouveau_funcdom *func;
44 extern const struct nouveau_specdom nva3_pm_pwr[];
45 extern const struct nouveau_specdom nvc0_pm_pwr[];
46 extern const struct nouveau_specdom nve0_pm_pwr[];
48 struct nouveau_perfdom {
49 struct list_head head;
50 struct list_head list;
51 const struct nouveau_funcdom *func;
56 struct nouveau_perfsig signal[];
59 struct nouveau_funcdom {
60 void (*init)(struct nouveau_pm *, struct nouveau_perfdom *,
61 struct nouveau_perfctr *);
62 void (*read)(struct nouveau_pm *, struct nouveau_perfdom *,
63 struct nouveau_perfctr *);
64 void (*next)(struct nouveau_pm *, struct nouveau_perfdom *);
67 int nouveau_perfdom_new(struct nouveau_pm *, const char *, u32,
68 u32, u32, u32, const struct nouveau_specdom *);
70 #define nouveau_pm_create(p,e,o,d) \
71 nouveau_pm_create_((p), (e), (o), sizeof(**d), (void **)d)
72 #define nouveau_pm_dtor(p) ({ \
73 struct nouveau_pm *c = (p); \
74 _nouveau_pm_dtor(nv_object(c)); \
76 #define nouveau_pm_init(p) ({ \
77 struct nouveau_pm *c = (p); \
78 _nouveau_pm_init(nv_object(c)); \
80 #define nouveau_pm_fini(p,s) ({ \
81 struct nouveau_pm *c = (p); \
82 _nouveau_pm_fini(nv_object(c), (s)); \
85 int nouveau_pm_create_(struct nouveau_object *, struct nouveau_object *,
86 struct nouveau_oclass *, int, void **);
87 void _nouveau_pm_dtor(struct nouveau_object *);
88 int _nouveau_pm_init(struct nouveau_object *);
89 int _nouveau_pm_fini(struct nouveau_object *, bool);