Bug 13374

Summary: Intel driver needs a way to enable legacy backlight by default
Product: xorg Reporter: Brice Goglin <brice.goglin>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: nian.wu
Version: 7.3 (2007.09)Keywords: patch
Hardware: Other   
OS: All   
URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=451848
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 13493    
Attachments:
Description Flags
Use legacy instead of combo backlight method none

Description Brice Goglin 2007-11-24 01:19:31 UTC
Bug reported by Joey Hess on the Debian BTS last week. Intel 2.2 broke his backlight support again, with old symptoms described in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439744

He says:

"But when I took a look at commit 43fbc547786cf26514f95bce79fab58a66c291bf,
I saw that they'd generalised things and made the backlight control
method used be configurable with xrandr. After I ran this, my backlight
worked as expected:

xrandr --output LVDS --set BACKLIGHT_CONTROL legacy

So I hope that the X server can be taught to use legacy mode by default
for this model of laptop, instead of the current default, which I think
is probably native mode.

(Is there some way I can configure this in xorg.conf?)"

He has a Fujitsu P7120 laptop. His config and log are available from
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=451848
Comment 1 Jesse Barnes 2007-11-26 08:58:25 UTC
Yeah, changing the default is easy enough.  In i830_lvds.c there's some code to detect which method to use, apparently it's getting it wrong on this laptop.  So either the detection code is broken or we need a new type of quirk for this machine.
Comment 2 Jesse Barnes 2007-11-28 12:59:48 UTC
Joey, can you confirm what the selected backlight control method is on this machine by default?  AFAICT it should be selecting the legacy method for you already, unless you have a kernel backlight interface available.

Just run 'xrandr --prop' at startup time to check.

Thanks,
Jesse
Comment 3 Brice Goglin 2007-11-28 15:32:53 UTC
(Reply from Joey)

it's "combination" on startup

Screen 0: minimum 320 x 200, current 1280 x 768, maximum 1280 x 1280
VGA disconnected (normal left inverted right x axis y axis)
LVDS connected 1280x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
	BACKLIGHT_CONTROL: combination
		supported: native       legacy       combination  kernel      
	BACKLIGHT: 31250 (0x00007a12) range:  (0,31250)
   1280x768       59.8*+   60.0  
   1152x768       54.8  
   1024x768       85.0     75.0     70.1     60.0  
   832x624        74.6  
   800x600        85.1     72.2     75.0     60.3     56.2  
   640x480        85.0     72.8     75.0     59.9  
   720x400        85.0  
   640x400        85.1  
   640x350        85.1  
TV disconnected (normal left inverted right x axis y axis)
	BOTTOM: 37 (0x00000025) range:  (0,100)
	RIGHT: 46 (0x0000002e) range:  (0,100)
	TOP: 36 (0x00000024) range:  (0,100)
	LEFT: 54 (0x00000036) range:  (0,100)
	TV_FORMAT: NTSC-M
		supported: NTSC-M       NTSC-443     NTSC-J       PAL-M       
		           PAL-N        PAL         

Comment 4 Jesse Barnes 2007-11-28 15:39:37 UTC
Aha.  I wonder what the best default is... on many machines both the legacy and native registers work, and the combo method tries to use the latter as much as possible.  That gives the backlight a nice, large range of brightness.

But I guess on some, the native regs are totally ignored, so I wonder if we shouldn't default to legacy if the backlight reg indicates legacy mode...

I assume the attached patch works for you?
Comment 5 Jesse Barnes 2007-11-28 15:40:30 UTC
Created attachment 12812 [details]
Use legacy instead of combo backlight method

If we detect that the legacy registers are in use, don't try to use the native regs at all by default.
Comment 6 Brice Goglin 2007-11-29 12:16:14 UTC
Yes, Joey says "I've tested it and it works for me".
Comment 7 Jesse Barnes 2007-11-29 12:42:38 UTC
Ok, thanks.  I'll push this stuff along with the other backlight fixes.
Comment 8 Jesse Barnes 2007-12-04 18:27:53 UTC
Ok, just pushed the fix for this one.  Please open a bug if it's still broken for you.

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.