diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-01-27 10:53:17 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-05-24 16:31:16 +1000 |
commit | 27740383dde9e1f309a74cf39d96f3223dbf281c (patch) | |
tree | e34637989d61d6a16763a7ce0d5bcccdc8a7e8c6 /drivers/gpu/drm/nouveau/nva3_pm.c | |
parent | 65115bb05a9380a256907ae307135248ac1c29b4 (diff) |
drm/nva3/pm: initial attempt at more magic PFB regs
The reg calculation may get moved elsewhere at some point, but lets
figure out what exactly we need to do first.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nva3_pm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nva3_pm.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c index 3d397845dca9..86d0de084784 100644 --- a/drivers/gpu/drm/nouveau/nva3_pm.c +++ b/drivers/gpu/drm/nouveau/nva3_pm.c @@ -354,8 +354,11 @@ mclk_mrs(struct nouveau_mem_exec_func *exec, int mr, u32 data) static void mclk_clock_set(struct nouveau_mem_exec_func *exec) { - struct nva3_pm_state *info = exec->priv; struct drm_device *dev = exec->dev; + struct nva3_pm_state *info = exec->priv; + struct nouveau_pm_level *perflvl = info->perflvl; + u32 freq = perflvl->memory; + u8 *rammap, *ramcfg, ver, hdr, cnt, len; nv_wr32(dev, 0x004018, 0x00001000); @@ -365,6 +368,26 @@ mclk_clock_set(struct nouveau_mem_exec_func *exec) nv_wr32(dev, 0x004018, 0x1000d000); else nv_wr32(dev, 0x004018, 0x10005000); + + rammap = nouveau_perf_rammap(dev, freq, &ver, &hdr, &cnt, &len); + if (rammap && ver == 0x10 && hdr >= 5) { + ramcfg = nouveau_perf_ramcfg(dev, freq, &ver, &len); + if (ramcfg && (rammap[4] & 0x08)) { + u32 unk5a0 = (ROM16(ramcfg[5]) << 8) | ramcfg[5]; + u32 unk5a4 = ROM16(ramcfg[7]); + u32 unk804 = (ramcfg[9] & 0xf0) << 16 | + (ramcfg[3] & 0x0f) << 16 | + (ramcfg[9] & 0x0f) | + 0x80000000; + nv_wr32(dev, 0x1005a0, unk5a0); + nv_wr32(dev, 0x1005a4, unk5a4); + nv_wr32(dev, 0x10f804, unk804); + nv_mask(dev, 0x10053c, 0x00001000, 0x00000000); + } else { + nv_mask(dev, 0x10053c, 0x00001000, 0x00001000); + nv_mask(dev, 0x10f804, 0x80000000, 0x00000000); + } + } } static void |