summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-06-23 16:37:00 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 16:11:55 +1000
commit8ce51fcfee2355cc38ea6fd3062d94bb38dfbaf0 (patch)
tree0bff98ac2f51951a7676a26b03f003c421b92a51 /drivers/gpu/drm/nouveau
parent59ef9742f6b24d1f3062b975ec959512519f8987 (diff)
drm/nvc0/pm: minor clock readback fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_pm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_pm.c b/drivers/gpu/drm/nouveau/nvc0_pm.c
index 6dc1a974b57..929aded35cb 100644
--- a/drivers/gpu/drm/nouveau/nvc0_pm.c
+++ b/drivers/gpu/drm/nouveau/nvc0_pm.c
@@ -42,12 +42,16 @@ read_vco(struct drm_device *dev, u32 dsrc)
static u32
read_pll(struct drm_device *dev, u32 pll)
{
+ u32 ctrl = nv_rd32(dev, pll + 0);
u32 coef = nv_rd32(dev, pll + 4);
u32 P = (coef & 0x003f0000) >> 16;
u32 N = (coef & 0x0000ff00) >> 8;
u32 M = (coef & 0x000000ff) >> 0;
u32 sclk, doff;
+ if (!(ctrl & 0x00000001))
+ return 0;
+
switch (pll & 0xfff000) {
case 0x00e000:
sclk = 27000;
@@ -91,12 +95,12 @@ read_div(struct drm_device *dev, int doff, u32 dsrc, u32 dctl)
return 100000;
case 3:
if (sctl & 0x80000000) {
- u32 sclk = read_vco(dev, dsrc);
+ u32 sclk = read_vco(dev, dsrc + (doff * 4));
u32 sdiv = (sctl & 0x0000003f) + 2;
return (sclk * 2) / sdiv;
}
- return read_vco(dev, dsrc);
+ return read_vco(dev, dsrc + (doff * 4));
default:
return 0;
}