drm/nouveau/top: add function to lookup interrupt mask for a given device
authorBen Skeggs <bskeggs@redhat.com>
Mon, 30 May 2016 00:36:02 +0000 (10:36 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Jul 2016 01:53:25 +0000 (11:53 +1000)
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 5f75a66bfdbff92b5239d29505ac9647c614d3a6..71ebbfd4484fc9b824cdb84cb07d30449c7576e7 100644 (file)
@@ -10,6 +10,7 @@ struct nvkm_top {
 
 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);
 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);
 
index 19fbcfdb08e83c21aa4781a8dbf14c796a419132..fe063d5728e21b600556cfb6724cde8d979800c9 100644 (file)
@@ -56,6 +56,22 @@ nvkm_top_reset(struct nvkm_device *device, enum nvkm_devidx index)
        return 0;
 }
 
+u32
+nvkm_top_intr_mask(struct nvkm_device *device, enum nvkm_devidx devidx)
+{
+       struct nvkm_top *top = device->top;
+       struct nvkm_top_device *info;
+
+       if (top) {
+               list_for_each_entry(info, &top->device, head) {
+                       if (info->index == devidx && info->intr >= 0)
+                               return BIT(info->intr);
+               }
+       }
+
+       return 0;
+}
+
 u32
 nvkm_top_intr(struct nvkm_device *device, u32 intr, u64 *psubdevs)
 {