Remove code to poll the udev events for brightness
Needs ReviewPublic

Authored by bshah on May 26 2017, 3:53 PM.

Details

Summary

This code watches the device in the sysfs for changes, if device is
changed it reads the brightness again and updates it.

However that is,

a) Redundant: as if we update the brightness we already know what
brightness we set it to

b) Covers corner case: If something other then powerdevil updates the
brightness, this will update the internal brightness code accordingly

So, lets remove this extra overhead of going through udev/uevent and
make things bit more simpler

Test Plan

tested brightness control using keyboard, battery monitor

Diff Detail

Repository
R122 Powerdevil
Branch
remove-udevqt
Lint
No Linters Available
Unit
No Unit Test Coverage
bshah created this revision.May 26 2017, 3:53 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 26 2017, 3:53 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

I don't understand, you're saying your removing covering a corner case?

bshah added a comment.May 26 2017, 4:01 PM

I don't understand, you're saying your removing covering a corner case?

Right, yes.. but that corner case is very less likely to happen other then someone writing manually to sysfs file

bshah updated this revision to Diff 14860.May 26 2017, 4:11 PM

remove workaround added in the D2470

broulik edited edge metadata.May 26 2017, 4:36 PM

Writing to sysfs brightness with some wonky bash script is a pretty common thing IMHO but any simplification of brightness code is a good thing. +1

lukas added a subscriber: lukas.May 31 2017, 10:07 AM

Works fine for me in general, with 2 caveats:

  • the brightness change doesn't animate (but afaik that's expected)
  • when switching back to AC, the brightness isn't restored (stays at the previous "battery" level)

In principle it works but when I unplug and plug back in AC, sometimes it changes brightness or at least moves the brightness slider around for some weird reason and then the brightness doesn't match the slider anymore.