#define nvkm_gpuobj_create(p,e,c,v,g,s,a,f,d) \
nvkm_gpuobj_create_((p), (e), (c), (v), (g), (s), (a), (f), \
sizeof(**d), (void **)d)
-#define nvkm_gpuobj_init(p) nvkm_object_init(&(p)->object)
-#define nvkm_gpuobj_fini(p,s) nvkm_object_fini(&(p)->object, (s))
+#define nvkm_gpuobj_init(p) _nvkm_object_init(&(p)->object)
+#define nvkm_gpuobj_fini(p,s) _nvkm_object_fini(&(p)->object, (s))
int nvkm_gpuobj_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, u32 pclass,
struct nvkm_object *, u32 size, u32 align,
int nvkm_object_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, u32, int size, void **);
void nvkm_object_destroy(struct nvkm_object *);
-int nvkm_object_init(struct nvkm_object *);
-int nvkm_object_fini(struct nvkm_object *, bool suspend);
+int _nvkm_object_init(struct nvkm_object *);
+int _nvkm_object_fini(struct nvkm_object *, bool suspend);
int _nvkm_object_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
return nv_oclass(obj)->ofuncs;
}
-int nvkm_object_ctor(struct nvkm_object *, struct nvkm_object *,
+int nvkm_object_old(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
struct nvkm_object **);
void nvkm_object_ref(struct nvkm_object *, struct nvkm_object **);
nvkm_parent_create_((p), (e), (c), (v), (s), (m), \
sizeof(**d), (void **)d)
#define nvkm_parent_init(p) \
- nvkm_object_init(&(p)->object)
+ _nvkm_object_init(&(p)->object)
#define nvkm_parent_fini(p,s) \
- nvkm_object_fini(&(p)->object, (s))
+ _nvkm_object_fini(&(p)->object, (s))
int nvkm_parent_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, u32 pclass,
void nvkm_parent_destroy(struct nvkm_parent *);
void _nvkm_parent_dtor(struct nvkm_object *);
-#define _nvkm_parent_init nvkm_object_init
-#define _nvkm_parent_fini nvkm_object_fini
+#define _nvkm_parent_init _nvkm_object_init
+#define _nvkm_parent_fini _nvkm_object_fini
int nvkm_parent_sclass(struct nvkm_object *, s32 handle,
struct nvkm_object **pengine,
.flags = flags,
};
- return nvkm_object_ctor(parent, &parent->engine->subdev.object,
- &_nvkm_gpuobj_oclass, &args, sizeof(args),
- (struct nvkm_object **)pgpuobj);
+ return nvkm_object_old(parent, &parent->engine->subdev.object,
+ &_nvkm_gpuobj_oclass, &args, sizeof(args),
+ (struct nvkm_object **)pgpuobj);
}
int
.handle = NV_GPUOBJ_CLASS,
.ofuncs = &(struct nvkm_ofuncs) {
.dtor = nvkm_gpudup_dtor,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
},
};
* between the parent and its children (eg. PGRAPH context)
*/
if (engine && nv_engine(engine)->cclass) {
- ret = nvkm_object_ctor(&parent->object, engine,
+ ret = nvkm_object_old(&parent->object, engine,
nv_engine(engine)->cclass,
data, size, &engctx);
if (ret)
}
/* finally, create new object and bind it to its handle */
- ret = nvkm_object_ctor(engctx, engine, oclass, data, size, &object);
+ ret = nvkm_object_old(engctx, engine, oclass, data, size, &object);
client->data = object;
if (ret)
goto fail_ctor;
}
int
-nvkm_object_init(struct nvkm_object *object)
+_nvkm_object_init(struct nvkm_object *object)
{
return 0;
}
int
-nvkm_object_fini(struct nvkm_object *object, bool suspend)
+_nvkm_object_fini(struct nvkm_object *object, bool suspend)
{
return 0;
}
nvkm_object_ofuncs = {
.ctor = _nvkm_object_ctor,
.dtor = nvkm_object_destroy,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
};
int
-nvkm_object_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
+nvkm_object_old(struct nvkm_object *parent, struct nvkm_object *engine,
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
int
nvkm_subdev_init(struct nvkm_subdev *subdev)
{
- int ret = nvkm_object_init(&subdev->object);
+ int ret = _nvkm_object_init(&subdev->object);
if (ret)
return ret;
nvkm_mask(device, 0x000200, subdev->unit, subdev->unit);
}
- return nvkm_object_fini(&subdev->object, suspend);
+ return _nvkm_object_fini(&subdev->object, suspend);
}
int
for (i = 0, c = 0; i < NVDEV_SUBDEV_NR; i++) {
#define _(s,m) case s: if (device->oclass[s] && !device->subdev[s]) { \
- ret = nvkm_object_ctor(nv_object(device), NULL, \
+ ret = nvkm_object_old(nv_object(device), NULL, \
device->oclass[s], NULL, (s), \
(struct nvkm_object **)&device->m); \
if (ret == -ENODEV) { \
nvkm_control_ofuncs = {
.ctor = _nvkm_object_ctor,
.dtor = nvkm_object_destroy,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
.mthd = nvkm_control_mthd,
};
nv04_disp_ofuncs = {
.ctor = _nvkm_object_ctor,
.dtor = nvkm_object_destroy,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
.mthd = nv04_disp_mthd,
.ntfy = nvkm_disp_ntfy,
};
struct nvkm_oclass *, void **, u32 *,
int, void **);
#define _nvkm_dmaobj_dtor nvkm_object_destroy
-#define _nvkm_dmaobj_init nvkm_object_init
-#define _nvkm_dmaobj_fini nvkm_object_fini
+#define _nvkm_dmaobj_init _nvkm_object_init
+#define _nvkm_dmaobj_fini _nvkm_object_fini
int _nvkm_dmaeng_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
.ofuncs = &nvkm_object_ofuncs,
};
args->v0.engine = engines;
- return nvkm_object_ctor(parent, engine, &oclass, NULL, 0, pobject);
+ return nvkm_object_old(parent, engine, &oclass, NULL, 0, pobject);
}
engines &= args->v0.engine;
gf100_fermi_ofuncs = {
.ctor = _nvkm_object_ctor,
.dtor = nvkm_object_destroy,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
.mthd = gf100_fermi_mthd,
};
nvkm_mask(device, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
spin_unlock_irqrestore(&gr->lock, flags);
- return nvkm_object_fini(&chan->base, suspend);
+ return _nvkm_object_fini(&chan->base, suspend);
}
static struct nvkm_oclass
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv04_gr_context_ctor,
.dtor = nv04_gr_context_dtor,
- .init = nvkm_object_init,
+ .init = _nvkm_object_init,
.fini = nv04_gr_context_fini,
},
};
nvkm_mask(device, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
spin_unlock_irqrestore(&gr->lock, flags);
- return nvkm_object_fini(&chan->base, suspend);
+ return _nvkm_object_fini(&chan->base, suspend);
}
static struct nvkm_oclass
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv10_gr_context_ctor,
.dtor = nv10_gr_context_dtor,
- .init = nvkm_object_init,
+ .init = _nvkm_object_init,
.fini = nv10_gr_context_fini,
},
};
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv31_mpeg_context_ctor,
.dtor = nv31_mpeg_context_dtor,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
},
};
nvkm_perfdom_ofuncs = {
.ctor = nvkm_perfdom_ctor,
.dtor = nvkm_perfdom_dtor,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
.mthd = nvkm_perfdom_mthd,
};
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nvkm_barobj_ctor,
.dtor = nvkm_barobj_dtor,
- .init = nvkm_object_init,
- .fini = nvkm_object_fini,
+ .init = _nvkm_object_init,
+ .fini = _nvkm_object_fini,
.rd32 = nvkm_barobj_rd32,
.wr32 = nvkm_barobj_wr32,
},
struct nvkm_mem *mem, struct nvkm_object **pobject)
{
struct nvkm_object *gpuobj;
- int ret = nvkm_object_ctor(parent, &parent->engine->subdev.object,
+ int ret = nvkm_object_old(parent, &parent->engine->subdev.object,
&nvkm_barobj_oclass, mem, 0, &gpuobj);
if (ret == 0)
*pobject = gpuobj;
{
struct nvkm_instmem_impl *impl = (void *)imem->subdev.object.oclass;
struct nvkm_instobj_args args = { .size = size, .align = align };
- return nvkm_object_ctor(parent, &parent->engine->subdev.object,
+ return nvkm_object_old(parent, &parent->engine->subdev.object,
impl->instobj, &args, sizeof(args), pobject);
}
_nvkm_instobj_dtor(nv_object(iobj)); \
})
#define nvkm_instobj_init(p) \
- nvkm_object_init(&(p)->base)
+ _nvkm_object_init(&(p)->base)
#define nvkm_instobj_fini(p,s) \
- nvkm_object_fini(&(p)->base, (s))
+ _nvkm_object_fini(&(p)->base, (s))
int nvkm_instobj_create_(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, int, void **);
void _nvkm_instobj_dtor(struct nvkm_object *);
-#define _nvkm_instobj_init nvkm_object_init
-#define _nvkm_instobj_fini nvkm_object_fini
+#define _nvkm_instobj_init _nvkm_object_init
+#define _nvkm_instobj_fini _nvkm_object_fini
struct nvkm_instmem_impl {
struct nvkm_oclass base;
if (pci_find_capability(device->pdev, PCI_CAP_ID_AGP) ||
!nvkm_boolopt(device->cfgopt, "NvPCIE", true)) {
- return nvkm_object_ctor(parent, engine, &nv04_mmu_oclass,
+ return nvkm_object_old(parent, engine, &nv04_mmu_oclass,
data, size, pobject);
}
if (pci_find_capability(device->pdev, PCI_CAP_ID_AGP) ||
!nvkm_boolopt(device->cfgopt, "NvPCIE", true)) {
- return nvkm_object_ctor(parent, engine, &nv04_mmu_oclass,
+ return nvkm_object_old(parent, engine, &nv04_mmu_oclass,
data, size, pobject);
}