The code to set the brightness on Sony laptops uses the Sony ACPI module, which: - isn't upstream yet (so not in Fedora) - won't work on older Sony laptops ---8<-- elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "sony" ]; then # cat /proc/acpi/sony/brightness # 5 value="`cat $HAL_PROP_LINUX_ACPI_PATH`" let "value = ${value} - 1" ---8<-- It should be possible to use sonypi instead, but this would require either: - spicctl to be present - the hal-system-lcd-get-brightness to be rewritten in C I'll try with spicctl for now
Created attachment 5462 [details] [review] hal-spicctrl-support.patch 2 changes: - if there's no ACPI path, and the LCD type is Sony, and spicctrl is available, use spicctrl to set/get the brightness The range is 0..255, not 0..7, so we need to convert the values - in the set brightness, bail out when the value is *equal* to HAL_PROP_LAPTOP_PANEL_NUM_LEVELS as well. For example, 8 values means 0 to 7, not 0 to 8 (which would be 9 levels) I tested this by hand, on a current FC5, and the sonypi driver is automatically loaded.
I wrongly assumed that the sonypi module would get loaded automatically, it doesn't. Should I go one step further and make it load the sonypi driver (urgh)?
No, this should not be modprobed by hal IMO. Does the sonipi diver work if modprobed manually?
Yeah, works fine once modprobed manually. Are the acpi modules auto-loaded on startup?
But this would break laptops which use the sony-acpi driver, like mine.
Why would break exactly? We would only load it when $HAL_PROP_LINUX_ACPI_PATH isn't available.
Because I went to sleep 5 hours ago and woke up 5 minutes ago and didn't get coffee yet. Sorry, "It should be possible to use sonypi instead" and misreading your patch made me think you were replacing the previous script with spicctrl.
For the module loading, this is the RH bug so that udev gets to load it: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190004
The changes I posted aren't enough. The panel isn't available as a an ACPI object, so it's not getting added to the list, and we don't even try to get/set the brightness.
Created attachment 5487 [details] [review] hal-spicctrl-support-2.patch Updated (and working) patch. This one also creates an LCD Panel object, necessary for getting the methods supported, also corrects the bug mentioned above in the set script.
Created attachment 5490 [details] [review] hal-spicctrl-support-3.patch Updated patch against CVS HEAD.
2006-04-26 Richard Hughes <richard@hughsie.com> Patch from Bastien Nocera <hadess@hadess.net>: * hald/linux2/acpi.c: (laptop_panel_refresh), (acpi_synthesize_sonypi_display), (acpi_synthesize_hotplug_events): Create an LCD Panel object of type sonypi, necessary for getting the methods supported for panasonic notebooks. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=6729 * tools/hal-system-lcd-get-brightness: * tools/hal-system-lcd-set-brightness: Support the sonypi brightness type.
The detection code is broken for systems where sonypi loads, but offers no brightness support (ie. Type 3 VAIOs).
Created attachment 5507 [details] [review] hal-spicctrl-support-dont-handle-all-vaios.patch Don't handle through sonypi if we have acpi brightness support
Created attachment 5508 [details] [review] hal-spicctrl-support-dont-handle-all-vaios-2.patch And against CVS...
2006-04-27 Richard Hughes <richard@hughsie.com> Patch from Bastien Nocera <hadess@hadess.net>: * hald/linux2/acpi.c: (acpi_synthesize_sonypi_display): Check that we don't support brightness change through ACPI with the presence of /proc/acpi/sony/brightness for type3 VAIOs.
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.