Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: More ATI Radeon KMS Power Management Fun

  1. #1
    Join Date
    Jan 2007
    Posts
    15,388

    Default More ATI Radeon KMS Power Management Fun

    Phoronix: More ATI Radeon KMS Power Management Fun

    Power management support within the Linux kernel for the ATI Radeon DRM driver has been in development for months and gone through several revisions, but with the forthcoming Linux 2.6.34 kernel there is initial ATI KMS power management support. For making the power management situation even better, over the weekend Alex Deucher of AMD has been working on another set of patches...

    http://www.phoronix.com/vr.php?view=ODA2Mw

  2. #2
    Join Date
    Dec 2008
    Posts
    166

    Default Linux Power Management

    How does it hook on Linux power management? Again, a super huge kernel abstraction kludge?

    I thought that from R700, power/fan management is done throught the ATOM bios tables/byte cdoe???

  3. #3
    Join Date
    Dec 2007
    Posts
    2,402

    Default

    To enable the power management code, just pass dynpm=1 as a module parameter when you load radeon. The ATOM tables are used for changing the clocks and eventually the voltage, but the algorithms for when to change power modes has to be implemented in the driver. Also, fan control and temperature monitoring is not available via ATOM, the bios just sets up the initial state. For driver control, you need to actually write the code and wire it up to some interface like hwmon.

    Right now the power management is all internal to the driver. there are no knobs exposed to userspace.

  4. #4
    Join Date
    Dec 2008
    Posts
    166

    Cool ATOM fan control and temperature monitoring

    Quote Originally Posted by agd5f View Post
    To enable the power management code, just pass dynpm=1 as a module parameter when you load radeon. The ATOM tables are used for changing the clocks and eventually the voltage, but the algorithms for when to change power modes has to be implemented in the driver.
    You means that is not coupled properly with Linux power management internals? If you are still going the DRM kernel abstraction kludge, I bet power management abstraction code will be... well.. you guessed... (something like perl5's code... )

    Quote Originally Posted by agd5f View Post
    Also, fan control and temperature monitoring is not available via ATOM, the bios just sets up the initial state. For driver control, you need to actually write the code and wire it up to some interface like hwmon.
    Hu? Need to backlog on radeon IRC channel. I remember bridgman telling me that from R7xx fan control and temperature monitoring is available through ATOM bios methods.

  5. #5
    Join Date
    Jul 2008
    Location
    Greece
    Posts
    3,801

    Default

    How would one go and use this with kernel 2.6.33?

  6. #6
    Join Date
    Dec 2007
    Posts
    2,402

    Default

    Quote Originally Posted by sylware View Post
    You means that is not coupled properly with Linux power management internals? If you are still going the DRM kernel abstraction kludge, I bet power management abstraction code will be... well.. you guessed... (something like perl5's code... )
    What Linux power management internals are you referring to? CPU governors are not a good fit for GPUs. The thermal monitoring and fan control chips could be hooked into the hwmon interface, but support for that isn't written yet. Plus, the hwmon stuff really only exposes knobs to userspace. Last I checked, it didn't really provide an interface for other kernel internals (like the drm) to use the data.

    What are you referring to as the drm "kludge"? Currently the driver changes the power state on the fly based on the GPU load and display conditions which only the driver is capable of knowing. How is this a kludge?

    Quote Originally Posted by sylware View Post
    Hu? Need to backlog on radeon IRC channel. I remember bridgman telling me that from R7xx fan control and temperature monitoring is available through ATOM bios methods.
    Nope. There are not any atom command tables to do this. There are command tables for changing the clocks and setting up the initial thermal profile, perhaps that is what you were thinking of.

  7. #7
    Join Date
    Oct 2007
    Location
    Toronto-ish
    Posts
    7,540

    Default

    Quote Originally Posted by sylware View Post
    Hu? Need to backlog on radeon IRC channel. I remember bridgman telling me that from R7xx fan control and temperature monitoring is available through ATOM bios methods.
    Are you sure ? I remember saying that the information was in AtomBIOS (data tables describing the hardware and how it is connected/accessed) but don't remember saying it was accessed through methods aka command tables.

  8. #8
    Join Date
    Dec 2008
    Posts
    166

    Question

    Quote Originally Posted by agd5f
    What Linux power management internals are you referring to?
    In pm.h:
    Code:
    struct dev_pm_ops {
      int (*prepare)(struct device *dev);
      void (*complete)(struct device *dev);
      int (*suspend)(struct device *dev);
      int (*resume)(struct device *dev);
      int (*freeze)(struct device *dev);
      int (*thaw)(struct device *dev);
      int (*poweroff)(struct device *dev);
      int (*restore)(struct device *dev);
      int (*suspend_noirq)(struct device *dev);
      int (*resume_noirq)(struct device *dev);
      int (*freeze_noirq)(struct device *dev);
      int (*thaw_noirq)(struct device *dev);
      int (*poweroff_noirq)(struct device *dev);
      int (*restore_noirq)(struct device *dev);
      int (*runtime_suspend)(struct device *dev);
      int (*runtime_resume)(struct device *dev);
      int (*runtime_idle)(struct device *dev);
    };
    And of course the /sys user space nobs.

    Abstracting all that for:
    - Windows
    - MacOSX
    - *BSD
    - Linux
    will very probably end up as a kludge (common sense).
    Quote Originally Posted by agd5f
    ...and setting up the initial thermal profile...
    In my mind, settings up thermal profile means ATOM is able to setup power states and fan speed, doesn't it?
    Quote Originally Posted by bridgman
    Are you sure ? I remember saying that the information was in AtomBIOS (data tables describing the hardware and how it is connected/accessed) but don't remember saying it was accessed through methods aka command tables.
    Well, as far as I can remember, I think I understood it that way.

  9. #9
    Join Date
    Dec 2007
    Posts
    2,402

    Default

    Quote Originally Posted by sylware View Post
    In pm.h:
    Code:
    struct dev_pm_ops {
      int (*prepare)(struct device *dev);
      void (*complete)(struct device *dev);
      int (*suspend)(struct device *dev);
      int (*resume)(struct device *dev);
      int (*freeze)(struct device *dev);
      int (*thaw)(struct device *dev);
      int (*poweroff)(struct device *dev);
      int (*restore)(struct device *dev);
      int (*suspend_noirq)(struct device *dev);
      int (*resume_noirq)(struct device *dev);
      int (*freeze_noirq)(struct device *dev);
      int (*thaw_noirq)(struct device *dev);
      int (*poweroff_noirq)(struct device *dev);
      int (*restore_noirq)(struct device *dev);
      int (*runtime_suspend)(struct device *dev);
      int (*runtime_resume)(struct device *dev);
      int (*runtime_idle)(struct device *dev);
    };
    And of course the /sys user space nobs.

    Abstracting all that for:
    - Windows
    - MacOSX
    - *BSD
    - Linux
    will very probably end up as a kludge (common sense).
    The drm already hooks in suspend and resume functions which are mainly what those are for. There aren't any common dynamic power management interfaces as far as I know because it tends to be device, or at least subsystem specific (i.e., USB power saving stuff). Perhaps we could implement some common drm dynamic pm functionality once some other drm drivers add similar features.

    Quote Originally Posted by sylware View Post
    In my mind, settings up thermal profile means ATOM is able to setup power states and fan speed, doesn't it?
    It loads the profile as part of asic init, however, there are no tables to query the temp or fan speed. Those need to be implemented by the driver.

    Quote Originally Posted by sylware View Post
    Well, as far as I can remember, I think I understood it that way.
    Well, for the record, there are no command tables to query that information. You can view the full list of command and data tables in atombios.h

  10. #10
    Join Date
    Dec 2008
    Posts
    166

    Question

    Quote Originally Posted by agd5f View Post
    The drm already hooks in suspend and resume functions which are mainly what those are for. There aren't any common dynamic power management interfaces as far as I know because it tends to be device, or at least subsystem specific (i.e., USB power saving stuff). Perhaps we could implement some common drm dynamic pm functionality once some other drm drivers add similar features.
    Well, you mean having a non-sysfs power management interface like all the other sub-systems. So you would have a generalized DRM interface which generates proper sysfs entries on Linux and whatever are the proper interfaces on other kernels (window,MacOS,*BSD...).
    I don't know, but does the DRM power management driver interface allow proper use of pm.h? Personnally, I doubt it. And imagining code that will cleanly fit all the other kernels power management interface at the same time... sorry I don't buy it: it will be kludgy naughty code. I don't even think it will fit the "quality requiered" to get into *BSD kernels.

    For me it's masochistic and a dangerous path.

    Let me add a layer on top of it: a generalized instrumentation framework for performance measurements that will fit the native instrumentation interfaces of all kernels?

    All that kernel abstraction stuff seems quite unreasonable, but I think you got my point.

    Quote Originally Posted by agd5f View Post
    It loads the profile as part of asic init, however, there are no tables to query the temp or fan speed. Those need to be implemented by the driver.
    Well, for the record, there are no command tables to query that information. You can view the full list of command and data tables in atombios.h
    Well that one is for me... "one day" I might have brain time to dive for good into AMD GPU driver code... to avoid such questions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •