[patch] fix the top end brightness setting for PMU
Richard Hughes
hughsient at gmail.com
Mon Aug 28 15:01:43 PDT 2006
In hald/linux/pmu.c (laptop_panel_refresh) we have:
hal_device_property_set_int (d, "laptop_panel.num_levels", 14);
on the (my?) incorrect assumption that we have 15 brightness states
(1-15), where 0 is power off.
This is incorrect as in tools/hal-system-power-pmu.c we have:
if (strcmp (argv[1], "setlcd") == 0) {
/* we add 1 as 0 is backlight disable */
brightness = atoi (argv[2]) + 1;
ret = pmac_set_lcd_brightness (brightness);
which offsets (correctly) the brightness so we don't turn off the
backlight with the lowest dim command.
This means we actually have 15 levels (0-14) (which is then shifted by
hal-system-power-pmu.c to the correct (1-15) levels for the hardware.
This was brought to my attention by
http://bugzilla.gnome.org/show_bug.cgi?id=350507 which I can verify on
my iBook.
Attached patch fixes the issue for me, and I've updated the comment text
to be clearer.
Okay to apply?
Richard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-brightness-fix-pmu.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060828/87da6443/hal-brightness-fix-pmu.bin
More information about the hal
mailing list