From owner-freebsd-current@FreeBSD.ORG Thu Jan 29 16:58:01 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 650F016A4CE for ; Thu, 29 Jan 2004 16:58:01 -0800 (PST) Received: from bliss.thebadger.org (82-68-10-1.dsl.in-addr.zen.co.uk [82.68.10.1]) by mx1.FreeBSD.org (Postfix) with SMTP id 1B34D43D2F for ; Thu, 29 Jan 2004 16:57:59 -0800 (PST) (envelope-from jim@thebadger.org) Received: (qmail 2241 invoked from network); 30 Jan 2004 01:56:34 -0000 Received: from unknown (HELO osts) (192.168.1.4) by 192.168.1.1 with SMTP; 30 Jan 2004 01:56:34 -0000 From: James Green To: freebsd-current@freebsd.org In-Reply-To: <200401300113.49178.freebsd-current@webteckies.org> References: <1075401074.2660.106.camel@mobius.int.thebadger.org> <1075418369.2662.170.camel@mobius.int.thebadger.org> <200401300113.49178.freebsd-current@webteckies.org> Content-Type: text/plain Message-Id: <1075423821.2664.197.camel@mobius.int.thebadger.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 30 Jan 2004 00:50:21 +0000 Content-Transfer-Encoding: 7bit Subject: Re: API to turn off the display X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 00:58:01 -0000 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