Commit 5ffeb84b authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/pm: convert user classes to new-style nvkm_object

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 218f978d
#ifndef __NVKM_PM_H__
#define __NVKM_PM_H__
#define nvkm_pm(p) container_of((p), struct nvkm_pm, engine)
#include <core/engine.h>
struct nvkm_perfdom;
......@@ -7,20 +8,13 @@ struct nvkm_perfctr;
struct nvkm_pm {
struct nvkm_engine engine;
struct nvkm_perfctx *context;
void *profile_data;
struct nvkm_object *perfmon;
struct list_head domains;
struct list_head sources;
u32 sequence;
};
static inline struct nvkm_pm *
nvkm_pm(void *obj)
{
return (void *)nvkm_engine(obj, NVDEV_ENGINE_PM);
}
extern struct nvkm_oclass *nv40_pm_oclass;
extern struct nvkm_oclass *nv50_pm_oclass;
extern struct nvkm_oclass *g84_pm_oclass;
......
......@@ -226,8 +226,6 @@ gf100_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if (ret)
return ret;
nv_engine(pm)->cclass = &nvkm_pm_cclass;
nv_engine(pm)->sclass = nvkm_pm_sclass;
return 0;
}
......
......@@ -36,8 +36,6 @@ gk110_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if (ret)
return ret;
nv_engine(pm)->cclass = &nvkm_pm_cclass;
nv_engine(pm)->sclass = nvkm_pm_sclass;
return 0;
}
......
......@@ -112,8 +112,6 @@ nv40_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if (ret)
return ret;
nv_engine(pm)->cclass = &nvkm_pm_cclass;
nv_engine(pm)->sclass = nvkm_pm_sclass;
return 0;
}
......
......@@ -12,16 +12,6 @@ struct nvkm_perfctr {
u32 ctr;
};
extern struct nvkm_oclass nvkm_pm_sclass[];
#include <core/gpuobj.h>
struct nvkm_perfctx {
struct nvkm_gpuobj base;
};
extern struct nvkm_oclass nvkm_pm_cclass;
struct nvkm_specmux {
u32 mask;
u8 shift;
......@@ -68,8 +58,11 @@ struct nvkm_specdom {
const struct nvkm_funcdom *func;
};
#define nvkm_perfdom(p) container_of((p), struct nvkm_perfdom, object)
struct nvkm_perfdom {
struct nvkm_object base;
struct nvkm_object object;
struct nvkm_perfmon *perfmon;
struct list_head head;
struct list_head list;
const struct nvkm_funcdom *func;
......@@ -93,6 +86,13 @@ struct nvkm_funcdom {
int nvkm_perfdom_new(struct nvkm_pm *, const char *, u32, u32, u32, u32,
const struct nvkm_specdom *);
#define nvkm_perfmon(p) container_of((p), struct nvkm_perfmon, object)
struct nvkm_perfmon {
struct nvkm_object object;
struct nvkm_pm *pm;
};
#define nvkm_pm_create(p,e,o,d) \
nvkm_pm_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nvkm_pm_dtor(p) ({ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment