Bug 21612 - Generic get_backlight should read 'actual_brightness' not 'brightness'
Summary: Generic get_backlight should read 'actual_brightness' not 'brightness'
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Danny Kukawka
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-06 23:30 UTC by Johannes Hessellund
Modified: 2009-07-24 02:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
addon-generic-backlight.c.diff (410 bytes, patch)
2009-05-07 01:08 UTC, Johannes Hessellund
Details | Splinter Review

Description Johannes Hessellund 2009-05-06 23:30:32 UTC
In addon-generic-backlight.c line 67
http://cgit.freedesktop.org/hal/tree/hald/linux/addons/addon-generic-backlight.c

get_backlight function read from the wrong sysfs file.
The real backlight value is available from 'actual_brightness', whereas 'brightness' is used for changing/setting the backlight through software.
'brightness' always reads last value writen to it.
Backlight which is hardware controlled, as with many thinkpads (ex T42), does not update 'brightness'. Thus hald is not returning the right value!


line 67 should be:
   g_snprintf (sysfs_path, sizeof (sysfs_path), "%s/actual_brightness", path);


On my T42 the sysfs path is:
   /sys/class/backlight/thinkpad_screen/actual_brightness
Comment 1 Johannes Hessellund 2009-05-07 01:08:45 UTC
Created attachment 25584 [details] [review]
addon-generic-backlight.c.diff

This patch fixes this issue. Please test and commit!
Comment 2 Johannes Hessellund 2009-05-25 06:47:11 UTC
Additional info:

I'm using a Thinkpad T42.

This patch solves the issue for thinkpads using thinkpad_acpi.

On Ubuntu 9.04 this causes an issue with wrong notifications when changing brightness. Gnome-power-manager reads the brightness value through hal, thus always showing the last value writen to 'brightness', even though the brightness lvel actually might be higher or lower, if controlled thru hardwired brightness control.

Please apply this simple patch. 
Comment 3 Danny Kukawka 2009-07-24 02:27:02 UTC
http://cgit.freedesktop.org/~dkukawka/hal/commit/?id=d792a792846f9632edfdea3651a74fcd24b2ead7

get merged before the next release


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.