From owner-freebsd-current@FreeBSD.ORG Sat Jan 31 04:36:08 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 66C5B16A4CE for ; Sat, 31 Jan 2004 04:36:08 -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 3B85C43D46 for ; Sat, 31 Jan 2004 04:36:06 -0800 (PST) (envelope-from jim@thebadger.org) Received: (qmail 4337 invoked from network); 31 Jan 2004 13:35:03 -0000 Received: from unknown (HELO osts) (192.168.1.4) by 192.168.1.1 with SMTP; 31 Jan 2004 13:35:03 -0000 From: James Green To: Randy Bush In-Reply-To: References: <1075401074.2660.106.camel@mobius.int.thebadger.org> <1075418369.2662.170.camel@mobius.int.thebadger.org> Content-Type: text/plain Message-Id: <1075552112.2914.13.camel@mobius.int.thebadger.org> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 31 Jan 2004 12:28:32 +0000 Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org 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: Sat, 31 Jan 2004 12:36:08 -0000 Hi Randy, On Sat, 2004-01-31 at 05:33, Randy Bush 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... > > this helps a LOT. but ... > > i can suspend once and resume once. after that, it will not suspend > with lid or button. AFAIK, only acpiconf calls the rc.suspend and rc.resume scripts (please correct me if I am wrong!), so the above method only really works if you use acpiconf to suspend and the power switch to resume. I find it mostly works using acpiconf -s 1 to suspend, and then closing the lid. It resumes on lid switch open, but does not run rc.resume. I have also tried calling scripts from devd to process the lid switch events, however the rc.suspend scripts does not get called until after resume (and it seems after rc.resume!). I have not tried it yet, but it should be possible to call just rc.resume from devd for the lid switch open event only. James