Systemd/src/libsystemd
Lennart Poettering 2a66c2a1ed logind: add SetBrightness() bus call for setting brightness of leds/backlight devices associated with a seat
This augments the drm/input device management by adding a single method
call for setting the brightness of an "leds" or "backlight" kernel class
device.

This method call requires no privileges to call, but a caller can only
change the brightness on sessions that are currently active, and they
must own the session.

This does not do enumeration of such class devices, feature or range
probing, chnage notification; it doesn't help associating graphics or
input devices with their backlight or leds devices. For all that clients
should go directly to udev/sysfs. The SetBrightness() call is just for
executing the actual change operation, that is otherwise privileged.

Example line:

   busctl call org.freedesktop.login1 /org/freedesktop/login1/session/self org.freedesktop.login1.Session SetBrightness ssu "backlight" "intel_backlight" 200

The parameter the SetBrightness() call takes are the kernel subsystem
(i.e. "leds" or "backlight"), the device name, and the brightness
value.

On some hw setting the brightness is slow, and implementation and write
access to the sysfs knobs exposes this slowness. Due to this we'll fork
off a writer process in the background so that logind doesn't have to
block. Moreover, write requestes are coalesced: when a write request is
enqueued while one is already being executed it is queued. When another
write reques is then enqueued the earlier one is replaced by the newer
one, so that only one queued write request per device remains at any
time. Method replies are sent as soon as the first write request that
happens after the request was received is completed.

It is recommended that bus clients turn off the "expect_reply" flag on
the dbus messages they send though, that relieves logind from sending
completion notification and is particularly a good idea if clients
implement reactive UI sliders that send a quick secession of write
requests.

Replaces: #12413
2019-05-24 15:05:27 +02:00
..
sd-bus logind: add SetBrightness() bus call for setting brightness of leds/backlight devices associated with a seat 2019-05-24 15:05:27 +02:00
sd-daemon sd-daemon: make sd_booted() return negative errno on unexpected error 2019-02-07 14:44:44 +01:00
sd-device sd-device: use xsprintf() where appropriate 2019-04-02 14:54:42 +02:00
sd-event sd-event: add sd_event_source_disable_unref() helper 2019-05-10 16:55:35 +02:00
sd-hwdb tree-wide: (void)ify a few unlink() and rmdir() 2019-03-27 18:09:56 +01:00
sd-id128 sd-id128: expose ID128_UUID_FORMAT_STR 2019-04-05 13:47:54 +02:00
sd-login tree-wide: use reallocarray() where appropriate 2019-04-02 14:54:42 +02:00
sd-netlink sd-netlink: Add netlink property IFLA_MIN_MTU and IFLA_MAX_MTU, 2019-05-21 17:43:56 +05:30
sd-network sd-network: add sd_network_link_get_required_operstate_for_online() 2019-03-13 14:29:03 +09:00
sd-path Move LONG_LINE_MAX definition to fileio.h 2018-11-14 16:25:32 +01:00
sd-resolve util: split out errno related stuff 2019-03-14 13:25:51 +01:00
sd-utf8 tree-wide: drop empty comments 2018-06-29 11:00:30 +09:00
disable-mempool.c mempool: only enable mempool use when linked to libsystemd-shared.so 2018-10-11 11:10:37 +02:00
libsystemd.pc.in meson: define PROJECT_VERSION as the "bare" project version 2018-12-20 21:35:29 +01:00
libsystemd.sym sd-event: add sd_event_source_disable_unref() helper 2019-05-10 16:55:35 +02:00
meson.build meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=no 2018-12-21 13:43:20 +01:00