If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In-Kernel Power Management For ATI KMS

09-11-2009, 03:20 PM

Phoronix: In-Kernel Power Management For ATI KMS

While the Radeon R100-R500 series kernel mode-setting support appeared in the Linux 2.6.31 kernel and DRM patches pending for the Linux 2.6.32 kernel that bring KMS support for newer hardware and other improvements, the ATI KMS driver is not complete. Features such as power management need to be brought into the kernel driver (for Intel too) where they will be better off compared to the traditional DDX drivers...

Comment

My work prepares only basic infrastructure for PM. This doesn't do anything useful yet actually.

Last patch which introduces sth interesting - downclocking - is considered not ready yet. I think it may even crash module, as it doesn't even check function pointer.

As soon as these patches hit drm-next, I'm going to continue my work and prepare something really useful. Unfortunately the most complicated part is still ahead of us: determining which power state should be used in current moment. It needs measuring current load and some smart (and lucky) choosing mode. Remember that every mode has engine clock, memory clock and voltage. We have to somehow calculate all of that.

So I don't think you should expect something "really" working soon. Especially if you keep in mind that main (much more talented and experienced) developers are still working on other parts.

Comment

As soon as these patches hit drm-next, I'm going to continue my work and prepare something really useful. Unfortunately the most complicated part is still ahead of us: determining which power state should be used in current moment. It needs measuring current load and some smart (and lucky) choosing mode. Remember that every mode has engine clock, memory clock and voltage. We have to somehow calculate all of that.

Isn't this something which could be lifted from the proprietary driver?

If not the actual code, then the calculations behind it? I would guess having the cards behave the same between the two drivers would be a good idea?

Comment

My work prepares only basic infrastructure for PM. This doesn't do anything useful yet actually.

Last patch which introduces sth interesting - downclocking - is considered not ready yet. I think it may even crash module, as it doesn't even check function pointer.

As soon as these patches hit drm-next, I'm going to continue my work and prepare something really useful. Unfortunately the most complicated part is still ahead of us: determining which power state should be used in current moment. It needs measuring current load and some smart (and lucky) choosing mode. Remember that every mode has engine clock, memory clock and voltage. We have to somehow calculate all of that.

So I don't think you should expect something "really" working soon. Especially if you keep in mind that main (much more talented and experienced) developers are still working on other parts.

Well first thanks for the work, even though it's in an early stage.
But I have a couple of things in my mind, here they are :
As I understood it from the previous discussions here on phoronix, the really tricky part was to ensure that the down-clocking was safe.
By safe I mean that such down-clocking can raise issue with the memory being corrupted and thus some flushing was needed.

At the beginning you can always build rather simple heuristic to test how your set-up works. (for instance a function that follows the inverse of the temperature curves, really stupid since every state change should induce a change in the temperature as well, which in turn should trigger a new state change, etc...)
Tuning such algorithms takes time and you only end up knowing exactly what to do (and what people want you to do) once people start to complain that your implementation is too aggressive or too lazy.

By looking at the radeon_pm_set_state function, I see that you skipped the memory and voltage setting, isn't it a problem ? Are the frequencies of the components paired ? Or can you access the memory at every frequency from an engine at any given frequency ?
I might try to implement some fancy idea in your radeon_pm_adjust, if it's proven to safe from the point of view of the kernel.

Will it still have the behaviour of the current radeon driver where it downclocks during DPMS power off? That one makes a huge difference even on my 4350.

That will be the easiest part and should be implemented as first PM operation. Detecting DPMS_OFF -> downclocking to minimum. Nothing could be easier Actually you can expect this one pretty soon (still, depends on amount on changes Alex will want to make to my patches).

Other than that, I imagine something like cpufreq ondemand would work, if the driver had a way to detect the framerate of running apps and change the speed as appropriate.

If driver can detect FPS, it's something I don't know about. And probably even if, we could not use this as the only parameter to choose state. I think we will need to try observe commands submissions.

There already were some ideas posted on ML/IRC, will have to grab them all and consider.