Re: [Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-20 Thread Robert Kaiser

Martin Peres schrieb:

Le 15/09/2010 14:58, Robert Kaiser a écrit :

On an only slightly related note, what's the recommended way to read
out the temperature of the GPU when using nouveau? (I have a NV4B
card, but I think I read this is mostly the same for all NVidias, right?)

There is no way to get the temperature using nouveau at the moment. This
feature should land in nouveau git some time this week.


Kewl! You guys are awesome!


Reading the temperature is not as straightforward as just reading a
register. It works that way on nv84+, for earlier cards, you need to
parse the vbios to set-up the sensor and then read the temperature (and
change the value with some additional little calcultations). The
documentation should be available soon, I'm working on merging all the
doc we have.


Duh, would have thought they might make that available pretty easily, 
but good to know you figured it out. I previously had been using nvclock 
to read it, but I think going through nouveau is nicer (and I know it's 
pretty hot most of the time as nouveau is not that good on power 
management as well, good things take time, after all).


Keep up the good work!

Robert Kaiser


___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-19 Thread Martin Peres

 Le 15/09/2010 14:58, Robert Kaiser a écrit :
On an only slightly related note, what's the recommended way to read 
out the temperature of the GPU when using nouveau? (I have a NV4B 
card, but I think I read this is mostly the same for all NVidias, right?)
There is no way to get the temperature using nouveau at the moment. This 
feature should land in nouveau git some time this week.


Reading the temperature is not as straightforward as just reading a 
register. It works that way on nv84+, for earlier cards, you need to 
parse the vbios to set-up the sensor and then read the temperature (and 
change the value with some additional little calcultations). The 
documentation should be available soon, I'm working on merging all the 
doc we have.

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-16 Thread Martin Peres

 Le 15/09/2010 14:33, C. Bergström a écrit :

If you're an end users also feel free to pull the branch directly..

http://github.com/pathscale/pscnv/tree/pm-wip

We're in #pathscale if you need more help or hit bugs..

It is not a good idea as libpdrm isn't mainstream yet. As Ben said, it 
should be developped in nouveau. Pscnv isn't ready for X users yet even 
though we are working on it.


If people want to, I'll upload a complete kernel somewhere for end users 
to test. As for the moment, I only need developpers  people who know 
what they are doing, not end-users.


Anyway, count on me to keep pscnv  nouveau in sync as for power management.

thanks

./C

ps (Have a great trip Martin and good luck at the conference!)


Thanks :)
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-15 Thread Martin Peres

 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 ++
 

Re: [Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-15 Thread C. Bergström

Martin Peres wrote:

 Hi folks,

I've been messing with PM management for a few days and I've 
accumulated an interesting volume of code.

If you're an end users also feel free to pull the branch directly..

http://github.com/pathscale/pscnv/tree/pm-wip

We're in #pathscale if you need more help or hit bugs..

thanks

./C

ps (Have a great trip Martin and good luck at the conference!)
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [RFC] Initial power management vbios parsing, voltage clock setting to nouveau.

2010-09-15 Thread Robert Kaiser

Martin Peres schrieb:

I've been messing with PM management for a few days and I've accumulated
an interesting volume of code.


On an only slightly related note, what's the recommended way to read out 
the temperature of the GPU when using nouveau? (I have a NV4B card, but 
I think I read this is mostly the same for all NVidias, right?)


Robert Kaiser

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau