Cannot change brightness on laptop (FreeBSD 13.1)

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!
 
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:
Code:
/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.
 
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>'".
 
After the i915 driver is loaded, is there a backlight device node created? Check ls /dev/backlight.

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.
 
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:
Code:
# 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
 
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.
 
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.

You need to write it like this:
Code:
kld_list="i915kms acpi_video"
 
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?
 
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.

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

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.
 
OK, I have to ask ....

why is controlling the brightness of the display so [...] difficult in command-line FreeBSD?

Why don't the function buttons on the keyboard just work?


dmesg:

% dmesg

---<<BOOT>>---
Copyright (c) 1992-2023 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 14.2-RELEASE releng/14.2-n269506-c8918d6c7412 GENERIC amd64
FreeBSD clang version 18.1.6 (https://github.com/llvm/llvm-project.git llvmorg-18.1.6-0-g1118c2e05e67)
VT(efifb): resolution 640x480
CPU: Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz (2494.37-MHz K8-class CPU)
Origin="GenuineIntel" Id=0x306c3 Family=0x6 Model=0x3c Stepping=3
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x7fdafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
AMD Features2=0x21<LAHF,ABM>
Structured Extended Features=0x27ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,NFPUSG>
Structured Extended Features3=0x9c000600<MCUOPT,MD_CLEAR,IBPB,STIBP,L1DFL,SSBD>
XSAVE Features=0x1<XSAVEOPT>
VT-x: (disabled in BIOS) PAT,HLT,MTF,PAUSE,EPT,UG,VPID
TSC: P-state invariant, performance statistics
real memory = 8589934592 (8192 MB)
avail memory = 8154963968 (7777 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <LENOVO TP-GM >
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-23
Launching APs: 1 2 3
random: entropy device external interface
kbd1 at kbdmux0
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
smbios0: <System Management BIOS> at iomem 0xdcd2e000-0xdcd2e01e
smbios0: Version: 2.7, BCD Revision: 2.7
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS>
acpi0: <LENOVO TP-GM>
acpi_ec0: <Embedded Controller: GPE 0x11, ECDT> port 0x62,0x66 on acpi0
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 550
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Event timer "HPET3" frequency 14318180 Hz quality 440
Event timer "HPET4" frequency 14318180 Hz quality 440
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1808-0x180b on acpi0
acpi_lid0: <Control Method Lid Switch> on acpi0
acpi_button0: <Sleep Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x4000-0x403f mem 0xf0000000-0xf03fffff,0xe0000000-0xefffffff irq 16 at device 2.0 on pci0
vgapci0: Boot video device
hdac0: <Intel Haswell HDA Controller> mem 0xf1630000-0xf1633fff at device 3.0 on pci0
xhci0: <Intel Lynx Point USB 3.0 controller> mem 0xf1620000-0xf162ffff at device 20.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Port routing mask set to 0xffffffff
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
pci0: <simple comms> at device 22.0 (no driver attached)
em0: <Intel(R) I217-LM LPT> port 0x4080-0x409f mem 0xf1600000-0xf161ffff,0xf163f000-0xf163ffff at device 25.0 on pci0
em0: EEPROM V0.13-3
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using an MSI interrupt
em0: Ethernet address: [redacted]
em0: netmap queues/slots: TX 1/1024, RX 1/1024
ehci0: <Intel Lynx Point USB 2.0 controller USB-B> mem 0xf163e000-0xf163e3ff at device 26.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
usbus1: 480Mbps High Speed USB v2.0
hdac1: <Intel Lynx Point HDA Controller> mem 0xf1634000-0xf1637fff at device 27.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <unknown> at device 0.0 (no driver attached)
pcib2: <ACPI PCI-PCI bridge> at device 28.1 on pci0
pci2: <ACPI PCI bus> on pcib2
pci2: <network> at device 0.0 (no driver attached)
pcib3: <ACPI PCI-PCI bridge> at device 28.2 on pci0
ehci1: <Intel Lynx Point USB 2.0 controller USB-A> mem 0xf163d000-0xf163d3ff at device 29.0 on pci0
usbus2: EHCI version 1.0
usbus2 on ehci1
usbus2: 480Mbps High Speed USB v2.0
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
ahci0: <Intel Lynx Point AHCI SATA controller> port 0x40a8-0x40af,0x40b4-0x40b7,0x40a0-0x40a7,0x40b0-0x40b3,0x4060-0x407f mem 0xf163c000-0xf163c7ff at device 31.2 on pci0
ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich5: <AHCI channel> at channel 5 on ahci0
ahciem0: <AHCI enclosure management bridge> on ahci0
acpi_tz0: <Thermal Zone> on acpi0
acpi_tz0: _CRT value is absurd, ignored (200.1C)
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
WARNING: Device "psm" is Giant locked and may be deleted before FreeBSD 15.0.
psm0: model Synaptics Touchpad, device ID 0
battery0: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
Timecounter "TSC-low" frequency 1247112566 Hz quality 1000
Timecounters tick every 1.000 msec
ugen0.1: <Intel XHCI root HUB> at usbus0
ugen1.1: <Intel EHCI root HUB> at usbus1
ugen2.1: <Intel EHCI root HUB> at usbus2
uhub0 on usbus0
uhub1 on usbus1
uhub1: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub0: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub2 on usbus2
uhub2: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
hdacc0: <Intel Haswell HDA CODEC> at cad 0 on hdac0
hdaa0: <Intel Haswell Audio Function Group> at nid 1 on hdacc0
pcm0: <Intel Haswell (HDMI/DP 8ch)> at nid 3 on hdaa0
hdacc1: <Realtek ALC292 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC292 Audio Function Group> at nid 1 on hdacc1
pcm1: <Realtek ALC292 (Analog 2.0+HP/2.0)> at nid 20,21 and 26 on hdaa1
pcm2: <Realtek ALC292 (Internal Analog Mic)> at nid 18 on hdaa1
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <ST98823AS 7.01> ATA-7 SATA 1.x device
ada0: Serial Number 3PK072Y4
ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 76319MB (156301488 512 byte sectors)
ses0 at ahciem0 bus 0 scbus2 target 0 lun 0
ses0: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
ses0: SEMB SES Device
ses0: ada0,pass0 in 'Slot 00', SATA Slot: scbus0 target 0
cd0 at ahcich5 bus 0 scbus1 target 0 lun 0
cd0: <HL-DT-ST DVDRAM GU90N LU20> Removable CD-ROM SCSI device
cd0: Serial Number M81E1944243
cd0: 150.000MB/s transfers (SATA 1.x, UDMA6, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed
ses0: cd0,pass1 in 'Slot 05', SATA Slot: scbus1 target 0
cam_periph_alloc: attempt to re-allocate valid device pass0 rejected flags 0 refcount 3
passasync: Unable to attach new device due to status 0x6: CCB request was invalid
cam_periph_alloc: attempt to re-allocate valid device ada0 rejected flags 0x100 refcount 2
adaasync: Unable to attach to new device due to status 0x6
Trying to mount root from zfs:zroot/ROOT/default []...
uhub0: 21 ports with 21 removable, self powered
uhub2: 3 ports with 3 removable, self powered
uhub1: 3 ports with 3 removable, self powered
Root mount waiting for: usbus0 usbus1 usbus2
ugen2.2: <vendor 0x8087 product 0x8000> at usbus2
uhub3 on uhub2
uhub3: <vendor 0x8087 product 0x8000, class 9/0, rev 2.00/0.04, addr 2> on usbus2
ugen1.2: <vendor 0x8087 product 0x8008> at usbus1
uhub4 on uhub1
uhub4: <vendor 0x8087 product 0x8008, class 9/0, rev 2.00/0.04, addr 2> on usbus1
uhub4: 6 ports with 6 removable, self powered
usb_alloc_device: set address 2 failed (USB_ERR_TIMEOUT, ignored)
uhub3: 8 ports with 8 removable, self powered
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
Root mount waiting for: usbus0
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored)
Root mount waiting for: usbus0
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
Root mount waiting for: usbus0
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored)
Root mount waiting for: usbus0
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
Root mount waiting for:usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored)
usbus0
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_req_re_enumerate: addr=2, set address failed! (USB_ERR_TIMEOUT, ignored)
Root mount waiting for: usbus0
Root mount waiting for: usbus0
usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
Root mount waiting for: usbus0
ugen0.2: <SunplusIT INC. Integrated Camera> at usbus0
Intel(R) Wireless WiFi based driver for FreeBSD
ichsmb0: <Intel Lynx Point SMBus controller> port 0xefa0-0xefbf mem 0xf1638000-0xf16380ff at device 31.3 on pci0
smbus0: <System Management Bus> on ichsmb0
rtsx0: <2.1g Realtek RTS5227 PCIe SD Card Reader> mem 0xf1500000-0xf1500fff at device 0.0 on pci1
rtsx0: No card is detected
iwm0: <Intel(R) Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff at device 0.0 on pci2
iwm0: hw rev 0x140, fw ver 17.352738.0, address [redacted]
acpi_wmi0: <ACPI-WMI mapping> on acpi0
acpi_wmi0: Embedded MOF found
ACPI: \134_SB.WMI1.WQBA: 1 arguments were passed to a non-method ACPI object (Buffer) (20221020/nsarguments-361)
acpi_wmi1: <ACPI-WMI mapping> on acpi0
acpi_wmi1: Embedded MOF found
ACPI: \134_SB.WMI2.WQBB: 1 arguments were passed to a non-method ACPI object (Buffer) (20221020/nsarguments-361)
acpi_wmi2: <ACPI-WMI mapping> on acpi0
acpi_wmi2: Embedded MOF found
ACPI: \134_SB.WMI3.WQBC: 1 arguments were passed to a non-method ACPI object (Buffer) (20221020/nsarguments-361)
wlan0: Ethernet address: [redacted]
lo0: link state changed to UP
wlan0: link state changed to UP
 
Or you could contribute your code?
If it was that simple to do, and support so many hardware variants, it would be done. Or you could contribute your code?

So, you think the FreeBSD team only seems to solve simple problems?

I have to ask --- Is that really what you want to assert.

In my experience, the FreeBSD team has risen to amazing peaks in their solutions to complex problems

But there does seem to be a screen brightness problem (command-line problem) that has raised many questions on this forum.

And, posting the dmesg of my laptop, I tried to provide more information to resolve the problem.
 
Simple solution: write a small script that increases/decreases brighness and assing it to whatever key you like. It takes 5 minutes at most, I did that. Definitely less time that writing a couple of posts on a forum.
 
> Simple solution: write a small script that increases/decreases brighness

I have written many scripts that help me keep my FreeBSD servers running. I am not adverse to writing and running scripts. I have done that for my FreeBSD servers for a couple decades.

So, I guess my question would be....

What is the command, and its parameters, that I should put in that script?

thx.
 
Back
Top