Kernel 5.8 breaks thinkpad x1 brightness control in KDE

After upgrade to kernel 5.8.3-2 plugging / unplugging power to my x1 carbon (6th gen) does not change monitor brightness. Resetting in KDE settings has no effect. Works fine in 5.7. I wonder if anyone else has seen this or knows a fix …

Hi!
I had the same problem with my asus tuff fx505 since 5.7. After search the net for a fix and not find anyone, i made my personal workaround.
I created a script to change brightness on every boot.

  1. run xrandr to know the name of your output and noted
  2. create a file as brightness.sh an give ti exec permissions
  3. open the file and add this
#!/bin/bash
xrandr --output "the name you noted before" --brightness 0.80 

you can change 0.80 to the valor you like
4. save it on your home
5. go to settings/autostart and add the script.

thanks for that but I want KDE to handle brightness as I plug and
unplug the AC power - I could make a custom ACPI script that
watches for plug events but really KDE should do this by
itself (and I am sure it will eventually).

Hi!
I thing it isn’t a kde problem but a kernel/firmware instead. Anyway let’s hope it’ll fix!!

Still not fixed as of kernel 5.8.11-1

Is there anything in /sys/class/backlight/?

there is: the usual files are present; /sys/class/backlight/intel_backlight/brightness tracks the screen brightness but kde does nothing when the laptop is plugged into AC (or unplugged)

this also happens with kernel 5.9 RC

it might be related to this bug:
https://bugzilla.kernel.org/show_bug.cgi?id=208341

But does it work? Can you change the brightness by writing to the brightness file?

no problem manually setting brightness by echoing into “brightness”

but here are two big clues :slight_smile:

  1. with kernel 5.7 there are many powerdevil messages in journalctl when I plug or unplug, but with 5.8 there are no powerdevil messages
  2. if I reboot with AC unplugged everything works correctly (and powerdevil messages appear in the log)

So something is wrong with powerdevil if I boot with AC plugged in (powerdevil is running: ps shows /usr/lib/org_kde_powerdevil)

EDIT: here’s another clue: if I unplug AC and restart upower service then kde power control starts to work (BTW, another symptom is that closing the lid does not initiate slieep)

I see, that’s interesting, this points to a kernel regression, although you said writing to the brightness file works just fine, so I’m not sure. Could you please install acpid and then run acpi_listen and see if you get events when you (un)plug the power cord? If you’re feeling adventurous, then you could git-bisect the kernel to find what causes the problem.

acpi_listen output is identical between the working condition (ie. after either booting on battery or restarting upower on battery) and the non-working condition (ie. after booting on AC), and looks like:

UNPLUG:
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000000
ibm/hotkey LEN0268:00 00000080 00006030
thermal_zone LNXTHERM:00 00000081 00000000

PLUG:
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000001
ibm/hotkey LEN0268:00 00000080 00006030
thermal_zone LNXTHERM:00 00000081 00000000

Plus, I note that if I restart upower while plugged in the problem returns

Also, thanks for looking at this :slight_smile:

Sorry to reply to myself but now I notice that kernel 5.8 will not connect to my iphone to download images with digikam. It works perfectly in 5.7. I think I’ll give up and declare 5.8 POS.

I think this issue is related. Could you take a look?

Yes, that looks like exactly my issue, though they haven’t noted the “restart upower on battery” work around