Laptop LCD Backlight Blanking

From Wiki
Jump to: navigation, search

Overview

I have this Toshiba Toughbook CF-48 that I really like. It spends about half its life running Gentoo. Very little power tuning has been done on it since it mostly sits in a dock, or has AC power available if I take it somewhere. But one of the things that really annoys me is that the backlight would never turn off in console mode. If I bring up X, the DPMS works fine, and the backlight goes out. But in console mode, the screen would blank, but the backlight remains lit.

Now there's some controversy as to whether it's better to leave the backlight on all the time, since a burning bulb (or tube) rarely fails. Others say that the tubes themselves have a life span, and will go when it's their time. I don't really know, but I know that I don't like the dim light at night, and while I'm no eco-freak, it does seem a waste to leave it on.

One lazy Sunday morning, I finally remembered to start Googling around and see if it could be fixed. There's lots of articles on getting backlights to work correctly under X, but not much luck finding console related info. I did find that setterm claimed to be able to control the backlight, but after

setterm -powersave powerdown -blank 1

it still wasn't turning off the backlight. Google next pointed me to vbetool. Indeed,

vbetool dpms off

turned off the backlight. But it still wasn't automatic. It should do this when the console blanks. I wondered if I should tie that to an ACPI event. A little experimentation showed that no ACPI event is generated when the kernel blanks the console.

I figured this had to be some sort of kernel option, and from the Googling, knew it had to be APM or APCI related. A check of the configuration for the kernel showed that APM_DISPLAY_BLANK was enabled. The docs say that APM_DISPLAY_BLANK doesn't work on all laptops, and the Toughbook is one of them.

Looking under the ACPI options, most of the items were checked, except for the Video option (CONFIG_ACPI_VIDEO). I marked it, but it wanted to make it a module. Apparently it's dependent on VIDEO_OUTPUT_CONTROL (under Device drivers >> Graphics support >> Lowlevel video output switch controls). Setting this to a 'Y' and then setting Power management options >> ACPI (Advanced Configuration and Power Interface) Support >> Video to 'Y' gave me the options I wanted.

A quick kernel rebuild and install and reboot followed by setting the blank time to 1 minute and waiting gave me the same results as before. The console blanked, but the backlight remained on. But this time, adding the '-powersave powerdown' did the trick. Now to make it do it automatically... Running

find /etc | xargs grep -si setterm

didn't reveal anywhere that the startup scripts might be setting the blanking timeout, so I assume that it's using the default. I added to my local startup file with

echo setterm -powersave powerdown -blank 10>>/etc/conf.d/local.start

A quick shutdown and restart, and now the console blanks and the backlight goes out.

Summary

  • Enable VIDEO_OUTPUT_CONSOLE in the kernel configuration
  • Enable CONFIG_ACPI_VIDEO in the kernel configuration (assumes you already have CONFIG_ACPI enabled)
  • Rebuild and install new kernel
  • Add 'setterm -powersve powerdown -blank 10' to /etc/conf.d/local.start
  • Reboot