summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-04-20 13:15:02 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-05-16 10:50:42 +1000
commit40f6193b8fe3c29f49c675f22c643e9ea9e8950f (patch)
tree4c78bea4044d7f311a2355c87b862c35e0ccb1ae /drivers/gpu
parent730673b6657d61d7380556876551b8e0af251dc0 (diff)
downloadlinux-40f6193b8fe3c29f49c675f22c643e9ea9e8950f.tar.gz
linux-40f6193b8fe3c29f49c675f22c643e9ea9e8950f.tar.bz2
linux-40f6193b8fe3c29f49c675f22c643e9ea9e8950f.zip
drm/nvc0/pm: correct core/mem/shader perflvl parsing
We need to parse some of these other entries still, but I've yet to determine exactly which PLLs the rest map to. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_perf.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c
index b70b6ef4ee78..90ab4978e812 100644
--- a/drivers/gpu/drm/nouveau/nouveau_perf.c
+++ b/drivers/gpu/drm/nouveau/nouveau_perf.c
@@ -236,9 +236,19 @@ nouveau_perf_init(struct drm_device *dev)
#define subent(n) entry[perf[2] + ((n) * perf[3])]
perflvl->fanspeed = 0; /*XXX*/
perflvl->voltage = entry[2];
- perflvl->core = (ROM16(subent(0)) & 0xfff) * 1000;
- perflvl->shader = (ROM16(subent(1)) & 0xfff) * 1000;
- perflvl->memory = (ROM16(subent(2)) & 0xfff) * 1000;
+ if (dev_priv->card_type == NV_50) {
+ perflvl->core = ROM16(subent(0)) & 0xfff;
+ perflvl->shader = ROM16(subent(1)) & 0xfff;
+ perflvl->memory = ROM16(subent(2)) & 0xfff;
+ } else {
+ perflvl->shader = ROM16(subent(3)) & 0xfff;
+ perflvl->core = perflvl->shader / 2;
+ perflvl->memory = ROM16(subent(5)) & 0xfff;
+ }
+
+ perflvl->core *= 1000;
+ perflvl->shader *= 1000;
+ perflvl->memory *= 1000;
break;
}