Bug 76217

Summary: xbacklight does not work properly after modifying PWM modulation frequency
Product: DRI Reporter: janus
Component: DRM/IntelAssignee: Rodrigo Vivi <rodrigo.vivi>
Status: CLOSED INVALID QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs, janus
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Output of lspci, uname, xrandr, and package versions none

Description janus 2014-03-15 21:18:33 UTC
Created attachment 95875 [details]
Output of lspci, uname, xrandr, and package versions

I have a LED panel with a intel graphic card using the i915 module.

In this model, to avoid flickering of the screen, the Arch wiki[1] recommends to change the PWM modulation frequency, following this calculator [2].

In my case, I had to change the register 0xC8254 from its original value 0xD9C0D9C to 0x5730573 in order to have a PWM frequency of 700 Hz.

After I do the change, through the command
intel_reg_write 0xC8254 0x5730573
(part of the Intel GPU tools [3])
xbacklight start to behave wrong.

For example:
$ xbacklight -get
20.005741
$ xbacklight -set 30
$ xbacklight -get
11.997704
$ xbacklight -set 100
$ xbacklight -get
40.040184

The bight is modifyied according to the -set parameter, but then it detects that 40.040184 is the 100% (you can see that 30% of this value is aproximately the 11.997704 that I get before, and so on).

In addition, -inc and -dec do not work properly.
For examle:
$ xbacklight -get
20.005741
$ xbacklight -inc 10
$ xbacklight -get
11.997704
(and the bight when down).

I tried also by echoing directly to /sys/class/backlight/intel_backlight/brightness, with similar results:
 # cat /sys/class/backlight/intel_backlight/max_brightness
3484
# echo 3484 > /sys/class/backlight/intel_backlight/brightness
# cat /sys/class/backlight/intel_backlight/brightness
1395
# echo 2000 > /sys/class/backlight/intel_backlight/brightness
 # cat /sys/class/backlight/intel_backlight/brightness
800

I attach the output of some commands to identify my hardware. I am on an up-to-date Arch Linux, and the computer is an HP 9470m.

References:
[1] https://wiki.archlinux.org/index.php/backlight#Backlight_PWM_modulation_frequency_.28Intel_i915_only.29
[2] http://devbraindom.blogspot.fr/2013/03/eliminate-led-screen-flicker-with-intel.html
[3] http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/
Comment 1 Jani Nikula 2014-03-17 07:37:54 UTC
(In reply to comment #0)
> In my case, I had to change the register 0xC8254 from its original value
> 0xD9C0D9C to 0x5730573 in order to have a PWM frequency of 700 Hz.
> 
> After I do the change, through the command
> intel_reg_write 0xC8254 0x5730573
> (part of the Intel GPU tools [3])
> xbacklight start to behave wrong.

This is a debugging tool. All bets are off if you fiddle with the registers directly. We do not support this.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.