Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 2004 00:50:21 +0000
From:      James Green <jim@thebadger.org>
To:        freebsd-current@freebsd.org
Subject:   Re: API to turn off the display
Message-ID:  <1075423821.2664.197.camel@mobius.int.thebadger.org>
In-Reply-To: <200401300113.49178.freebsd-current@webteckies.org>
References:  <1075401074.2660.106.camel@mobius.int.thebadger.org> <bvbnk1$56h$1@sea.gmane.org> <1075418369.2662.170.camel@mobius.int.thebadger.org> <200401300113.49178.freebsd-current@webteckies.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2004-01-30 at 00:13, Melvyn Sopacua wrote:
> On Friday 30 January 2004 00:19, James Green wrote:
> 
> > Recompiled the kernel with:
> > options SC_NO_SUSPEND_VTYSWITCH
> >
> > and now it all works!
> >
> > I added to rc.suspend:
> >
> > xset -display :0 dpms force off
> > sleep 3
> > sysctl hw.acpi.video.lcd0.active=0
> > sleep 1
> > sysctl hw.acpi.cpu.throttle_state=1
> >
> > and to rc.resume:
> >
> > sysctl hw.acpi.cpu.throttle_state=8
> > xset -display :0 dpms force on
> > sysctl hw.acpi.video.lcd0.active=1
> >
> > The order of DPMS and ACPI is important. This works on both the console
> > and in X. Next up is to add in ataidle...
> 
> Thanx very much for working this out. Does this only work when running xdm or 
> variants thereof? I boot into console and 'startx', in a KDE 3.2 Konsole 
> running the xset/dpms command doesn't yield any results.

It should work in both. (I run X via both gdm and startx) It will also
work from the console when X is not running as the xset commands just
timeout. The DPMS calls stop it from screwing up your display in X.

Try 'xset dpms force off' as the user you are logged in as (i.e. not
root) If that does not turn off the display but blanks it, you probably
need to look at drivers for Xfree that fully support DPMS for your card.
If you have a radeon 9000, you can either patch the driver
(http://bugs.xfree86.org/show_bug.cgi?id=26) or use 
ports/x11-servers/XFree86-4-Server-snap/

Once this works, you just need to get yourself setup so that root can
call the dpms force off. If 'xset -display :0 dpms force off' gives you
Xlib errors as root, try 'startx -listen_tcp' (as your normal user) and
then 'xhost +localhost' once X is running - should let you run 'xset
-display :0 dpms force off' as root to turn off the display. 
I am sure there is a better way of doing this, but this does work.

James





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1075423821.2664.197.camel>