You are not logged in.

#1 2022-04-08 14:26:02

has_bean
Member
Registered: 2022-04-08
Posts: 1

Brightness control for OLED displays

What is the current best practice for brightness control of OLED displays via Xorg?

It looks like oled-linux (https://aur.archlinux.org/pkgbase/linux-oled) made it into 5.12 and uses redshift. As such, my understanding is that brightness control via oled-linux is "fake" and accomplished via gamma correction (http://jonls.dk/redshift/).

I also see that

 xrandr --output -eDP-1 --brightness $x 

seems to work pretty well (for $x between 0 and 1) for brightness correction on my machine (Dell XPS 17 9700).

Is there currently a recommended analogue of

 xbacklight -inc 10 

that I should put in my ~/.xbindkeysrc? If not, is something like the following sensible?

"curr_brtness=$(xrandr --current --verbose | grep 'Brightness' | awk 'NF{ print$NF }'); \
xrandr --output eDP-1 --brightness $(bc <<< "$curr_brtness + .1")"
    XF86MonBrightnessUp

To my limited understanding, the "correct" approach is some combination of brightness and gamma correction, so if there's e.g. a standard function for computing gamma based on brightness or a redshift command or something I can add it into the earlier snippet.

Relatedly, I'm not clear as to what oled-linux is supposed to do here, since it seems it is meant to unify the sort of hacks that I am trying to do but I'm not sure how to access it.

Also relatedly, the wiki (https://wiki.archlinux.org/title/backlight) suggests that the only currently supported approaches for brightness control on OLED displays are gamma correction and PWM. If this is the case, which is `xrandr` doing? I was under the impression that it was actually changing the LED brightness.

Last edited by has_bean (2022-04-08 14:58:37)

Offline

#2 2022-11-17 20:42:38

ppenguin
Member
Registered: 2018-03-20
Posts: 8

Re: Brightness control for OLED displays

It might be necrobumping, but since I was looking into this myself just now...

On my HP-Spectre (with OLED) it used to work pretty much out of the box wit `xfce-power-manager` (on `NixOS`, so YMMV), but since I was leaning up and getting another WM I figured I might do it "more direct".

For me (`i915` .e. `intel`), it is as simple as reading and writing to `/sys/devices/pci.../.../intel_backlight/brightness` (look for a similar path with `find` and try it out.).

`cat /path/to/brightness` reads it and `echo 55 > /path/to/brightness` sets it

Offline

Board footer

Powered by FluxBB