Bug 19168

Summary: xset dpms force off does not turn off LCD backlight
Product: xorg Reporter: Thomas Champagne <lafeuil>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: 7.4 (2008.09)   
Hardware: PowerPC   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
ouput of "lspci -vv -nn"
none
Xorg.0.log
none
possible fix
none
outpout of "radeontool regmatch" when screen backlight is on
none
outpout of "radeontool regmatch" when screen backlight is off none

Description Thomas Champagne 2008-12-18 13:39:22 UTC
Created attachment 21281 [details]
ouput of "lspci -vv -nn" 

Hi 

I have a problem with DPMS. When my computer is idle, the monitor blank but the LCD backlight still on.
When I run the command "xset dpms force off", I have the same result. 
My laptop is an Ibook (powerpc). 
I join the Xorg.0.log and the ouput of "lspci -vv -nn" command. 
I found an other bug with the same problem but it is closed : #3483.

Thomas
Comment 1 Thomas Champagne 2008-12-18 13:40:31 UTC
Created attachment 21282 [details]
Xorg.0.log
Comment 2 Alex Deucher 2008-12-18 14:39:02 UTC
Is this regression?  Did the backlight used to go off in a previous release?  I suspect apple has the backlight wired up some non-standard way.
Comment 3 Thomas Champagne 2008-12-19 00:46:59 UTC
> Is this regression?  Did the backlight used to go off in a previous release?  
For me, the problem has always existed. But before, I used the PBButtonsd daemon (http://pbbuttons.berlios.de/). This daemon switched off the backlight putting the level brightness to zero. 
But I think the radeon driver should switch off the backlight alone without an other daemon because all "power manager" programs (like gnome-power-manager) use the DPMS features to control the switch on/off display. 


> I suspect apple has the backlight wired up some non-standard way.
Yes, I agree with you. I also read about this on internet but I can't find the article again. 

How can I help you to find a solution ?
Comment 4 Alex Deucher 2008-12-19 07:43:40 UTC
(In reply to comment #3)
> > Is this regression?  Did the backlight used to go off in a previous release?  
> For me, the problem has always existed. But before, I used the PBButtonsd
> daemon (http://pbbuttons.berlios.de/). This daemon switched off the backlight
> putting the level brightness to zero. 
> But I think the radeon driver should switch off the backlight alone without an
> other daemon because all "power manager" programs (like gnome-power-manager)
> use the DPMS features to control the switch on/off display. 
> 

I agree, I just don't know how apple does it.

> 
> > I suspect apple has the backlight wired up some non-standard way.
> Yes, I agree with you. I also read about this on internet but I can't find the
> article again. 
> 
> How can I help you to find a solution ?
> 

if you could use radeontool from here:
http://cgit.freedesktop.org/~airlied/radeontool
and dump the regs when the backlight is on and when it's off and attach the dumps, I'll see what I can find. as root:
./radeontool regmatch '*' > blon.dump
./radeontool regmatch '*' > bloff.dump
Comment 5 Alex Deucher 2008-12-19 07:51:13 UTC
Created attachment 21325 [details] [review]
possible fix

This implements the on chip backlight control, not all oems use it.  It might work for you, it might not.  Also, depending on how the backlight is wired up, the levels may be reversed (not sure whether 0 = on or off and 255 = on or off).
if it doesn't work, try switching the levels in the patch.  I've got the alternate setting commented out below the main one, so just switch the comments.  Make sure you switch both the enable and disable paths.
Comment 6 Thomas Champagne 2008-12-20 03:51:03 UTC
Created attachment 21339 [details]
outpout of "radeontool regmatch" when screen backlight is on
Comment 7 Thomas Champagne 2008-12-20 03:51:39 UTC
Created attachment 21340 [details]
outpout of "radeontool regmatch" when screen backlight is off
Comment 8 Thomas Champagne 2008-12-20 06:54:15 UTC
(In reply to comment #5)
> Created an attachment (id=21325) [details]
> possible fix
> 
> This implements the on chip backlight control, not all oems use it.  It might
> work for you, it might not.  Also, depending on how the backlight is wired up,
> the levels may be reversed (not sure whether 0 = on or off and 255 = on or
> off).
> if it doesn't work, try switching the levels in the patch.  I've got the
> alternate setting commented out below the main one, so just switch the
> comments.  Make sure you switch both the enable and disable paths.
> 

I tested your patch but when I run Xorg, the brightness was always very low (zero) and the backlight wasn't switch off. 

I test the current git repository without patch and the driver works very well but this backlight bug is present. 
Comment 9 Thomas Champagne 2009-05-27 09:45:45 UTC
I thought a lots about this problem and I checked in differents projects (PowerDevil for KDE and Gnome Power Management) to see how the screen is switched off. 
This projects use the DPMS function to switch off the screen (define in X11/extensions/dpms.h)

The problem on Ibook is that the screen's power is controled by Power Management Unit (PMU). There is a module on Linux system. You can control this device with /dev/pmu. 

Do you think radeon driver must control PMU or each desktop power management (Powerdevil, GPM...) must control PMU themselves?

Thanks in advance for your help.

Comment 10 Alex Deucher 2009-05-27 11:03:46 UTC
(In reply to comment #9)
> The problem on Ibook is that the screen's power is controled by Power
> Management Unit (PMU). There is a module on Linux system. You can control this
> device with /dev/pmu. 
> 
> Do you think radeon driver must control PMU or each desktop power management
> (Powerdevil, GPM...) must control PMU themselves?

I'm not sure what the best solution is.  Adding it to the driver would make it just work when dpms is used, but most power managers already mess with backlight to save power, so that should work too.
Comment 11 Thomas Champagne 2010-01-05 13:00:59 UTC
Hello Alex

Today, I'm testing the current developpement tree of radeon driver (6.12.99). 
When I went to cook, I saw the screen of my computer switching off. 
So, I tested the command "xset dpms force off" and the screen switched off again. 

I don't know what you have changed in the master tree but I think that it solves this bug.
I found this commit in the git repository : 
http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=48aa5064aff4b9adf768e480df2312d4375e9c40
Is this patch that solves the problem ? 

If this bug is fixed, it's for me a very good news !

Thomas
Comment 12 Alex Deucher 2010-01-05 14:13:51 UTC
(In reply to comment #11)
> Hello Alex
> 
> Today, I'm testing the current developpement tree of radeon driver (6.12.99). 
> When I went to cook, I saw the screen of my computer switching off. 
> So, I tested the command "xset dpms force off" and the screen switched off
> again. 
> 
> I don't know what you have changed in the master tree but I think that it
> solves this bug.
> I found this commit in the git repository : 
> http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=48aa5064aff4b9adf768e480df2312d4375e9c40
> Is this patch that solves the problem ? 

Could be.  This fixed another mac LVDS problem so maybe yours needed it too.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.