drm/nouveau/top: add function to lookup PRI address for devices
authorBen Skeggs <bskeggs@redhat.com>
Tue, 12 Feb 2019 12:28:13 +0000 (22:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 19 Feb 2019 22:59:58 +0000 (08:59 +1000)
Will be using this in upcoming changes to avoid the need for entirely
new subdevs to deal with Turing register moves.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h
drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c

index f7d3eb647e2eae8b60d2d069b8fa853092cfba0a..2904e67d79d25fe931c57659dc5f14581514d096 100644 (file)
@@ -9,6 +9,7 @@ struct nvkm_top {
        struct list_head device;
 };
 
+u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_devidx);
 u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_devidx);
 u32 nvkm_top_intr(struct nvkm_device *, u32 intr, u64 *subdevs);
 u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_devidx);
index 67ada1d9a28c31e8475c5f407879ed8dc83ecf9b..cce6e4e90ebf804ffb699371e0cf3a4b8fb55a95 100644 (file)
@@ -40,6 +40,22 @@ nvkm_top_device_new(struct nvkm_top *top)
        return info;
 }
 
+u32
+nvkm_top_addr(struct nvkm_device *device, enum nvkm_devidx index)
+{
+       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)
+                               return info->addr;
+               }
+       }
+
+       return 0;
+}
+
 u32
 nvkm_top_reset(struct nvkm_device *device, enum nvkm_devidx index)
 {