aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvc0_pm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-02-06 13:51:30 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-05-24 16:31:34 +1000
commit9d6ba0b58c5f1ea52b641c36178a27e876b80011 (patch)
tree5fa36a7f06d3630962e277d2305086978d42c118 /drivers/gpu/drm/nouveau/nvc0_pm.c
parenta94ba1fcac417d0b72f73fb77e730279ca9203c3 (diff)
downloadlinux-linaro-stable-9d6ba0b58c5f1ea52b641c36178a27e876b80011.tar.gz
drm/nvc0/pm: very initial mclk freq change
Loads of magic missing, this will probably blow up if you try it. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_pm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_pm.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_pm.c b/drivers/gpu/drm/nouveau/nvc0_pm.c
index a2f6ae0fa4bd..7c95c44e2887 100644
--- a/drivers/gpu/drm/nouveau/nvc0_pm.c
+++ b/drivers/gpu/drm/nouveau/nvc0_pm.c
@@ -500,6 +500,24 @@ mclk_mrs(struct nouveau_mem_exec_func *exec, int mr, u32 data)
static void
mclk_clock_set(struct nouveau_mem_exec_func *exec)
{
+ struct nvc0_pm_state *info = exec->priv;
+ struct drm_device *dev = exec->dev;
+ u32 ctrl = nv_rd32(dev, 0x132000);
+
+ nv_wr32(dev, 0x137360, 0x00000001);
+ nv_wr32(dev, 0x137370, 0x00000000);
+ nv_wr32(dev, 0x137380, 0x00000000);
+ if (ctrl & 0x00000001)
+ nv_wr32(dev, 0x132000, (ctrl &= ~0x00000001));
+
+ nv_wr32(dev, 0x132004, info->mem.coef);
+ nv_wr32(dev, 0x132000, (ctrl |= 0x00000001));
+ nv_wait(dev, 0x137390, 0x00000002, 0x00000002);
+ nv_wr32(dev, 0x132018, 0x00005000);
+
+ nv_wr32(dev, 0x137370, 0x00000001);
+ nv_wr32(dev, 0x137380, 0x00000001);
+ nv_wr32(dev, 0x137360, 0x00000000);
}
static void
@@ -533,11 +551,15 @@ prog_mem(struct drm_device *dev, struct nvc0_pm_state *info)
if (dev_priv->chipset < 0xd0)
nv_wr32(dev, 0x611200, 0x00003300);
+ else
+ nv_wr32(dev, 0x62c000, 0x03030000);
nouveau_mem_exec(&exec, info->perflvl);
if (dev_priv->chipset < 0xd0)
nv_wr32(dev, 0x611200, 0x00003300);
+ else
+ nv_wr32(dev, 0x62c000, 0x03030300);
}
int
nvc0_pm_clocks_set(struct drm_device *dev, void *data)
@@ -545,7 +567,7 @@ nvc0_pm_clocks_set(struct drm_device *dev, void *data)
struct nvc0_pm_state *info = data;
int i;
- if (0)
+ if (info->mem.coef)
prog_mem(dev, info);
for (i = 0; i < 16; i++) {