Radeon

radeon is a family of open source graphics drivers for AMD/ATI Radeon graphics cards.

Hardware detection
To choose the right driver, first detect the graphics card. You can use lspci for this task:

Feature support

 * 1) Needs testing packages: >=mesa-9.1
 * 2) Work in Progress

Kernel
You need to set the following kernel options:

Firmware
Microcode is required for R600 and newer GPUs. Install either or  (contains also other firmware), either:

or:

Also, with packages like these, which introduce a number of non-free blobs into your system, if you are security aware, it pays to use the savedconfig use flag, and do some removing of the unnecessary lines, or better yet uncommenting them, from the respective savedconfig file. See "How to install the linux-firmware package in Gentoo" in External resources in bottom.

However, savedconfig editing is entirely optional, if you are in a hurry. System will work the same, with or without the savedconfig editing.

If you compiled radeon directly into the kernel instead of as a module, make sure firmware for your model (check available ones in ) is included in kernel:

Below is a list of the firmware files needed for each family/chipset of cards:


 * 1) Only for kernel 3.15 and newer

Driver
Portage uses the variable VIDEO_CARDS for enabling support for various graphics cards in packages. Setting VIDEO_CARDS to e.g. radeon (see the feature matrix) will pull in the correct driver:

Check the USE flags of :

After setting this you want to update your system so the changes take effect:

xorg.conf
The X server is designed to work out-of-the-box, with no need to manually edit X.Org's configuration files. It should detect and configure devices such as displays, keyboards, and mice.

However, the main configuration file of the X server is the xorg.conf.

You can force the X server to use desired driver with:

Power Management
Power management can be set in the sysfs filesystem as follows:


 * Check the current power method:


 * Change the power method:
 * The "dynpm" method dynamically changes the clocks based on demand. (not effective as of June 27, 2012)
 * The "profile" method lets you set a profile on how the card should behave.
 * The "profile" method lets you set a profile on how the card should behave.


 * Check the current profile:


 * Change the profile:
 * Options for profile:
 * "default" no change of clock speeds
 * "auto" switches between "mid" and "high" power states based on the whether the system is on battery power or not. The "low" power state are selected when the monitors are in the dpms off state.
 * "low" forces the GPU to be in the low power state all the time. Note that "low" can cause display problems on some laptops; this is why auto does not use "low" when displays are active.
 * "mid" forces the GPU to be in the "mid" power state all the time. The "low" power state is selected when the monitors are in the dpms off state.
 * "high" forces the GPU to be in the "high" power state all the time. The "low" power state is selected when the monitors are in the dpms off state.


 * Check the current GPU, Memory clocks and voltage (needs to have kernel debugfs enabled):

Power Management with Linux Kernel 3.11, 3.12
Linux Kernel 3.11 introduces improved power management for some radeon cards, to activate it pass the parameter radeon.dpm=1 to the kernel.


 * Check the dynamic power management state


 * Change the dynamic power management state
 * Other valid options include "battery" and "balanced"
 * Other valid options include "battery" and "balanced"

In order to verify that the new dynamic power management code is active check radeon_pm_info (see above), it should say something like
 * uvd   vclk: 0 dclk: 0
 * power level 0   sclk: 25000 mclk: 15000 vddc: 900 vddci: 950



Tuning
I couldn't find a summary of all options available so feel free to add to this.

Tuning with mesa from git
Mesa from git (=mesa-9999) offers a different way to tune the 3D driver. Use the environment variable R600_DEBUG with the following options See mesa commit for more information.


 * Kernel parameters can be just added to the kernel commandline in or.
 * Environment variables could be put into a file like to have them initialized during boot.
 * parameter are usual in the Device section for the card.
 * A full list of kernel parameters can be found here: X.Org Wiki - RadeonFeature
 * S3TC compression needed for some applications like most 3D games:


 * 1) supported by Linux kernel 3.11

Monitoring
lm sensors can be used to monitor the cards temperature. It uses the I2C interface, which needs to be enabled in the kernel:



Audio over HDMI
Audio through the HDMI port is available for some cards. Check the X.Org Wiki - Radeon Feature Matrix for the model family. A recent 3.x kernel may be needed.

If you are using a kernel older than 3.13, HDMI audio must be explicitly enabled using the kernel commandline paramater radeon.audio=1. In addition, ALSA typically does not use HDMI as the default audio, so one way to force this as the default is to add a config file:

which may be moved to to make HDMI audio the system-wide default.

Multichannel LPCM
If you want to enjoy full 5.1 HDMI sound on your gentoo rig try out anssi's HDMI audio patch as mentioned in the phoronix forums.

Check your bootloader config to use the correct kernel and reboot.

External resources

 * X.Org Wiki
 * Phoronix Forums multichannel for radeon
 * hdmi multichannel patch
 * How to install the linux-firmware package in Gentoo