aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvif
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-03-30 09:51:33 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:50 +1000
commit9ac596a4e875e28bb1fa4b2e00549fadfaf4784e (patch)
tree594d5c460f5ee75de9b293d1504639b941b0768f /drivers/gpu/drm/nouveau/nvif
parentdrm/nouveau/nvif: rename client ctor/dtor (diff)
downloadlinux-dev-9ac596a4e875e28bb1fa4b2e00549fadfaf4784e.tar.xz
linux-dev-9ac596a4e875e28bb1fa4b2e00549fadfaf4784e.zip
drm/nouveau/nvif: give every object a human-readable identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/client.c7
-rw-r--r--drivers/gpu/drm/nouveau/nvif/device.c6
-rw-r--r--drivers/gpu/drm/nouveau/nvif/disp.c6
-rw-r--r--drivers/gpu/drm/nouveau/nvif/mem.c4
-rw-r--r--drivers/gpu/drm/nouveau/nvif/mmu.c6
-rw-r--r--drivers/gpu/drm/nouveau/nvif/object.c11
-rw-r--r--drivers/gpu/drm/nouveau/nvif/user.c5
-rw-r--r--drivers/gpu/drm/nouveau/nvif/vmm.c4
8 files changed, 26 insertions, 23 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/client.c b/drivers/gpu/drm/nouveau/nvif/client.c
index a36902c1c287..12644f811b3e 100644
--- a/drivers/gpu/drm/nouveau/nvif/client.c
+++ b/drivers/gpu/drm/nouveau/nvif/client.c
@@ -50,7 +50,7 @@ nvif_client_resume(struct nvif_client *client)
void
nvif_client_dtor(struct nvif_client *client)
{
- nvif_object_fini(&client->object);
+ nvif_object_dtor(&client->object);
if (client->driver) {
if (client->driver->fini)
client->driver->fini(client->object.priv);
@@ -70,8 +70,9 @@ nvif_client_ctor(struct nvif_client *parent, const char *name, u64 device,
int ret;
strncpy(args.name, name, sizeof(args.name));
- ret = nvif_object_init(parent != client ? &parent->object : NULL,
- 0, NVIF_CLASS_CLIENT, &args, sizeof(args),
+ ret = nvif_object_ctor(parent != client ? &parent->object : NULL,
+ name ? name : "nvifClient", 0,
+ NVIF_CLASS_CLIENT, &args, sizeof(args),
&client->object);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/nouveau/nvif/device.c b/drivers/gpu/drm/nouveau/nvif/device.c
index 0e92db44bbc8..e801c4de2a98 100644
--- a/drivers/gpu/drm/nouveau/nvif/device.c
+++ b/drivers/gpu/drm/nouveau/nvif/device.c
@@ -44,15 +44,15 @@ nvif_device_fini(struct nvif_device *device)
nvif_user_fini(device);
kfree(device->runlist);
device->runlist = NULL;
- nvif_object_fini(&device->object);
+ nvif_object_dtor(&device->object);
}
int
nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass,
void *data, u32 size, struct nvif_device *device)
{
- int ret = nvif_object_init(parent, handle, oclass, data, size,
- &device->object);
+ int ret = nvif_object_ctor(parent, "nvifDevice", handle,
+ oclass, data, size, &device->object);
device->runlist = NULL;
device->user.func = NULL;
if (ret == 0) {
diff --git a/drivers/gpu/drm/nouveau/nvif/disp.c b/drivers/gpu/drm/nouveau/nvif/disp.c
index 61638b3b9d3d..122208adcd3c 100644
--- a/drivers/gpu/drm/nouveau/nvif/disp.c
+++ b/drivers/gpu/drm/nouveau/nvif/disp.c
@@ -27,7 +27,7 @@
void
nvif_disp_dtor(struct nvif_disp *disp)
{
- nvif_object_fini(&disp->object);
+ nvif_object_dtor(&disp->object);
}
int
@@ -56,6 +56,6 @@ nvif_disp_ctor(struct nvif_device *device, s32 oclass, struct nvif_disp *disp)
if (cid < 0)
return cid;
- return nvif_object_init(&device->object, 0, disps[cid].oclass,
- NULL, 0, &disp->object);
+ return nvif_object_ctor(&device->object, "nvifDisp", 0,
+ disps[cid].oclass, NULL, 0, &disp->object);
}
diff --git a/drivers/gpu/drm/nouveau/nvif/mem.c b/drivers/gpu/drm/nouveau/nvif/mem.c
index b6ebb3b58673..5241d89d7c70 100644
--- a/drivers/gpu/drm/nouveau/nvif/mem.c
+++ b/drivers/gpu/drm/nouveau/nvif/mem.c
@@ -40,7 +40,7 @@ nvif_mem_init_map(struct nvif_mmu *mmu, u8 type, u64 size, struct nvif_mem *mem)
void
nvif_mem_fini(struct nvif_mem *mem)
{
- nvif_object_fini(&mem->object);
+ nvif_object_dtor(&mem->object);
}
int
@@ -67,7 +67,7 @@ nvif_mem_init_type(struct nvif_mmu *mmu, s32 oclass, int type, u8 page,
args->size = size;
memcpy(args->data, argv, argc);
- ret = nvif_object_init(&mmu->object, 0, oclass, args,
+ ret = nvif_object_ctor(&mmu->object, "nvifMem", 0, oclass, args,
sizeof(*args) + argc, &mem->object);
if (ret == 0) {
mem->type = mmu->type[type].type;
diff --git a/drivers/gpu/drm/nouveau/nvif/mmu.c b/drivers/gpu/drm/nouveau/nvif/mmu.c
index 47efc408efa6..aa6ec915d603 100644
--- a/drivers/gpu/drm/nouveau/nvif/mmu.c
+++ b/drivers/gpu/drm/nouveau/nvif/mmu.c
@@ -30,7 +30,7 @@ nvif_mmu_fini(struct nvif_mmu *mmu)
kfree(mmu->kind);
kfree(mmu->type);
kfree(mmu->heap);
- nvif_object_fini(&mmu->object);
+ nvif_object_dtor(&mmu->object);
}
int
@@ -50,8 +50,8 @@ nvif_mmu_init(struct nvif_object *parent, s32 oclass, struct nvif_mmu *mmu)
mmu->type = NULL;
mmu->kind = NULL;
- ret = nvif_object_init(parent, 0, oclass, &args, sizeof(args),
- &mmu->object);
+ ret = nvif_object_ctor(parent, "nvifMmu", 0, oclass, &args,
+ sizeof(args), &mmu->object);
if (ret)
goto done;
diff --git a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c
index ef3f62840e83..9f3348327244 100644
--- a/drivers/gpu/drm/nouveau/nvif/object.c
+++ b/drivers/gpu/drm/nouveau/nvif/object.c
@@ -242,7 +242,7 @@ nvif_object_map(struct nvif_object *object, void *argv, u32 argc)
}
void
-nvif_object_fini(struct nvif_object *object)
+nvif_object_dtor(struct nvif_object *object)
{
struct {
struct nvif_ioctl_v0 ioctl;
@@ -260,8 +260,8 @@ nvif_object_fini(struct nvif_object *object)
}
int
-nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
- void *data, u32 size, struct nvif_object *object)
+nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
+ s32 oclass, void *data, u32 size, struct nvif_object *object)
{
struct {
struct nvif_ioctl_v0 ioctl;
@@ -270,6 +270,7 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
int ret = 0;
object->client = NULL;
+ object->name = name ? name : "nvifObject";
object->handle = handle;
object->oclass = oclass;
object->map.ptr = NULL;
@@ -277,7 +278,7 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
if (parent) {
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) {
- nvif_object_fini(object);
+ nvif_object_dtor(object);
return -ENOMEM;
}
@@ -300,6 +301,6 @@ nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass,
}
if (ret)
- nvif_object_fini(object);
+ nvif_object_dtor(object);
return ret;
}
diff --git a/drivers/gpu/drm/nouveau/nvif/user.c b/drivers/gpu/drm/nouveau/nvif/user.c
index 10da3cdca647..490fd18d02c0 100644
--- a/drivers/gpu/drm/nouveau/nvif/user.c
+++ b/drivers/gpu/drm/nouveau/nvif/user.c
@@ -28,7 +28,7 @@ void
nvif_user_fini(struct nvif_device *device)
{
if (device->user.func) {
- nvif_object_fini(&device->user.object);
+ nvif_object_dtor(&device->user.object);
device->user.func = NULL;
}
}
@@ -53,7 +53,8 @@ nvif_user_init(struct nvif_device *device)
if (cid < 0)
return cid;
- ret = nvif_object_init(&device->object, 0, users[cid].oclass, NULL, 0,
+ ret = nvif_object_ctor(&device->object, "nvifUsermode",
+ 0, users[cid].oclass, NULL, 0,
&device->user.object);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/nouveau/nvif/vmm.c b/drivers/gpu/drm/nouveau/nvif/vmm.c
index 11487c00b909..dc82e5515fc5 100644
--- a/drivers/gpu/drm/nouveau/nvif/vmm.c
+++ b/drivers/gpu/drm/nouveau/nvif/vmm.c
@@ -108,7 +108,7 @@ void
nvif_vmm_fini(struct nvif_vmm *vmm)
{
kfree(vmm->page);
- nvif_object_fini(&vmm->object);
+ nvif_object_dtor(&vmm->object);
}
int
@@ -130,7 +130,7 @@ nvif_vmm_init(struct nvif_mmu *mmu, s32 oclass, bool managed, u64 addr,
args->size = size;
memcpy(args->data, argv, argc);
- ret = nvif_object_init(&mmu->object, 0, oclass, args, argn,
+ ret = nvif_object_ctor(&mmu->object, "nvifVmm", 0, oclass, args, argn,
&vmm->object);
if (ret)
goto done;