Commit 13416077 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/top: add function to translate subdev index to mmu fault id

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6845c313
...@@ -11,6 +11,7 @@ struct nvkm_top { ...@@ -11,6 +11,7 @@ struct nvkm_top {
u32 nvkm_top_reset(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(struct nvkm_device *, u32 intr, u64 *subdevs);
u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_devidx); u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_devidx);
int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_devidx);
enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault); enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault);
enum nvkm_devidx nvkm_top_engine(struct nvkm_device *, int, int *runl, int *engn); enum nvkm_devidx nvkm_top_engine(struct nvkm_device *, int, int *runl, int *engn);
......
...@@ -95,6 +95,20 @@ nvkm_top_intr(struct nvkm_device *device, u32 intr, u64 *psubdevs) ...@@ -95,6 +95,20 @@ nvkm_top_intr(struct nvkm_device *device, u32 intr, u64 *psubdevs)
return intr & ~handled; return intr & ~handled;
} }
int
nvkm_top_fault_id(struct nvkm_device *device, enum nvkm_devidx devidx)
{
struct nvkm_top *top = device->top;
struct nvkm_top_device *info;
list_for_each_entry(info, &top->device, head) {
if (info->index == devidx && info->fault >= 0)
return info->fault;
}
return -ENOENT;
}
enum nvkm_devidx enum nvkm_devidx
nvkm_top_fault(struct nvkm_device *device, int fault) nvkm_top_fault(struct nvkm_device *device, int fault)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment