Commit Graph

6 Commits

Author SHA1 Message Date
Chris Wilson 08921e4bda backlight: Expose interface to switch backlight on/off entirely
A feature in recent kernels is to disambiguate between the meaning of
brightness=0, between disabling the the backlight entirely or setting
the lowest valid brightness. As such, we now have an extra knob in sysfs
to explicitly request that the backlight be turned off.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-11 08:09:39 +01:00
Chris Wilson f68d363a23 backlight: Remove unused 'original' member from structure
This was accidentally added with no users.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-23 22:12:33 +01:00
Chris Wilson f9e7ac7db7 backlight: Set structure to safe values when not initialised
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-23 21:58:05 +01:00
Chris Wilson 0b92b1285c backlight: Make search routine for device specific backlight common
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-20 19:22:03 +00:00
Chris Wilson 268842a47f backlight: Amalgamate hardcoded priority tables
Our fallback path for finding the backlight interface uses a hardcoded
table of known backlight controllers in proirity order. Rather than
maintain this table twice in the midst of the KMS logic, push it to the
new set of common backlight routines.

This incorporates bugfixes from SNA to handle unknown backlights, but
usable, gracefully.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-15 20:56:24 +00:00
Chris Wilson 3d629c91cf intel: Add a helper for setting backlight without root rights
Once the xserver stops running as root on kms capabable systems, we will need
some other way to access the backlight.

The approach taken in this patch moves most of the heavy lifting to a
helper that runs with root privileges and pipes our requested brightness
into the sysfs backlight interface. Where required, we use pkexec to
launch the helper with the elevated privilege.

v2: Amalgamate much more of the duplicate code.
    Keep the daemon and pipe alive for the lifetime of the backlight interface.
    Provide an alternative for systems without PolicyKit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com> [v1]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-15 15:33:47 +00:00