Page MenuHomeFreeBSD

Add backlight subsystem

Authored by manu on Aug 31 2020, 2:52 PM.
Referenced Files
Unknown Object (File)
Tue, Jul 9, 5:58 PM
Unknown Object (File)
Mon, Jul 8, 4:35 AM
Unknown Object (File)
Fri, Jul 5, 1:01 PM
Unknown Object (File)
Thu, Jul 4, 8:17 AM
Unknown Object (File)
Tue, Jul 2, 3:37 PM
Unknown Object (File)
Wed, Jun 19, 8:40 PM
Unknown Object (File)
Jun 1 2024, 4:46 PM
Unknown Object (File)
May 24 2024, 2:40 AM


Group Reviewers
rS366369: Add backlight subsystem

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

rS FreeBSD src repository - subversion
Lint Not Applicable
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.

25 ↗(On Diff #76406)

Meh, date isn't good, I'll change it when I commit this anyway :P added inline comments.
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.

38 ↗(On Diff #76596)

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

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.

38 ↗(On Diff #76596)

I didn't put this under #ifdef FDT but maybe I should.

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.
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.