diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-06-21 01:12:26 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-09-20 02:03:34 -0400 |
commit | 9698b9a680e9aee124b1cd752abf1c672ea24c03 (patch) | |
tree | d42bcd462415b86d59e19448fa443e90ff67d2fa /drivers/gpu/drm | |
parent | 354d0781e5cef1f227ee3064cb65053365177d3b (diff) |
drm/nvc0/pm: more complete parsing of clock domains
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_perf.c | 31 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nva3_pm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvc0_pm.c | 6 |
4 files changed, 31 insertions, 19 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 0f0c5e59535f..f31fbe28e868 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -449,10 +449,15 @@ struct nouveau_pm_level { | |||
449 | u32 core; | 449 | u32 core; |
450 | u32 memory; | 450 | u32 memory; |
451 | u32 shader; | 451 | u32 shader; |
452 | u32 rop; | ||
453 | u32 copy; | ||
454 | u32 daemon; | ||
452 | u32 vdec; | 455 | u32 vdec; |
453 | u32 unk05; | 456 | u32 unk05; /* nv50:nva3, roughly.. */ |
454 | u32 unk0a; | 457 | u32 unka0; /* nva3:nvc0 */ |
455 | u32 unka0; | 458 | u32 hub01; /* nvc0- */ |
459 | u32 hub06; /* nvc0- */ | ||
460 | u32 hub07; /* nvc0- */ | ||
456 | 461 | ||
457 | u32 volt_min; /* microvolts */ | 462 | u32 volt_min; /* microvolts */ |
458 | u32 volt_max; | 463 | u32 volt_max; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c index b00cf4b5046b..bb50f2490234 100644 --- a/drivers/gpu/drm/nouveau/nouveau_perf.c +++ b/drivers/gpu/drm/nouveau/nouveau_perf.c | |||
@@ -284,28 +284,27 @@ nouveau_perf_init(struct drm_device *dev) | |||
284 | perflvl->unk05 = ROM16(entry[16]) * 1000; | 284 | perflvl->unk05 = ROM16(entry[16]) * 1000; |
285 | break; | 285 | break; |
286 | case 0x40: | 286 | case 0x40: |
287 | #define subent(n) entry[perf[2] + ((n) * perf[3])] | 287 | #define subent(n) (ROM16(entry[perf[2] + ((n) * perf[3])]) & 0xfff) * 1000 |
288 | perflvl->fanspeed = 0; /*XXX*/ | 288 | perflvl->fanspeed = 0; /*XXX*/ |
289 | perflvl->volt_min = entry[2]; | 289 | perflvl->volt_min = entry[2]; |
290 | if (dev_priv->card_type == NV_50) { | 290 | if (dev_priv->card_type == NV_50) { |
291 | perflvl->core = ROM16(subent(0)) & 0xfff; | 291 | perflvl->core = subent(0); |
292 | perflvl->shader = ROM16(subent(1)) & 0xfff; | 292 | perflvl->shader = subent(1); |
293 | perflvl->memory = ROM16(subent(2)) & 0xfff; | 293 | perflvl->memory = subent(2); |
294 | perflvl->vdec = ROM16(subent(3)) & 0xfff; | 294 | perflvl->vdec = subent(3); |
295 | perflvl->unka0 = ROM16(subent(4)) & 0xfff; | 295 | perflvl->unka0 = subent(4); |
296 | } else { | 296 | } else { |
297 | perflvl->shader = ROM16(subent(3)) & 0xfff; | 297 | perflvl->hub06 = subent(0); |
298 | perflvl->hub01 = subent(1); | ||
299 | perflvl->copy = subent(2); | ||
300 | perflvl->shader = subent(3); | ||
301 | perflvl->rop = subent(4); | ||
302 | perflvl->memory = subent(5); | ||
303 | perflvl->vdec = subent(6); | ||
304 | perflvl->daemon = subent(10); | ||
305 | perflvl->hub07 = subent(11); | ||
298 | perflvl->core = perflvl->shader / 2; | 306 | perflvl->core = perflvl->shader / 2; |
299 | perflvl->unk0a = ROM16(subent(4)) & 0xfff; | ||
300 | perflvl->memory = ROM16(subent(5)) & 0xfff; | ||
301 | } | 307 | } |
302 | |||
303 | perflvl->core *= 1000; | ||
304 | perflvl->shader *= 1000; | ||
305 | perflvl->memory *= 1000; | ||
306 | perflvl->unk0a *= 1000; | ||
307 | perflvl->vdec *= 1000; | ||
308 | perflvl->unka0 *= 1000; | ||
309 | break; | 308 | break; |
310 | } | 309 | } |
311 | 310 | ||
diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c index 8541d5215e0d..864a15bd6128 100644 --- a/drivers/gpu/drm/nouveau/nva3_pm.c +++ b/drivers/gpu/drm/nouveau/nva3_pm.c | |||
@@ -215,6 +215,8 @@ nva3_pm_clocks_get(struct drm_device *dev, struct nouveau_pm_level *perflvl) | |||
215 | perflvl->memory = read_pll(dev, 0x02, 0x4000); | 215 | perflvl->memory = read_pll(dev, 0x02, 0x4000); |
216 | perflvl->unka0 = read_clk(dev, 0x20, false); | 216 | perflvl->unka0 = read_clk(dev, 0x20, false); |
217 | perflvl->vdec = read_clk(dev, 0x21, false); | 217 | perflvl->vdec = read_clk(dev, 0x21, false); |
218 | perflvl->daemon = read_clk(dev, 0x25, false); | ||
219 | perflvl->copy = perflvl->core; | ||
218 | return 0; | 220 | return 0; |
219 | } | 221 | } |
220 | 222 | ||
diff --git a/drivers/gpu/drm/nouveau/nvc0_pm.c b/drivers/gpu/drm/nouveau/nvc0_pm.c index aff4426b2408..6dc1a974b577 100644 --- a/drivers/gpu/drm/nouveau/nvc0_pm.c +++ b/drivers/gpu/drm/nouveau/nvc0_pm.c | |||
@@ -140,6 +140,12 @@ nvc0_pm_clocks_get(struct drm_device *dev, struct nouveau_pm_level *perflvl) | |||
140 | perflvl->shader = read_clk(dev, 0x00); | 140 | perflvl->shader = read_clk(dev, 0x00); |
141 | perflvl->core = perflvl->shader / 2; | 141 | perflvl->core = perflvl->shader / 2; |
142 | perflvl->memory = read_mem(dev); | 142 | perflvl->memory = read_mem(dev); |
143 | perflvl->rop = read_clk(dev, 0x01); | ||
144 | perflvl->hub07 = read_clk(dev, 0x02); | ||
145 | perflvl->hub06 = read_clk(dev, 0x07); | ||
146 | perflvl->hub01 = read_clk(dev, 0x08); | ||
147 | perflvl->copy = read_clk(dev, 0x09); | ||
148 | perflvl->daemon = read_clk(dev, 0x0c); | ||
143 | perflvl->vdec = read_clk(dev, 0x0e); | 149 | perflvl->vdec = read_clk(dev, 0x0e); |
144 | return 0; | 150 | return 0; |
145 | } | 151 | } |