! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use sysctl(3) to get or set brightness level on FreeBSD and DragonFly systems
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Olivier Duchateau 2014-12-31 13:00:58 CET
Created attachment 5841 
Patch to use sysctl(3) on FreeBSD and DragonFly

Patch replaces sysfs by sysctl(3) functions on FreeBSD and DragonFly. On these systems backlight brightness is managed by acpi_video(4) [1]. 

Often acpi_video is not functional, and panel plugin crashes, like bug #11101.

sysctlbyname () function returns 0, success or -1, failure.

backlight_helper_get_levels () function returns GList object because we can find several times same values, and values are not always sorted. It's more simpler when we need to find higher value.

e.g., sysctl hw.acpi.video.lcd0.levels
hw.acpi.video.lcd0.levels: 70 30 10 17 23 30 40 50 60 70 80 90 100

backlight_helper_set_* functions check value have really changed, because in some rare case, it always success but value was not changed.

[1] https://www.freebsd.org/cgi/man.cgi?query=acpi_video&sektion=4&manpath=FreeBSD+10.1-RELEASE
Comment 1 Eric Koegel editbugs 2015-02-07 17:05:50 CET
Awesome, thanks for doing this! Pushed to master in:
commit f9980385de8ba5bb33391cf3bc8b283db0fb1de2
Author: Olivier Duchateau <duchateau.olivier@gmail.com>
Date:   Wed Dec 31 11:52:52 2014 +0100

    Use sysctl(3) to get or set brightness level on FreeBSD and DragonFly systems
    

http://git.xfce.org/xfce/xfce4-power-manager/commit/?id=f9980385de8ba5bb33391cf3bc8b283db0fb1de2

Bug #11413

Reported by:
Olivier Duchateau
Reported on: 2014-12-31
Last modified on: 2015-02-07

People

Assignee:
Ali Abdallah
CC List:
3 users

Version

Attachments

Additional information