I have used the
intel_reg write command seen in that Arch Linux wiki page to alter the backlight frequency on my laptop (this is what I was referring to when I said you can set higher frequencies ).
The relevant register is a documented feature in the Intel Programmer’s Reference Manuals for the hardware, so it should allow you to set different values. (The precise register address might vary between hardware generations, so it’s probably worth searching the PRM PDFs for instances of “backlight” if you have different hardware. 0x8254 is correct for 2015-2016 Skylake at least.)
The value you set persists until the GPU is next reset, so it goes back to the default if you suspend or shut down the system. It’s not permanent, hence the workarounds using udev to make it faux-permanent.
While the register value for the frequency can be set to anything between 3Hz and 187500Hz on my Clevo, there are hardware design considerations to take into account, about which I can only speculate and make semi-educated guesses:
- To achieve PWM, the backlight drive current will, at some point or another, be being switched on and off by one or more transistors. Transistors perform differently at different frequencies and different ones are optimised for different operating frequencies. There’s a good chance that boosting the frequency will cause a transistor to get warmer than usual.
- There might be inductors or capacitors in the circuit which were validated for a particular frequency. They could make the circuit unstable at dramatically different frequencies.
- There might even be a microcontroller or two between the GPU and the transistor. That will have its own frequency limitations.
- Intel probably didn’t design their GPU for the specific components that are in any one laptop, so they couldn’t limit the frequency to only allow values that are sensible for the actual hardware.
I’d say it’s reasonably safe to cautiously experiment (gradually changing the frequency in small steps), but if anything weird happens you might want to back off.
Experimentally, on my non-Librem hardware, I found that:
- The default was approximately 200Hz.
- My backlight would not work at all below about 50Hz. (Black, unilluminated screen.)
- I was able to set it to 18750Hz, but after about fifteen minutes running at that frequency it started flickering in a glitchy, slightly erratic manner, as though it was going to fail.
- I had the same problem at 9375Hz, except it lasted a bit longer before it started flickering.
- 4687.5Hz created an audible noise (like coil whine) and lasted even longer, but still eventually flickered.
- 2347.75Hz seemed fairly reliable (and didn’t make an audible noise).
- High frequencies only caused problems at less than 100% brightness. (Which makes sense, because 100% is just constant “on” at any frequency.)
I don’t have the nerve to try setting it to 187500Hz!
Of course, these are results for a different laptop, not a Librem. A Librem may perform similarly, or differently.
If I’d persisted with an altered frequency, I would have needed a workaround to enable me to adjust the brightness, since the standard brightness controls assumed the original PWM frequency. Adjusting the brightness using the keyboard or power management system caused a duty cycle to be set in the register that didn’t take account of the modified frequency.
The duty cycle value in the register needs to be between 0 and the PWM period that’s been set in the other 4 bits of the register. So, if you increase the PWM frequency by a factor of 10, but the brightness control continues setting the same duty cycles it always has, then anything above 10% brightness actually gives you 100% brightness (with 5% giving 50%, and so on). I never got as far as figuring out how to fix that, though it’s trivial to adjust the brightness by setting the appropriate duty cycle in the register.