drm/nouveau/nvif: give every disp object a human-readable identifier
authorBen Skeggs <bskeggs@redhat.com>
Mon, 30 Mar 2020 04:03:20 +0000 (14:03 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 24 Jul 2020 08:50:51 +0000 (18:50 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/include/nvif/disp.h
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nvif/disp.c

index 7c0eda3..07ac544 100644 (file)
@@ -7,6 +7,7 @@ struct nvif_disp {
        struct nvif_object object;
 };
 
-int nvif_disp_ctor(struct nvif_device *, s32 oclass, struct nvif_disp *);
+int nvif_disp_ctor(struct nvif_device *, const char *name, s32 oclass,
+                  struct nvif_disp *);
 void nvif_disp_dtor(struct nvif_disp *);
 #endif
index 657554c..63c58f1 100644 (file)
@@ -635,7 +635,8 @@ nouveau_display_create(struct drm_device *dev)
        drm_kms_helper_poll_disable(dev);
 
        if (nouveau_modeset != 2 && drm->vbios.dcb.entries) {
-               ret = nvif_disp_ctor(&drm->client.device, 0, &disp->disp);
+               ret = nvif_disp_ctor(&drm->client.device, "kmsDisp", 0,
+                                    &disp->disp);
                if (ret == 0) {
                        nouveau_display_create_properties(dev);
                        if (disp->disp.object.oclass < NV50_DISP)
index 122208a..8d0d30e 100644 (file)
@@ -31,7 +31,8 @@ nvif_disp_dtor(struct nvif_disp *disp)
 }
 
 int
-nvif_disp_ctor(struct nvif_device *device, s32 oclass, struct nvif_disp *disp)
+nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass,
+              struct nvif_disp *disp)
 {
        static const struct nvif_mclass disps[] = {
                { TU102_DISP, -1 },
@@ -56,6 +57,6 @@ nvif_disp_ctor(struct nvif_device *device, s32 oclass, struct nvif_disp *disp)
        if (cid < 0)
                return cid;
 
-       return nvif_object_ctor(&device->object, "nvifDisp", 0,
+       return nvif_object_ctor(&device->object, name ? name : "nvifDisp", 0,
                                disps[cid].oclass, NULL, 0, &disp->object);
 }