[plug] Frustration

Brad Campbell brad at fnarfbargle.com
Fri Sep 7 12:45:17 WST 2012


Sometimes I wonder why I stick with Linux....

I have a 2011 iMac. It has a Radeon card in it. The machine has two 
external display ports.

When I bought the machine, I bought a 27" cinema display with it and 
also connected up my old 24" DVI monitor.

I spent 3 days hacking the kernel radeon driver to try and figure out 
why it refused to drive the cinema display over the thunderbolt port.

Got that fixed to find out when you install Linux and have one or more 
external monitors connected, the kernel radeon driver clocks the card up 
to full throttle and attempts to cook the machine.

So spent another couple of hours with my head in the driver to figure 
out a way to effectively clock it down. Developed a nasty hack which did 
the job.

Fast forward 12 months. Upgraded to kernel 3.4.10 to find that my 
machine would panic on logging into X. Spend 6 hours bisecting back to a 
patch added in 3.4.8 which was fundamentally broken. Notified the 
maintainer to get "oh yeah, I have a revert queued up for that". It's 
only been broken for 2 stable releases.

Get that fixed to find noise artefacts on the screen now. Bisect that 
back to another patch by the same maintainer. Asked him about it and got 
"Running more than one head in the low power profile is unsupported". No 
shit sherlock, that's why I've been carrying a nasty hack for 12 months. 
Run in an unsupported mode or have the machine sound like a 747 trying 
to keep the card from bursting into flames.

So, let's spend another 8 hours tracking through the Radeon driver to 
try and figure out why the power management is broken. Have a quick 
google... oh, lots of people with the same complaint "kernel radeon 
driver makes my laptop overheat and shut down". Standard maintainer 
answer is "you'll need to manually fiddle the clock values", but no 
information on how that might be achieved.

Turns out the radeon BIOS has a set of power profiles programmed into it 
by the maker. There is even a sane way to parse them in the radeon 
driver, but rather than make it configurable or switchable it is 
hardcoded to use a certain profile type.

In my case, the Radeon in my iMac is a mobile radeon. The radeon driver 
says if its a mobile chip then select the battery profile. If you are 
running multi-head mode then select the second battery profile. Oh! 
What's that you say? You don't have a second battery profile? Right then 
let's default to the profile we can find with the highest power 
dissipation and use that for all our configurable power settings (high, 
mid, low).

A quick hack to the driver to use the "battery" profile (which is the 
lowest power dissipating setting), and then a kernel module parameter to 
allow me to set the minimum GPU clock and Memory clock values, and I can 
now tweak the GPU clock up a couple of MHZ and the display noise goes away.

So, now I see the kernel has a misc usb driver than allows control of an 
external apple monitor. No worries, I've already patched acdcontrol to 
control the backlight on my cinema display, so let's patch the in-kernel 
driver so I can use /sys/class/backlight/* to control both monitors. Yay!

Spend a couple of fun hours hacking that up to find that 
gnome-power-manmager and hal both shit the bed if there is more than one 
backlight device. Each backlight has a different resolution. The built 
in device has 4 bits of brightness, while the cinema display as 16. So 
gnome power manager gets confused by this and ties itself in a knot.

I wonder if I can install xmonad in OSX ??


More information about the plug mailing list