diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2016-04-08 10:24:40 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-05-20 07:43:04 +0300 |
commit | 70b01f07dbd093c96e9910ba613c3d40346ee222 (patch) | |
tree | f25d92f7268958c624caed9e04c757f476bd0937 /drivers/gpu/drm/nouveau | |
parent | 6defde5ab3e1d8b8fcd187517f878955b5e30465 (diff) | |
download | linux-70b01f07dbd093c96e9910ba613c3d40346ee222.tar.xz |
drm/nouveau/mc: allow for local definition of reset bits
With the addition of PTOP-specified reset bits, it makes more sense to
move the definitions here rather than in individual subdev
implementations.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c index 95183011510e..3793bc7889d5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c @@ -81,8 +81,21 @@ static void nvkm_mc_reset_(struct nvkm_mc *mc, enum nvkm_devidx devidx) { struct nvkm_device *device = mc->subdev.device; - struct nvkm_subdev *subdev = nvkm_device_subdev(device, devidx); - u64 pmc_enable = subdev->pmc_enable; + 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; + } + } + + if (!pmc_enable) { + struct nvkm_subdev *subdev = nvkm_device_subdev(device, devidx); + pmc_enable = subdev->pmc_enable; + } + if (pmc_enable) { nvkm_mask(device, 0x000200, pmc_enable, 0x00000000); nvkm_mask(device, 0x000200, pmc_enable, pmc_enable); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h index fa2b2d610f1b..b80385b438b3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h @@ -20,6 +20,7 @@ struct nvkm_mc_func { void (*intr_rearm)(struct nvkm_mc *); /* retrieve pending interrupt mask (NV_PMC_INTR) */ u32 (*intr_mask)(struct nvkm_mc *); + const struct nvkm_mc_map *reset; void (*unk260)(struct nvkm_mc *, u32); }; |