Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Debian Lenny on a Toshiba Portege 3500
00:08.0 Bridge: ALi Corporation M7101 Power Management Controller [PMU]
01:00.0 VGA compatible controller: Trident Microsystems CyberBlade XPAi1 (rev 82)
kernel version 2.6.26-2-686
On my system, "xset dpms force off" blanks the screen, but does not turn off the backlight. This means that the automated screen off in X does not actually save any power when it blanks the screen.
I can turn off the backlight manually using the BIOS tool "vbetool dpms off" (but then I have to turn it back on again manually too).
Question 1: is this a problem with the graphics driver interface, or with X, or with the power management driver interface?
Question 2: as a workaround, is there any way for me to hook into the dpms off/on that X is doing, and run a script to call vbetool?
The best workaround hack I have come across so far is to have a screensaver that calls vbetool, but I was hoping to find something that doesn't require me to run a daemon all the time.
Question 1 reply:
Probably an issue with the program communicating with the driver. Try playing with setpci to alter light configuration. It mostly dims things. However, you might want to rely on the BIOS control to turn on/off the backlight. You could blame X for never having everything that workscorrectly workingtogether.
Question 2 reply:
Combine mathematics, shell scripting, and various command-line programs to control your backlight. You'll want to track down the files that relate to the screensaver system you're using. You'll probably alter them to trigger some kind of script. Tie in a script that turns the backlight on after moving the mouse or keyboard.
I don't know the power management files for Debian Lenny. I think those relate to the gnome screensaver. I could be wrong. I guess you'll have to find the power management files and hack them. You'll eventually end up hacking something related to power management or a screen saver. That's the way I see it.
If the screensaver is timed, then you already have an open-lid scenario figured out. If open-lid input light changing is the issue, just hotkey stuff. If closed-lid is the issue, then dig around /proc/acpi and see if you can find something related to your lid. Maybe create a daemon that constantly greps to see if the lid is open/closed; if closed, then execute BIOS command. With such daemon, the requirement for X input to re-activate screen backlight would be reduced.
The reason I don't necessary think that it is the 'fault' of X, is that using the bios (as vbetool does) to change the setting is not ideal; I would expect drivers to access the hardware directly without being mediated by bioses of variable quality.
However, clearly there is some problem with the way the Toshiba hardware is being accessed. Not an issue of blame, so much as figuring out where the powersaving/backlight stuff is supposed to happen, so I can at least look at where I might patch (driver? X?).
Thanks for the setpci idea, at least it gives me a tool for figuring out the hardware.
As regards the screensaver; currently I don't run one, as I have a fairly cut-down install. I am just relying on the dpms control that X already has built in (but it isn't turning off the backlight). If I run a screensaver, I am able to fix the problem by scripting in a call to vbetool. I was hoping that X dpms control might have something I can hook into, but that might not be the case.
I have no problem with the /proc/acpi scripts on this system (suspend/resume works fine).
Hmm, reading Jonathan Buzzard's documentation, it would seem that access to the backlight control is through a Toshiba specific hardware control interface (HCI).
Since his toshset utility also allows me to turn the backlight on and off, it would seem that the Portege 3500 uses the same HCI registers to control the backlight.
So now I know how to turn the backlight on and off without using the bios, and just have to figure out where this is supposed to happen inside Linux.
There is some code for the backlight in the toshiba_acpi driver, but this is to control brightness rather than actually switching it on and off (and brightness=0 is still on, though dim). And I am guessing that this driver just provides the non-standard /proc/acpi/toshiba interface, which X would have no knowledge of.
Let me suppose that the dpms is done by X calling one of the xorg drivers (in my case the trident), then I start to understand the problem. The xorg driver is tied to the graphics chip; this is fine for an external monitor, where monitor dpms is controlled by video signals. But for a laptop, the backlight is controlled by non-video hardware. So the graphics driver would have to know both that it is on a laptop, and which laptop type it is, in order to control the backlight for the built in LCD display. This is difficult. Perhaps this could be handled by some new (laptop specific) Options in the Monitor section of xorg.conf?
Last edited by neonsignal; 07-26-2009 at 09:18 AM.
It is designed for a single user system, and invoked from the user account (in my case, from .xinitrc).
The way it works is:
1. give itself access to the Toshiba hardware control interface, and then demote privilege level back to the user
2. get the display pointer
3. every half a second, check the dpms state
4. when dpms state has changed, set the backlight to match
It is working, but there are lots of possible improvements (feel free to make comments):
* verifying that the hardware really is a Toshiba laptop with this interface
* checking that the correct display has been selected
* allowing for multiple users
* testing on systems other than the Portege 3500
* shutting down gracefully
* possibly interrupts need to be disabled around the hardware access
* less magic numbers :-)