# Cannot change brightness on laptop (FreeBSD 13.1)



## Kpist > Maskinpistol (Dec 15, 2022)

I just installed FreeBSD 13.1 AMD64 on a laptop with an Intel CPU and Intel GMA integrated graphics. I cannot change the backlight on the LCD no matter what I try. 

I first tried to load acpi_video using `kldload acpi_video` which did not post any error messages. However, it still wouldn't let me change the brightness with the appropriate keys on the keyboard (Not even while holding down the Fn key). 

Then I tried `sysctl hw.acpi.video.lcd.active` along with all the other commands starting with _sysctl hw.acpi.video.lcd _(._levels_, _.brightness_, _.fullpower_ and _.economy_). All of them resulted in sysctl telling me "sysctl: unknown oid '<inputted oid>'"

Then I installed `pkg install graphics/intel-backlight`. After installation, I tried running any and all commands beginning with _backlight_ but everytime I would receive the error: "backlight: cannot open /dev/backlight/backlight0: No such file or directory" 

After that, I tried installing xbacklight. executing _xbacklight _always returns me the error "RANDR Query Version returned error -1" outside of Xorg. Using the _xbacklight_ command in Xorg (more specifically Xfce that I'm currently using.), the message "No outputs have backlight property" is returned.

Well, that's everything I tried. Don't know any other possible solution. Thank you in advance for helping me!


----------



## T-Daemon (Dec 15, 2022)

Kpist > Maskinpistol said:


> Intel GMA integrated graphics


Which one exactly? Execute `pciconf -lv | grep -B3 display`, post output.

On newer hardware, for the display backlight to work, provided the Intel GPU is supported, a DRM kernel module must be installed and loaded.

Is graphics/drm-kmod installed and the i915 driver properly enabled, the user in the "video" group (see `pkg info -D drm-510-kmod`)? If it is, are there any "drm" error messages (see dmesg(8)).

For older hardware, besides acpi_video, there are brand specific hotkeys or OEM driver:

```
/boot/kernel/acpi_asus.ko
/boot/kernel/acpi_asus_wmi.ko
/boot/kernel/acpi_fujitsu.ko
/boot/kernel/acpi_hp.ko
/boot/kernel/acpi_ibm.ko
/boot/kernel/acpi_panasonic.ko
/boot/kernel/acpi_sony.ko
/boot/kernel/acpi_toshiba.ko
```
For detailed information see the corresponding driver manual.


----------



## Kpist > Maskinpistol (Dec 15, 2022)

The command `pciconf -lv | grep -B3 display` tells me that the GPU is a "Mobile GM965/GL960 Integrated Graphics Controller". I successfully installed _drm-kmod_ and `pkg info -D drm-510-kmod` reports no errors. The line `kld_list="i915.kms"` is currently present in _/etc/rc.conf_. `dmesg` reports a lot so there might be something I've missed, but I do spot "[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19)", and "[drm] Got stolen memory base 0x3f800000, size 0x800000". Neither command `kldload acpi_video` nor `kldload acpi_fujitsu` results in any error being displayed (except the fact that they're already loaded or in kernel, of course). The command `sysctl hw.acpi.fujitsu.lcd_brightness` returns me "sysctl: unknown oid 'hw.acpi.fujitsu.lcd_brightness'". All the available commands beginning with `sysctl hw.acpi.video.lcd.` still return the message "sysctl: unknown oid '<inputted oid>'".


----------



## T-Daemon (Dec 16, 2022)

After the i915 driver is loaded, is there a backlight device node created? Check `ls /dev/backlight`.



Kpist > Maskinpistol said:


> The command `sysctl hw.acpi.fujitsu.lcd_brightness` returns me "sysctl: unknown oid 'hw.acpi.fujitsu.lcd_brightness'". All the available commands beginning with `sysctl hw.acpi.video.lcd.` still return the message "sysctl: unknown oid '<inputted oid>'".


There must not necessarily be a sysctl(8) oid for brightness. I have a AMD 5700U integrated "Lucienne" GPU, which doesn't show those oids either. The amdgpu driver provided by graphics/drm-510-kmod, when loaded, creates a backlight device node, which can be configure with backlight(8).

