summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/top
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2021-02-08 04:23:56 +0300
committerBen Skeggs <bskeggs@redhat.com>2021-02-11 04:49:57 +0300
commitba083ec7a6633c0f6ee0c9895e696313d7b2cf25 (patch)
tree5d570a1b21c96c37e00bf95e3352f16778c6c372 /drivers/gpu/drm/nouveau/nvkm/subdev/top
parent088bfe43f0bde94729f246ea236f4c0331fd560c (diff)
downloadlinux-ba083ec7a6633c0f6ee0c9895e696313d7b2cf25.tar.xz
drm/nouveau/fifo/gk104-: switch dev_top fault handling to type+inst
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/top')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c7
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c
index c34046803e0d..28d0789f50fe 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/base.c
@@ -30,7 +30,6 @@ nvkm_top_device_new(struct nvkm_top *top)
if (info) {
info->type = NVKM_SUBDEV_NR;
info->inst = -1;
- info->index = NVKM_SUBDEV_NR;
info->addr = 0;
info->fault = -1;
info->engine = -1;
@@ -104,7 +103,7 @@ nvkm_top_fault_id(struct nvkm_device *device, enum nvkm_subdev_type type, int in
return -ENOENT;
}
-enum nvkm_devidx
+struct nvkm_subdev *
nvkm_top_fault(struct nvkm_device *device, int fault)
{
struct nvkm_top *top = device->top;
@@ -112,10 +111,10 @@ nvkm_top_fault(struct nvkm_device *device, int fault)
list_for_each_entry(info, &top->device, head) {
if (info->fault == fault)
- return info->index;
+ return nvkm_device_subdev(device, info->type, info->inst);
}
- return NVKM_SUBDEV_NR;
+ return NULL;
}
static int
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
index 4bf0740293cd..870f926ec35f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
@@ -70,7 +70,7 @@ gk104_top_oneinit(struct nvkm_top *top)
continue;
/* Translate engine type to NVKM engine identifier. */
-#define I_(T,I) do { info->type = (T); info->inst = (I); info->index = (T) + (I); } while(0)
+#define I_(T,I) do { info->type = (T); info->inst = (I); } while(0)
#define O_(T,I) do { WARN_ON(inst); I_(T, I); } while (0)
switch (type) {
case 0x00000000: O_(NVKM_ENGINE_GR , 0); break;