summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-03-30 13:49:05 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:50 +1000
commitbd21080eb6ca476cd64afbc3f8e5228a83080ddb (patch)
treea368bedd7fd255e91e91e26bbbbb11ba193575e0 /drivers/gpu/drm
parent9ac596a4e875e28bb1fa4b2e00549fadfaf4784e (diff)
downloadlinux-bd21080eb6ca476cd64afbc3f8e5228a83080ddb.tar.bz2
drm/nouveau/nvif: give every device 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')
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/device.h6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_abi16.c6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c4
-rw-r--r--drivers/gpu/drm/nouveau/nvif/device.c8
4 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvif/device.h b/drivers/gpu/drm/nouveau/include/nvif/device.h
index c2a572c67a76..b0e59800a320 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/device.h
@@ -18,9 +18,9 @@ struct nvif_device {
struct nvif_user user;
};
-int nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32,
- struct nvif_device *);
-void nvif_device_fini(struct nvif_device *);
+int nvif_device_ctor(struct nvif_object *, const char *name, u32 handle,
+ s32 oclass, void *, u32, struct nvif_device *);
+void nvif_device_dtor(struct nvif_device *);
u64 nvif_device_time(struct nvif_device *);
/*XXX*/
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index ace302dc3369..21537ca1dd39 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -55,8 +55,8 @@ nouveau_abi16(struct drm_file *file_priv)
* device (ie. the one that belongs to the fd it
* opened)
*/
- if (nvif_device_init(&cli->base.object, 0, NV_DEVICE,
- &args, sizeof(args),
+ if (nvif_device_ctor(&cli->base.object, "abi16Device",
+ 0, NV_DEVICE, &args, sizeof(args),
&abi16->device) == 0)
return cli->abi16;
@@ -167,7 +167,7 @@ nouveau_abi16_fini(struct nouveau_abi16 *abi16)
}
/* destroy the device object */
- nvif_device_fini(&abi16->device);
+ nvif_device_dtor(&abi16->device);
kfree(cli->abi16);
cli->abi16 = NULL;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 97604bda4a60..ed8fbc60736f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -179,7 +179,7 @@ nouveau_cli_fini(struct nouveau_cli *cli)
nouveau_vmm_fini(&cli->svm);
nouveau_vmm_fini(&cli->vmm);
nvif_mmu_fini(&cli->mmu);
- nvif_device_fini(&cli->device);
+ nvif_device_dtor(&cli->device);
mutex_lock(&cli->drm->master.lock);
nvif_client_dtor(&cli->base);
mutex_unlock(&cli->drm->master.lock);
@@ -238,7 +238,7 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
goto done;
}
- ret = nvif_device_init(&cli->base.object, 0, NV_DEVICE,
+ ret = nvif_device_ctor(&cli->base.object, "drmDevice", 0, NV_DEVICE,
&(struct nv_device_v0) {
.device = ~0,
}, sizeof(struct nv_device_v0),
diff --git a/drivers/gpu/drm/nouveau/nvif/device.c b/drivers/gpu/drm/nouveau/nvif/device.c
index e801c4de2a98..a3aebf865931 100644
--- a/drivers/gpu/drm/nouveau/nvif/device.c
+++ b/drivers/gpu/drm/nouveau/nvif/device.c
@@ -39,7 +39,7 @@ nvif_device_time(struct nvif_device *device)
}
void
-nvif_device_fini(struct nvif_device *device)
+nvif_device_dtor(struct nvif_device *device)
{
nvif_user_fini(device);
kfree(device->runlist);
@@ -48,10 +48,10 @@ nvif_device_fini(struct nvif_device *device)
}
int
-nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass,
- void *data, u32 size, struct nvif_device *device)
+nvif_device_ctor(struct nvif_object *parent, const char *name, u32 handle,
+ s32 oclass, void *data, u32 size, struct nvif_device *device)
{
- int ret = nvif_object_ctor(parent, "nvifDevice", handle,
+ int ret = nvif_object_ctor(parent, name ? name : "nvifDevice", handle,
oclass, data, size, &device->object);
device->runlist = NULL;
device->user.func = NULL;