summaryrefslogtreecommitdiff
path: root/src/backlight
Commit message (Collapse)AuthorAge
* backlight: let udev properties override clampingTopi Miettinen2015-02-02
| | | | | | | | On my computer, the minimum brightness enforced by clamping in backlight is too bright. Let udev property ID_BACKLIGHT_CLAMP control whether the brightness is clamped or not.
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* backlight: Avoid error when state restore is disabledMichael Biebl2014-09-11
| | | | | | When the state restore is disabled, we would print: "Unknown verb: load" instead of simply skipping loading the state.
* backlight: Do not clamp brightness for LEDsDenis Tikhomirov2014-06-10
| | | | | | | | | | | | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=77092 On Thu, Jun 05, 2014 at 08:37:20AM +0200, Lennart Poettering wrote: > The patch is line-broken, please send an uncorrupted patch! I am very sorry, I forgot that my client limits line width. I will use mutt now on. > clamp_brightness() clamps the brightness value to the range of the > actual device. This is a recent addition that was added to deal with > driver updates where the resolution is changed. I don't think this part > should be dropped for LED devices. The clamp_brightness() call hence > should be called unconditionally, however, internally it should use a > different min_brightness value if something is an !backlight devices... Thank you for explanation, this sounds very reasonable to me. Please, see updated patch:
* backlight: handle saved brightness exceeding max brightnessJani Nikula2014-05-07
| | | | | | | | | | | | | | | | | | | If too high a brightness value has been saved (e.g. due to kernel mechanism changing from one kernel version to another, or booting the userspace on another system), the brightness update fails and the process exits. Clamp saved brightness between the policy minimum introduced in commit 7b909d7407965c03caaba30daae7aee113627a83 Author: Josh Triplett <josh@joshtriplett.org> Date: Tue Mar 11 21:16:33 2014 -0700 backlight: Avoid restoring brightness to an unreadably dim level and the absolute maximum. https://bugs.freedesktop.org/show_bug.cgi?id=78200
* backlight: warn if kernel exposes backlight device with bogus max_brightnessLennart Poettering2014-04-23
| | | | We shouldn't silently tape over broken kernel drivers.
* backlight: unify error messagesZbigniew Jędrzejewski-Szmek2014-04-07
|
* backlight: do nothing if max_brightness is 0Thomas Bächler2014-04-04
| | | | | | | | | | | | On virtually any newer Asus mainboard, the eeepc-wmi driver is loaded. It exposes a backlight device despite the lack of any physical backlight devices. This fake backlight device has max_brightness set to 0. Since the introduction of the clamp_brightness function, systemd-backlight tries to write '1' to brightness and fails. This patch changes systemd-backlight to exit gracefully when max_brightness is 0 before performing any action. This affects both the load and save actions.
* backlight: Avoid restoring brightness to an unreadably dim levelJosh Triplett2014-03-12
| | | | | | | Some systems turn the backlight all the way off at the lowest levels. Clamp saved brightness to at least 1 or 5% of max_brightness. This avoids preserving an unreadably dim screen, which would otherwise force the user to disable state restoration.
* backlight: Fix copy/paste error printing an unrelated error codeJosh Triplett2014-03-12
| | | | | | udev_device_get_sysattr_value returns NULL on failure, but doesn't provide an error code; thus, when printing an error from it, don't print an unrelated error code from a previous call.
* make gcc shut upLennart Poettering2014-02-19
| | | | | | | If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
* doc: update punctuationJan Engelhardt2014-02-17
| | | | Resolve spotted issues related to missing or extraneous commas, dashes.
* Remove duplicate includesKarel Zak2013-11-18
|
* util: unify reading of /proc/cmdlineLennart Poettering2013-11-06
| | | | | | Instead of individually checking for containers in each user do this once in a new call proc_cmdline() that read the file only if we are not in a container.
* kerne-command-line: introduce option 'systemd.restore_state'Tom Gundersen2013-10-19
| | | | | | | | When set to 0 this will stop tools like the backlight and rfkill tools to restore state from previous boot. This is useful in case the stored state is bogus to the extent that it is preventing you from resetting it (e.g., the backlight settings cause the screen to be off on boot on a system where the backlight can not be adjusted directly from the keyboard).
* backlight: include ID_PATH in file names for backlight settingsLennart Poettering2013-10-14
| | | | | | Much like for rfkill devices we should provide some stability regarding enumeration order, hence include the stable bits of the device path in the file name we store settings under.
* backlight: always prefer "firmware"/"platform" backlights over "raw" ↵Lennart Poettering2013-10-14
| | | | backlights if we have both for the same device
* Introduce udev object cleanup functionsZbigniew Jędrzejewski-Szmek2013-10-13
|
* Add support for saving/restoring keyboard backlightsBastien Nocera2013-10-11
| | | | | | | | | | | | Piggy-backing on the display backlight code, this saves and restores keyboard backlights on supported devices. The detection code matches that of UPower: http://cgit.freedesktop.org/upower/tree/src/up-kbd-backlight.c#n173 https://bugs.freedesktop.org/show_bug.cgi?id=70367 [tomegun: also work for devices named "{smc,samsung,asus}::kbd_backlight"]
* backlight,random-seed: move state files into /var/lib/systemdLennart Poettering2013-09-17
| | | | | Let's not scatter (private) files in /var around, let's place them all in /var/lib/systemd and below.
* backlight: instead of syspath use sysname for identifying backlight devicesLennart Poettering2013-08-14
| | | | This makes the description string of the backlight service a bit nicer.
* backlight: add minimal tool to save/restore screen brightness across rebootsLennart Poettering2013-08-14
As many laptops don't save/restore screen brightness across reboots, let's do this in systemd with a minimal tool, that restores the brightness as early as possible, and saves it as late as possible. This will cover consoles and graphical logins, but graphical desktops should do their own per-user stuff probably. This only touches firmware brightness controls for now.