From owner-freebsd-mobile@FreeBSD.ORG Wed Nov 24 10:57:40 2004 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1DAA16A4CE for ; Wed, 24 Nov 2004 10:57:40 +0000 (GMT) Received: from poup.poupinou.org (poup.poupinou.org [195.101.94.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37B2943D48 for ; Wed, 24 Nov 2004 10:57:40 +0000 (GMT) (envelope-from ducrot@poupinou.org) Received: from ducrot by poup.poupinou.org with local (Exim) id 1CWuq5-0002rW-00; Wed, 24 Nov 2004 11:57:33 +0100 Date: Wed, 24 Nov 2004 11:57:33 +0100 To: plasma Message-ID: <20041124105733.GB5749@poupinou.org> References: <20041122100701.GE33509@bombur.guldan.demon.nl> <20041122121210.GA857@plasmanb.plasma.idv.tw> <20041122122827.GH33509@bombur.guldan.demon.nl> <20041122144407.GA821@plasmanb.plasma.idv.tw> <20041122184414.GL33509@bombur.guldan.demon.nl> <20041123065935.GB20758@plasmanb.plasma.idv.tw> <20041123093420.GB4353@poupinou.org> <20041123100834.GA72233@plasmanb.plasma.idv.tw> <20041123102712.GD4353@poupinou.org> <20041123121651.GA871@plasmanb.plasma.idv.tw> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041123121651.GA871@plasmanb.plasma.idv.tw> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Bruno Ducrot cc: freebsd-mobile@freebsd.org Subject: Re: [speedstep] Testers wanted X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2004 10:57:40 -0000 On Tue, Nov 23, 2004 at 08:16:51PM +0800, plasma wrote: > On Tue, Nov 23, 2004 at 11:27:12AM +0100, Bruno Ducrot wrote: > > There are some API in kernel in order to detect power profile changes > > (performance vs economy). When Nate will polish his cpufreq, this will > > be done in a generic way. But in the meantime, it may be helpfull to > > implement that in ichist so that we don't have to care about AC changes > > via acpi or apm. > > This sounds good! Should I just poll a sysctl variable periodically, > or ...? > It's finishedi but not tested (I don't have the hardware to play with). http://www.poupinou.org/cpufreq/bsd/ the tar ball is ichist.ugly_for_use_with_ichctrl.tar.gz There will be 3 new sysctl under dev.ichist.0, namely: profile: read only ac_profile: read write batt_profile: read write The values are the same as for ichctrl, that is: 0: min 1: adaptative 2: max for example, if 'ac_profile' is 2, at each time the kernel detect a power profile change (most time AC plug-in), then 'profile' will be updated to 2, and the processor will be put at the max frequency. For ichctrl, the only required stuff maybe is to modify the frequency only if 'profile' is set to 1. So the main loop should be something like this: for(;;) { sleep (...); if (get_profile() != 1) continue; ... ... } PS1: my laptop (AMD athlon-xp) do not detect correctly the AC adapter with ACPI under FreeBSD 5.3, but I'm pretty sure it worked before. I don't know why exactly. Also be sure to boot with '-v' so that you will see something like: system power profile changed to 'economy' system power profile changed to 'performance' in dmesg. If that not the case, then something is wrong with ACPI or APM. PS2: as the cpufreq interface from Nate will handle this more cleanly and should be independant of hardware hopefully, I have put this one as a different tar ball. -- Bruno Ducrot -- Which is worse: ignorance or apathy? -- Don't know. Don't care.