2015-01-14 02:11:28 +00:00
|
|
|
#ifndef __NVKM_PM_PRIV_H__
|
|
|
|
#define __NVKM_PM_PRIV_H__
|
|
|
|
#include <engine/pm.h>
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfctr {
|
|
|
|
struct nvkm_object base;
|
2015-01-14 02:11:28 +00:00
|
|
|
struct list_head head;
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfsig *signal[4];
|
2015-06-07 20:40:25 +00:00
|
|
|
struct nvkm_perfdom *dom;
|
2015-01-14 02:11:28 +00:00
|
|
|
int slot;
|
|
|
|
u32 logic_op;
|
|
|
|
u32 clk;
|
|
|
|
u32 ctr;
|
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
extern struct nvkm_oclass nvkm_pm_sclass[];
|
|
|
|
|
|
|
|
#include <core/engctx.h>
|
2015-01-14 02:11:28 +00:00
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfctx {
|
|
|
|
struct nvkm_engctx base;
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
extern struct nvkm_oclass nvkm_pm_cclass;
|
2015-01-14 02:11:28 +00:00
|
|
|
|
2015-06-07 20:40:22 +00:00
|
|
|
struct nvkm_specmux {
|
|
|
|
u32 mask;
|
|
|
|
u8 shift;
|
|
|
|
const char *name;
|
|
|
|
bool enable;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nvkm_specsrc {
|
|
|
|
u32 addr;
|
|
|
|
const struct nvkm_specmux *mux;
|
|
|
|
const char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nvkm_perfsrc {
|
|
|
|
struct list_head head;
|
|
|
|
char *name;
|
|
|
|
u32 addr;
|
|
|
|
u32 mask;
|
|
|
|
u8 shift;
|
|
|
|
bool enable;
|
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_specsig {
|
2015-01-14 02:11:28 +00:00
|
|
|
u8 signal;
|
|
|
|
const char *name;
|
2015-06-07 20:40:22 +00:00
|
|
|
const struct nvkm_specsrc *source;
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfsig {
|
2015-01-14 02:11:28 +00:00
|
|
|
const char *name;
|
2015-06-07 20:40:22 +00:00
|
|
|
u8 source[8];
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_specdom {
|
2015-01-14 02:11:28 +00:00
|
|
|
u16 signal_nr;
|
2015-01-14 05:31:13 +00:00
|
|
|
const struct nvkm_specsig *signal;
|
|
|
|
const struct nvkm_funcdom *func;
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfdom {
|
2015-01-14 02:11:28 +00:00
|
|
|
struct list_head head;
|
|
|
|
struct list_head list;
|
2015-01-14 05:31:13 +00:00
|
|
|
const struct nvkm_funcdom *func;
|
2015-01-14 02:11:28 +00:00
|
|
|
char name[32];
|
|
|
|
u32 addr;
|
|
|
|
u8 quad;
|
2015-06-07 20:40:19 +00:00
|
|
|
u16 signal_nr;
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_perfsig signal[];
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
struct nvkm_funcdom {
|
|
|
|
void (*init)(struct nvkm_pm *, struct nvkm_perfdom *,
|
|
|
|
struct nvkm_perfctr *);
|
|
|
|
void (*read)(struct nvkm_pm *, struct nvkm_perfdom *,
|
|
|
|
struct nvkm_perfctr *);
|
|
|
|
void (*next)(struct nvkm_pm *, struct nvkm_perfdom *);
|
2015-01-14 02:11:28 +00:00
|
|
|
};
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
int nvkm_perfdom_new(struct nvkm_pm *, const char *, u32, u32, u32, u32,
|
|
|
|
const struct nvkm_specdom *);
|
2015-01-14 02:11:28 +00:00
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
#define nvkm_pm_create(p,e,o,d) \
|
|
|
|
nvkm_pm_create_((p), (e), (o), sizeof(**d), (void **)d)
|
|
|
|
#define nvkm_pm_dtor(p) ({ \
|
|
|
|
struct nvkm_pm *c = (p); \
|
|
|
|
_nvkm_pm_dtor(nv_object(c)); \
|
2015-01-14 02:11:28 +00:00
|
|
|
})
|
2015-01-14 05:31:13 +00:00
|
|
|
#define nvkm_pm_init(p) ({ \
|
|
|
|
struct nvkm_pm *c = (p); \
|
|
|
|
_nvkm_pm_init(nv_object(c)); \
|
2015-01-14 02:11:28 +00:00
|
|
|
})
|
2015-01-14 05:31:13 +00:00
|
|
|
#define nvkm_pm_fini(p,s) ({ \
|
|
|
|
struct nvkm_pm *c = (p); \
|
|
|
|
_nvkm_pm_fini(nv_object(c), (s)); \
|
2015-01-14 02:11:28 +00:00
|
|
|
})
|
|
|
|
|
2015-01-14 05:31:13 +00:00
|
|
|
int nvkm_pm_create_(struct nvkm_object *, struct nvkm_object *,
|
|
|
|
struct nvkm_oclass *, int, void **);
|
|
|
|
void _nvkm_pm_dtor(struct nvkm_object *);
|
|
|
|
int _nvkm_pm_init(struct nvkm_object *);
|
|
|
|
int _nvkm_pm_fini(struct nvkm_object *, bool);
|
2015-01-14 02:11:28 +00:00
|
|
|
#endif
|