drm/nouveau/falcon: use split type+inst when looking up PRI addr
authorBen Skeggs <bskeggs@redhat.com>
Sat, 6 Feb 2021 01:06:50 +0000 (11:06 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 Feb 2021 01:49:55 +0000 (11:49 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h
drivers/gpu/drm/nouveau/nvkm/falcon/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c

index fa449aa058c60a1236cf6bcd84a4d50a1e1b37ba..0a8004ee8c13aadcec59083abb662296fd09e0e6 100644 (file)
@@ -22,7 +22,7 @@ struct nvkm_top_device {
        struct list_head head;
 };
 
-u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_devidx);
+u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_subdev_type, int);
 u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_subdev_type, int);
 u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_subdev_type, int);
 int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_devidx);
index 212e224ddda8ace58338f6defa99e3c22386c029..262641a014b066ff346f888f889006f83aa0ecce 100644 (file)
@@ -141,7 +141,7 @@ nvkm_falcon_oneinit(struct nvkm_falcon *falcon)
        u32 reg;
 
        if (!falcon->addr) {
-               falcon->addr = nvkm_top_addr(subdev->device, subdev->index);
+               falcon->addr = nvkm_top_addr(subdev->device, subdev->type, subdev->inst);
                if (WARN_ON(!falcon->addr))
                        return -ENODEV;
        }
index 139f8d5b72d840d350f4948e5d42768ca9694751..9093e86865c764f3d47b61a11abf466953531fc3 100644 (file)
@@ -43,14 +43,14 @@ nvkm_top_device_new(struct nvkm_top *top)
 }
 
 u32
-nvkm_top_addr(struct nvkm_device *device, enum nvkm_devidx index)
+nvkm_top_addr(struct nvkm_device *device, enum nvkm_subdev_type type, int inst)
 {
        struct nvkm_top *top = device->top;
        struct nvkm_top_device *info;
 
        if (top) {
                list_for_each_entry(info, &top->device, head) {
-                       if (info->index == index)
+                       if (info->type == type && info->inst == inst)
                                return info->addr;
                }
        }