Commit 45faf3d7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/nvif: give every vmm object a human-readable identifier

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent e79c9a0b
...@@ -30,9 +30,9 @@ struct nvif_vmm { ...@@ -30,9 +30,9 @@ struct nvif_vmm {
int page_nr; int page_nr;
}; };
int nvif_vmm_init(struct nvif_mmu *, s32 oclass, bool managed, u64 addr, int nvif_vmm_ctor(struct nvif_mmu *, const char *name, s32 oclass, bool managed,
u64 size, void *argv, u32 argc, struct nvif_vmm *); u64 addr, u64 size, void *argv, u32 argc, struct nvif_vmm *);
void nvif_vmm_fini(struct nvif_vmm *); void nvif_vmm_dtor(struct nvif_vmm *);
int nvif_vmm_get(struct nvif_vmm *, enum nvif_vmm_get, bool sparse, int nvif_vmm_get(struct nvif_vmm *, enum nvif_vmm_get, bool sparse,
u8 page, u8 align, u64 size, struct nvif_vma *); u8 page, u8 align, u64 size, struct nvif_vma *);
void nvif_vmm_put(struct nvif_vmm *, struct nvif_vma *); void nvif_vmm_put(struct nvif_vmm *, struct nvif_vma *);
......
...@@ -347,7 +347,8 @@ nouveau_svmm_init(struct drm_device *dev, void *data, ...@@ -347,7 +347,8 @@ nouveau_svmm_init(struct drm_device *dev, void *data,
* All future channel/memory allocations will make use of this * All future channel/memory allocations will make use of this
* VMM instead of the standard one. * VMM instead of the standard one.
*/ */
ret = nvif_vmm_init(&cli->mmu, cli->vmm.vmm.object.oclass, true, ret = nvif_vmm_ctor(&cli->mmu, "svmVmm",
cli->vmm.vmm.object.oclass, true,
args->unmanaged_addr, args->unmanaged_size, args->unmanaged_addr, args->unmanaged_size,
&(struct gp100_vmm_v0) { &(struct gp100_vmm_v0) {
.fault_replay = true, .fault_replay = true,
......
...@@ -121,15 +121,15 @@ void ...@@ -121,15 +121,15 @@ void
nouveau_vmm_fini(struct nouveau_vmm *vmm) nouveau_vmm_fini(struct nouveau_vmm *vmm)
{ {
nouveau_svmm_fini(&vmm->svmm); nouveau_svmm_fini(&vmm->svmm);
nvif_vmm_fini(&vmm->vmm); nvif_vmm_dtor(&vmm->vmm);
vmm->cli = NULL; vmm->cli = NULL;
} }
int int
nouveau_vmm_init(struct nouveau_cli *cli, s32 oclass, struct nouveau_vmm *vmm) nouveau_vmm_init(struct nouveau_cli *cli, s32 oclass, struct nouveau_vmm *vmm)
{ {
int ret = nvif_vmm_init(&cli->mmu, oclass, false, PAGE_SIZE, 0, NULL, 0, int ret = nvif_vmm_ctor(&cli->mmu, "drmVmm", oclass, false, PAGE_SIZE,
&vmm->vmm); 0, NULL, 0, &vmm->vmm);
if (ret) if (ret)
return ret; return ret;
......
...@@ -105,15 +105,15 @@ nvif_vmm_get(struct nvif_vmm *vmm, enum nvif_vmm_get type, bool sparse, ...@@ -105,15 +105,15 @@ nvif_vmm_get(struct nvif_vmm *vmm, enum nvif_vmm_get type, bool sparse,
} }
void void
nvif_vmm_fini(struct nvif_vmm *vmm) nvif_vmm_dtor(struct nvif_vmm *vmm)
{ {
kfree(vmm->page); kfree(vmm->page);
nvif_object_dtor(&vmm->object); nvif_object_dtor(&vmm->object);
} }
int int
nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr, nvif_vmm_ctor(struct nvif_mmu *mmu, const char *name, s32 oclass, bool managed,
u64 size, void *argv, u32 argc, struct nvif_vmm *vmm) u64 addr, u64 size, void *argv, u32 argc, struct nvif_vmm *vmm)
{ {
struct nvif_vmm_v0 *args; struct nvif_vmm_v0 *args;
u32 argn = sizeof(*args) + argc; u32 argn = sizeof(*args) + argc;
...@@ -130,8 +130,8 @@ nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr, ...@@ -130,8 +130,8 @@ nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr,
args->size = size; args->size = size;
memcpy(args->data, argv, argc); memcpy(args->data, argv, argc);
ret = nvif_object_ctor(&mmu->object, "nvifVmm", 0, oclass, args, argn, ret = nvif_object_ctor(&mmu->object, name ? name : "nvifVmm", 0,
&vmm->object); oclass, args, argn, &vmm->object);
if (ret) if (ret)
goto done; goto done;
...@@ -163,7 +163,7 @@ nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr, ...@@ -163,7 +163,7 @@ nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr,
done: done:
if (ret) if (ret)
nvif_vmm_fini(vmm); nvif_vmm_dtor(vmm);
kfree(args); kfree(args);
return ret; return ret;
} }
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