Page MenuHomeFreeBSD

Add backlight subsystem
ClosedPublic

Authored by manu on Aug 31 2020, 2:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 24 2024, 10:55 AM
Unknown Object (File)
Feb 23 2024, 12:20 PM
Unknown Object (File)
Jan 13 2024, 10:26 AM

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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #76406)

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
48 ↗(On Diff #76596)

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
38 ↗(On Diff #76596)

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

share/man/man9/backlight.9
48 ↗(On Diff #76596)

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
38 ↗(On Diff #76596)

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

share/man/man9/backlight.9
48 ↗(On Diff #76596)

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
67 ↗(On Diff #77101)

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.