From c6cd10f536e099277cdc46643725a5a50ea8b525 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Jun 2014 22:43:37 +0100 Subject: 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 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699 Signed-off-by: Chris Wilson --- src/sna/sna.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sna/sna.h') 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 { -- cgit v1.2.3