Commit bd21080e authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 9ac596a4
...@@ -18,9 +18,9 @@ struct nvif_device { ...@@ -18,9 +18,9 @@ struct nvif_device {
struct nvif_user user; struct nvif_user user;
}; };
int nvif_device_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32, int nvif_device_ctor(struct nvif_object *, const char *name, u32 handle,
struct nvif_device *); s32 oclass, void *, u32, struct nvif_device *);
void nvif_device_fini(struct nvif_device *); void nvif_device_dtor(struct nvif_device *);
u64 nvif_device_time(struct nvif_device *); u64 nvif_device_time(struct nvif_device *);
/*XXX*/ /*XXX*/
......
...@@ -55,8 +55,8 @@ nouveau_abi16(struct drm_file *file_priv) ...@@ -55,8 +55,8 @@ nouveau_abi16(struct drm_file *file_priv)
* device (ie. the one that belongs to the fd it * device (ie. the one that belongs to the fd it
* opened) * opened)
*/ */
if (nvif_device_init(&cli->base.object, 0, NV_DEVICE, if (nvif_device_ctor(&cli->base.object, "abi16Device",
&args, sizeof(args), 0, NV_DEVICE, &args, sizeof(args),
&abi16->device) == 0) &abi16->device) == 0)
return cli->abi16; return cli->abi16;
...@@ -167,7 +167,7 @@ nouveau_abi16_fini(struct nouveau_abi16 *abi16) ...@@ -167,7 +167,7 @@ nouveau_abi16_fini(struct nouveau_abi16 *abi16)
} }
/* destroy the device object */ /* destroy the device object */
nvif_device_fini(&abi16->device); nvif_device_dtor(&abi16->device);
kfree(cli->abi16); kfree(cli->abi16);
cli->abi16 = NULL; cli->abi16 = NULL;
......
...@@ -179,7 +179,7 @@ nouveau_cli_fini(struct nouveau_cli *cli) ...@@ -179,7 +179,7 @@ nouveau_cli_fini(struct nouveau_cli *cli)
nouveau_vmm_fini(&cli->svm); nouveau_vmm_fini(&cli->svm);
nouveau_vmm_fini(&cli->vmm); nouveau_vmm_fini(&cli->vmm);
nvif_mmu_fini(&cli->mmu); nvif_mmu_fini(&cli->mmu);
nvif_device_fini(&cli->device); nvif_device_dtor(&cli->device);
mutex_lock(&cli->drm->master.lock); mutex_lock(&cli->drm->master.lock);
nvif_client_dtor(&cli->base); nvif_client_dtor(&cli->base);
mutex_unlock(&cli->drm->master.lock); mutex_unlock(&cli->drm->master.lock);
...@@ -238,7 +238,7 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname, ...@@ -238,7 +238,7 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
goto done; 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) { &(struct nv_device_v0) {
.device = ~0, .device = ~0,
}, sizeof(struct nv_device_v0), }, sizeof(struct nv_device_v0),
......
...@@ -39,7 +39,7 @@ nvif_device_time(struct nvif_device *device) ...@@ -39,7 +39,7 @@ nvif_device_time(struct nvif_device *device)
} }
void void
nvif_device_fini(struct nvif_device *device) nvif_device_dtor(struct nvif_device *device)
{ {
nvif_user_fini(device); nvif_user_fini(device);
kfree(device->runlist); kfree(device->runlist);
...@@ -48,10 +48,10 @@ nvif_device_fini(struct nvif_device *device) ...@@ -48,10 +48,10 @@ nvif_device_fini(struct nvif_device *device)
} }
int int
nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass, nvif_device_ctor(struct nvif_object *parent, const char *name, u32 handle,
void *data, u32 size, struct nvif_device *device) 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); oclass, data, size, &device->object);
device->runlist = NULL; device->runlist = NULL;
device->user.func = NULL; device->user.func = NULL;
......
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