If on your system no backlight device node is created then I'm out of ideas.


----------



## fbsd470 (Dec 17, 2022)

Not 100% sure about that, may be a number is missing behind 'lcd' in your sysctl commands.
Try `sysctl -a | grep lcd` and watch the output.

On my machine I see this:

```
# sysctl -a | grep lcd
hw.acpi.video.lcd0.levels: 100 100 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
hw.acpi.video.lcd0.economy: 30
hw.acpi.video.lcd0.fullpower: 30
hw.acpi.video.lcd0.brightness: 30
hw.acpi.video.lcd0.active: 0
```

To change brightness I can use `sysctl hw.acpi.video.lcd0.brightness=55`


----------



## Kpist > Maskinpistol (Dec 20, 2022)

I tried inputting `ls /dev/backlight` before and after loading the i915 driver, but the directory is non-existent. Executing the command `sysctl -a | grep lcd` doesn't result in any output; obviously resulting in the "unknown oid" error when trying `sysctl hw.acpi.video.lcd0.brightness=55`. 

Anyway, I wrote the lines:
kld_list="i915kms"
kld_list="acpi_video"
in the _/etc/rc.conf_ file. Shouldn't these drivers autoload whenever I start my machine then, or am I just mistaken? They work fine when I input the `kldload` commands to load them after booting, however. Probably not relevant to the matter at hand, but I wanted to know regardless.


----------



## cracauer@ (Dec 21, 2022)

Are the modules actually loaded?


```
kldstat | grep 915
kldstat | grep acpi
```


----------



## cracauer@ (Dec 21, 2022)

Kpist > Maskinpistol said:


> I tried inputting `ls /dev/backlight` before and after loading the i915 driver, but the directory is non-existent. Executing the command `sysctl -a | grep lcd` doesn't result in any output; obviously resulting in the "unknown oid" error when trying `sysctl hw.acpi.video.lcd0.brightness=55`.
> 
> Anyway, I wrote the lines:
> kld_list="i915kms"
> ...



You need to write it like this:

```
kld_list="i915kms acpi_video"
```


----------



## Kpist > Maskinpistol (Dec 21, 2022)

The modules are loaded. I checked with `kldstat`. Also, thank you cracauer@! The modules load automatically on startup every time now! In any case, I'm starting to wonder whether my graphics controller is actually supported by FreeBSD at all. Is there any way to really know for sure?


----------



## fbsd470 (Dec 22, 2022)

have a look here https://forums.freebsd.org/threads/laptop-setting-display-brightness.80524 for some additional hints.



> I'm starting to wonder whether my graphics controller is actually supported by FreeBSD at all.


Maybe the graphics card, but not the display?
You can post the result of `# dmesg` here, so some experts can analyze it.


----------



## smithi (Dec 24, 2022)

Kpist > Maskinpistol said:


> The command `pciconf -lv | grep -B3 display` tells me that the GPU is a "Mobile GM965/GL960 Integrated Graphics Controller". I successfully installed _drm-kmod_ and `pkg info -D drm-510-kmod` reports no errors. The line `kld_list="i915.kms"` is currently present in _/etc/rc.conf_.



OK.



Kpist > Maskinpistol said:


> Neither command `kldload acpi_video` nor `kldload acpi_fujitsu` results in any error being displayed (except the fact that they're already loaded or in kernel, of course).



Both of those need to be loaded before or while booting from /boot/loader.conf - refer mans acpi_video(4) and acpi_fujitsu(4).

Try the more inclusive way of checking sysctls: `sysctl -a | grep whatever` where whatever is video or lcd or bright or fujitsu ...



Kpist > Maskinpistol said:


> The command `sysctl hw.acpi.fujitsu.lcd_brightness` returns me "sysctl: unknown oid 'hw.acpi.fujitsu.lcd_brightness'". All the available commands beginning with `sysctl hw.acpi.video.lcd.` still return the message "sysctl: unknown oid '<inputted oid>'".



I suspect because of having kldload'd after boot.

You may need to use devd.conf and a script to map brightness keys, but first see if the fujitsu or video modules will work as is.

Also, use apropos(1) to hunt for manual pages .. e.g. that intel-backlight pkg installs intel_backlight(1), note underscore not dash.


----------

