Comment 8 for bug 72287

Revision history for this message
Allison Karlitskaya (desrt) wrote :

It turns out that on suspend/resume, the backlight control register is clobbered to all-zeros.

The only way to fix this is to use vbetool to save/restore the BIOS state. This is currently broken on the macbook due to the init scripts being out of order (vbesave runs before acpid, and on macbook this causes vbesave to fail to detect that we're a laptop).

There is, however, another fix. The attached program (which is a hackish modification of part of the patch submitted upstream) will reset the value of the register. This seems to be sufficient to get the card working properly again (ie: no need for a full vbetool state restore).

Link with -lpci.

This code needs to be somewhere -- be it in the kernel, the X server, HAL or the system resume scripts -- but only run for Macbooks. I'm guessing that for now, HAL or "system resume scripts" is the easy answer.

Also: to do this properly we should probably look at the value of the backlight at suspend, save this value, then write the same value back on resume. The current code just sets to max value on resume.

David is currently romping around in the aussie outback. I'll try to nail him down to find out what he thinks :)