drm/nouveau/mc: implement support for PTOP interrupt routing
authorBen Skeggs <bskeggs@redhat.com>
Fri, 8 Apr 2016 07:24:40 +0000 (17:24 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 20 May 2016 04:43:04 +0000 (14:43 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c

index 134d44aba1e58f05fe4336b9a3412df92ef13abf..184325cdc138cf36a9d8d444df5c901b133616cd 100644 (file)
@@ -60,9 +60,18 @@ nvkm_mc_intr(struct nvkm_mc *mc, bool *handled)
        struct nvkm_device *device = mc->subdev.device;
        struct nvkm_subdev *subdev;
        const struct nvkm_mc_map *map = mc->func->intr;
-       u32 stat, intr;
+       u32 stat, intr = nvkm_mc_intr_mask(mc);
+       u64 subdevs;
+
+       stat = nvkm_top_intr(device->top, intr, &subdevs);
+       while (subdevs) {
+               enum nvkm_devidx subidx = __ffs64(subdevs);
+               subdev = nvkm_device_subdev(device, subidx);
+               if (subdev)
+                       nvkm_subdev_intr(subdev);
+               subdevs &= ~BIT_ULL(subidx);
+       }
 
-       stat = intr = nvkm_mc_intr_mask(mc);
        while (map->stat) {
                if (intr & map->stat) {
                        subdev = nvkm_device_subdev(device, map->unit);