drm/nouveau/mc: implement support for PTOP reset info
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 3793bc7889d5b16681cd1563fcfd1c814057690a..134d44aba1e58f05fe4336b9a3412df92ef13abf 100644 (file)
@@ -24,6 +24,7 @@
 #include "priv.h"
 
 #include <core/option.h>
+#include <subdev/top.h>
 
 void
 nvkm_mc_unk260(struct nvkm_mc *mc, u32 data)
@@ -82,12 +83,14 @@ nvkm_mc_reset_(struct nvkm_mc *mc, enum nvkm_devidx devidx)
 {
        struct nvkm_device *device = mc->subdev.device;
        const struct nvkm_mc_map *map;
-       u64 pmc_enable = 0;
-
-       for (map = mc->func->reset; map && map->stat; map++) {
-               if (map->unit == devidx) {
-                       pmc_enable = map->stat;
-                       break;
+       u64 pmc_enable;
+
+       if (!(pmc_enable = nvkm_top_reset(device->top, devidx))) {
+               for (map = mc->func->reset; map && map->stat; map++) {
+                       if (map->unit == devidx) {
+                               pmc_enable = map->stat;
+                               break;
+                       }
                }
        }