Hi folks,
I've been messing with PM management for a few days and I've accumulated
an interesting volume of code.
I am now interested in comments on the overall architecture. For
example, in this patch, I implement a proposition on how to split
nouveau_bios.c I would really like you to comment. I have also
introduced nouveau_pm.[hc] along with vbios/vbios_pm.[ch].
Another thing I would be interested in is the vbios parsing testing.
At the moment, it should work from nv40 to at least nv96 but it has
really been tested only on an nv86 and an nv96. I'm expecting a lot of
bug report.
Power mode setting is _not recommended for anything other than dev
testing_.
There is still work to be done:
- Clock voltage: It needs testing.
- Memory timings: It is being REed by RSpliet (please help him, he
should be able to provide directions).
- Fan control: I have no information on this.
Despite these lacks, you should be able to safely try to downclock your
card though. That's good news for laptop users, isn't it?
Please acknowledge that this work is almost entirely based on others's
RE work and documentation work. Xexaxo's work has been impressive.
RSpliet is also to be thanked as he is working on getting memory timing
support. Darktama has also done some nice RE, we'll see how to merge his
work. My work here has just been to implement the docs.
On a side note, I would like to say I will be out for 5 days to the XDS
2010.
So, if you have questions I should discuss with some devs there, feel
free to ask.
Best regards,
Martin Peres (aka mupuf), an happy new nouveau dev
How to help for the vbios parsing ?
Thanks for wanting to help :)
First, grab the patch I've joined to this mail. It should cleanly apply
on nouveau's master branch.
Compile, Install Reboot.
$ cat /sys/class/drm/card0/device/pm_status
and compare the values to
# nvclock -i
If it differs, please follow the instructions here:
http://nouveau.freedesktop.org/wiki/PowerManagementDumps
If it works, then, you may want to try changing the clocks.
How to test clock/voltage setting ?
Do not attempt anything if the vbios parsing is wrong, really.
If it did work as intended, you can continue.
** Warning ** Do not try to upclock your card, nothing good will happen.
While playing with clocks, always check the
current temperature
First, kill X (for safety reasons).
Then look for the wanted mode by doing:
$ cat /sys/class/drm/card0/device/pm_mode
It should give you a result like:
--- PM Modes ---
0: core 169 MHz/shader 338 MHz/memory 100 MHz/1150 mV
*1: core 275 MHz/shader 550 MHz/memory 301 MHz/1150 mV
2: core 400 MHz/shader 800 MHz/memory 600 MHz/1200 mV
The * means it is the currently used mode (it may also not be detected).
In this example, you should only stay between mode 0 and 1.
To set the wanted PM mode, please do so:
# echo 0 /sys/class/drm/card0/device/pm_mode
The command above will change the mode to the first mode.
There is another file for voltage control at
/sys/class/drm/card0/device/pm_voltage that works the exact same way as
pm_mode.
The other sysfs entries (temperature related) should be useless to you
as they are just here for future work).
You're done, have fun.
From 38aba214268ecd0263b2a49af0698d84f6a364e6 Mon Sep 17 00:00:00 2001
From: Martin Peres martin.pe...@ensi-bourges.fr
Date: Wed, 15 Sep 2010 12:59:00 +0200
Subject: [PATCH] Add initial power management vbios parsing, voltage clock setting to nouveau.
It is not intented to be used by end-users (if it should be used at all),
this commit is meant for devs to check the actual work and comment on it.
So, you may wondering what I'm asking you. I simply ask you to check the code
and see if you could improve this design.
Also, you can try:
$ cat /sys/class/drm/card0/device/pm_status
and comparing it to # nvclock -i.
If it doesn't match, please provide us with power management dumps kernel logs:
http://nouveau.freedesktop.org/wiki/PowerManagementDumps
If it does match, report your success story also :)
Known issues: As no memory timing parsing/get/set is implemented yet (RSPliet
has been working on it but it is not complete yet), your card will likely hang
if you upclock the memory. Lowering the clocks should work fine though:
echo 0 /sys/class/drm/card0/device/pm_mode
WARNING: Use at your own risks. Please stop your machine after having fun with
this and reboot it after a minute in order to flush everything in the card.
Keep in mind how experimental it is ;)
Ack: Most of this work is based on xexaxo's documentation work and useful
advices.
---
drivers/gpu/drm/nouveau/Makefile |2 +-
drivers/gpu/drm/nouveau/nouveau_bios.c | 67 +++-
drivers/gpu/drm/nouveau/nouveau_bios.h | 41 ++
drivers/gpu/drm/nouveau/nouveau_biosP.h | 44 ++
drivers/gpu/drm/nouveau/nouveau_drv.h|2 +
drivers/gpu/drm/nouveau/nouveau_pm.c | 677 ++