[speedstep] Testers wanted

Bruno Ducrot ducrot at poupinou.org
Wed Nov 24 02:57:40 PST 2004


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.


More information about the freebsd-mobile mailing list