diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-05 22:43:37 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-06 08:12:38 +0100 |
commit | c6cd10f536e099277cdc46643725a5a50ea8b525 (patch) | |
tree | 2b96e76cc7869f5dad02fa2b3b84d3e96d5d286a /src/sna/sna.h | |
parent | b545e10c50cbb2dd6f9fd53369667bed0d8f1b51 (diff) |
sna: Hook up a backlight udev monitor for external changes
Changes to the backlights are notified through uevents. Hooking up a
udev monitor to listen out for external changes to the backlight (e.g.
through ACPI function keys, or by the user writing to
/sys/class/backlight directly) is easier than enabling polling on the
backlight sysfs file using X's select() mechanism.
Since we listen to backlight changes, we have to be careful not to
confuse the side-effects of disabling connectors (which may cause either
ourselves or the kernel to turn off the backlight) with the user value.
Many thanks to Alexander Mezin for the suggestion to use udev for
tracking the notifications for external changes to the backlight.
Reported-by: Alexander Mezin <mezin.alexander@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r-- | src/sna/sna.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index 7845cd11..0739f7b0 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -298,6 +298,11 @@ struct sna { unsigned serial; uint32_t *encoders; + +#if HAVE_UDEV + struct udev_monitor *backlight_monitor; + pointer backlight_handler; +#endif } mode; struct { |