From f4781afcc3ceb421c50221e6219cf2657f40d5ce Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 30 Mar 2020 14:01:57 +1000
Subject: drm/nouveau/nvif: give every usermode object a human-readable
Git-commit: 64a0f59ab12467ace3e86b98ca47255827049d02
Patch-mainline: v5.9-rc1
References: jsc#SLE-12680, jsc#SLE-12880, jsc#SLE-12882, jsc#SLE-12883, jsc#SLE-13496, jsc#SLE-15322
identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
drivers/gpu/drm/nouveau/include/nvif/user.h | 4 ++--
drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
drivers/gpu/drm/nouveau/nvif/device.c | 2 +-
drivers/gpu/drm/nouveau/nvif/user.c | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/include/nvif/user.h b/drivers/gpu/drm/nouveau/include/nvif/user.h
index 6825574d93c2..146986a9fe53 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/user.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/user.h
@@ -13,8 +13,8 @@ struct nvif_user_func {
u64 (*time)(struct nvif_user *);
};
-int nvif_user_init(struct nvif_device *);
-void nvif_user_fini(struct nvif_device *);
+int nvif_user_ctor(struct nvif_device *, const char *name);
+void nvif_user_dtor(struct nvif_device *);
extern const struct nvif_user_func nvif_userc361;
#endif
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index bfb8d4c1a2d8..6f24a215ac74 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -483,7 +483,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
/* Volta requires access to a doorbell register for kickoff. */
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_VOLTA) {
- ret = nvif_user_init(device);
+ ret = nvif_user_ctor(device, "drmUsermode");
if (ret)
return;
}
diff --git a/drivers/gpu/drm/nouveau/nvif/device.c b/drivers/gpu/drm/nouveau/nvif/device.c
index a3aebf865931..8c3d883f3313 100644
--- a/drivers/gpu/drm/nouveau/nvif/device.c
+++ b/drivers/gpu/drm/nouveau/nvif/device.c
@@ -41,7 +41,7 @@ nvif_device_time(struct nvif_device *device)
void
nvif_device_dtor(struct nvif_device *device)
{
- nvif_user_fini(device);
+ nvif_user_dtor(device);
kfree(device->runlist);
device->runlist = NULL;
nvif_object_dtor(&device->object);
diff --git a/drivers/gpu/drm/nouveau/nvif/user.c b/drivers/gpu/drm/nouveau/nvif/user.c
index 490fd18d02c0..d89f5b67b304 100644
--- a/drivers/gpu/drm/nouveau/nvif/user.c
+++ b/drivers/gpu/drm/nouveau/nvif/user.c
@@ -25,7 +25,7 @@
#include <nvif/class.h>
void
-nvif_user_fini(struct nvif_device *device)
+nvif_user_dtor(struct nvif_device *device)
{
if (device->user.func) {
nvif_object_dtor(&device->user.object);
@@ -34,7 +34,7 @@ nvif_user_fini(struct nvif_device *device)
}
int
-nvif_user_init(struct nvif_device *device)
+nvif_user_ctor(struct nvif_device *device, const char *name)
{
struct {
s32 oclass;
@@ -53,7 +53,7 @@ nvif_user_init(struct nvif_device *device)
if (cid < 0)
return cid;
- ret = nvif_object_ctor(&device->object, "nvifUsermode",
+ ret = nvif_object_ctor(&device->object, name ? name : "nvifUsermode",
0, users[cid].oclass, NULL, 0,
&device->user.object);
if (ret)
--
2.29.2