Page MenuHomeFreeBSD

Add backlight subsystem
ClosedPublic

Authored by manu on Aug 31 2020, 2:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 7:29 PM
Unknown Object (File)
Tue, Nov 19, 1:09 AM
Unknown Object (File)
Tue, Nov 19, 1:08 AM
Unknown Object (File)
Tue, Nov 19, 1:00 AM
Unknown Object (File)
Tue, Nov 19, 1:00 AM
Unknown Object (File)
Tue, Nov 19, 1:00 AM
Unknown Object (File)
Tue, Nov 19, 1:00 AM
Unknown Object (File)
Mon, Nov 18, 1:05 PM

Details

Reviewers
None
Group Reviewers
manpages
Commits
rS366369: Add backlight subsystem
Summary

This is a simple subsystem that allow drivers to register as a backlight.
Each backlight creates a device node under /dev/backlight/backlightX and an alias based on the name provided.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

manu requested review of this revision.Aug 31 2020, 2:52 PM
manu added a child revision: D26251: Add backlight(8).

Add changes that were added in D26253 by error.

share/man/man9/backlight.9
25

Meh, date isn't good, I'll change it when I commit this anyway :P

val_packett.cool added inline comments.
share/man/man9/backlight.9
49

It could work for not just panels, but also keyboards (e.g. D21746)..

That would work much better if we expose metadata, so userspace could tell which of the backlightN is a display and which is a keyboard.

sys/sys/backlight.h
39

hmm I don't see where that levels[BACKLIGHTMAXLEVELS] field is used.. or how it would be used

share/man/man9/backlight.9
49

I'm not sure about the metadata yet but for a case like that there is the name used for the dev alias, so you would have a /dev/backlight/keyboard0 or something like that.

sys/sys/backlight.h
39

See https://reviews.freebsd.org/D26252
I didn't put this under #ifdef FDT but maybe I should.

share/man/man9/backlight.9
49

Aliases are only okay for manual ad-hoc configurations. I'd like to eventually add support for this in the UPower daemon, which would have to enumerate the devs like

for (file in /dev/backlight):
  metadata = ioctl(give_me_meta, file)
  if (metadata & IS_DISPLAY):
    new Display(file)
  if (metadata & IS_KEYBOARD):
    new Keyboard(file)

In general anything exposed by the kernel should be enumerable and inspectable, writing userspace software is really frustrating when the kernel isn't being helpful.

Add GETINFO ioctl to get the backlight name and type.

0mp added inline comments.
share/man/man9/backlight.9
68

You can drop .Pa from here.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 2 2020, 6:18 PM
Closed by commit rS366369: Add backlight subsystem (authored by manu). · Explain Why
This revision was automatically updated to reflect the committed changes.