]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
backlight: reduce clamp to 1%
authorDavid SantamarĂ­a Rogado <howl.nsp@gmail.com>
Mon, 29 Dec 2025 16:29:37 +0000 (17:29 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 04:20:55 +0000 (13:20 +0900)
Actually GNOME sets a clamp of 1% and divides in 20 steps the brightness
control. Using 5% clamp makes things like in a device with max value 640
to always be in the first brightness step in GNOME and we can't leave in
the minimum.

GNOME set steps of 640/20 = 32 with the zero step 640 * 1% = 6. When we
restart the device with the lowest bright systemd sees 6 but sets
640 * 5% = 32, so we get the brightness in the first step.

Tests in IPS and OLED panels have been done and 1% still seems a
comprensive minimun usable value so use that to allow all environments
to be able to set lower brightness values that won't be raised by
systemd at boot.

If your user enviroment allow to set excesive lower unusable values you
should blame it or yourself if you directle changes it through sysfs but
not systemd.

NEWS
src/backlight/backlight.c

diff --git a/NEWS b/NEWS
index b5fba3cb99923fb9bf23cd17e368e016a78371cf..3f9dbda1dbf3e46c2aa6d3df6422e5cea09fecdf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,14 @@ CHANGES WITH 260 in spe:
           SYSTEMD_COLORS=256, and SYSTEMD_COLORS=24bit respectively when output
           is to a non-dumb TTY, and like SYSTEMD_COLORS=no otherwise.
 
+        * Minimum backlight brightness clamp for restoring it at boot has been
+          lowered from 5% to 1%. This is a safe change allowing more chance to
+          user environments to set lower values that won't be set higher at boot
+          while still giving the chance to recover from blackouts because
+          excesive lower bright values by just rebooting. Notice that if your
+          enviroment allow you to set excesive low brightness values this has
+          nothing to do with systemd's brightness clamp.
+
 CHANGES WITH 259:
 
         Announcements of Future Feature Removals and Incompatible Changes:
index 86994412dcf693d4ccfe7c7d3c68d7969093d586..0ef362813fbcc49ce2a3e441f13e14afc6f7e2c9 100644 (file)
@@ -385,7 +385,7 @@ static int shall_clamp(sd_device *device, unsigned *ret) {
                 return r;
         if (r > 0) {
                 property = "ID_BACKLIGHT_CLAMP";
-                default_percent = 5;
+                default_percent = 1;
         } else {
                 property = "ID_LEDS_CLAMP";
                 default_percent = 0;