You are not logged in.
Hi all.
Not so long ago I was discussing how to prevent laptop display from flickering
https://bbs.archlinux.org/viewtopic.php?id=159817
Solution for this issue was to run a command that changes values of certain registers in intel display adapter.
It appeared that after screen goes off and then on, default settings are applied, so I need to re-run that command each time I go away and my screen turns off.
So, I'm wondering, whether there are ways to get notification about <DPMS on> event (some DPMS hooks, watching for some file in sysfs...).
Thanks in advance for any help.
Cheers.
Last edited by eDio (2014-08-03 11:49:38)
Offline
The way I've seen people do it is making a script run in the background that parses the output of "xset -q".
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline
Thanks for your suggestion.
I also noticed, that my sysfs has file
/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/dpmswhichs content shows current display status (On | Off | Suspend | Standby).
So, my idea was to watch over that file with inotify with incron, however, it seems that file doesn't generate inotify events and thus can't be watched.
Perhaps, I'll end up with a script that polls this file periodically.
Offline
From lde-workspace-4.11.10/powerdevil/daemon/actions/bundled/dimdisplay.cpp:
//Some drivers report brightness == 0 when display is off because of DPMS
//(especially Intel driver). Don't change brightness in this case, or
//backlight won't switch on later.It doesn't really seem any cleaner than polling the file repeatedly, but what you could do is use a udev rule to touch a file when the brightness gets set to zero (like with DPMS) and run a script that will remove the touched file and run whatever command you wanted when the brightness gets set to something greater than zero and the lock file still exists.
KERNEL!="intel_backlight", SUBSYSTEM!="backlight", ACTION!="change", GOTO="backlight_pwm_rules_end"
TEST=="/tmp/change-pwm", ATTR{brightness}!="0", RUN="[path to your script here]", GOTO="backlight_pwm_rules_end"
ATTR{brightness}=="0", RUN="/usr/bin/touch /tmp/change-pwm"
LABEL="backlight_pwm_rules_end"Offline
Thanks for the suggestion, qwerty12. I'll try this on weekend. Currently can't play with laptop.
Offline
qwerty12, thanks for your suggestion again. I've just checked it and it worked like a charm.
Created AUR package for this
https://aur.archlinux.org/packages/intelpwm-udev/
Last edited by eDio (2014-08-03 13:39:00)
Offline
Seems, that brightness is no longer set to 0, thus rule won't work.
Also seems, that registers are not reset on dpms force off.
However, registers are still reset on suspend. Thus simple systemd service is enough to fix that
[Unit]
Description=Restore intelpwm settings on resume
After=suspend.target
[Service]
User=root
Type=oneshot
ExecStart=/usr/bin/intelpwm
TimeoutSec=0
StandardOutput=syslog
[Install]
WantedBy=suspend.targetCould anyone interested confirm my observations? If others observe the same, I could update AUR package.
Offline