Re: Dell acpi_video patch

2012-10-17 Thread Alberto Villa
On Mon, Oct 15, 2012 at 5:12 PM, John Baldwin  wrote:
> Interesting.  Can you get an acpidump?

Sure:
http://people.FreeBSD.org/~avilla/files/avilla.asl.gz

I'd be glad to solve my problems with ACPI!
-- 
Alberto Villa, FreeBSD committer 
http://people.FreeBSD.org/~avilla
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to "freebsd-acpi-unsubscr...@freebsd.org"


Re: x220 notes

2012-10-17 Thread Ian Smith
On Tue, 16 Oct 2012, ???  wrote:

 > I set a lower light (5-6) during BIOS boot, and if needed I modify manually
 > in X. I monitored my CPU usage and did notice that the CPU takes its sweet
 > time to lower the frequency (Windows keeps the frequency the same 99.67,
 > but changes the multiplier from 8 to 32). I don't know if FreeBSD does that
 > or it only manipulates the frequency. The multiplier makes more sense.
 > Also, CPU cores in X stay at 50C. In Windows at no activicy they drop to
 > 44C and if no strenuous activity for a while, to 40C.
 > 
 > It would be great if FreeBSD could downgrade the frequency faster upon no
 > load. I use this:
 > powerd_flags="-a hiadaptive -b adaptive -i 85 -r 60 -p 100"

powerd(8) says:
 Adaptive mode attempts to strike a balance by degrading performance when
 the system appears idle and increasing it when the system is busy.  It
 offers a good balance between a small performance loss for greatly
 increased power savings.  Hiadaptive mode is like adaptive mode, but
 tuned for systems where performance and interactivity are more important
 than power consumption.  It increases frequency faster, reduces the fre-
 quency less aggressively and will maintain full frequency for longer.

So you want to use adaptive rather than hiadaptive, as power consumption 
is more important to you.  Also, -i probably should be lower than -r, as 
when load is less than 85% it will decrease frequency, but if it's then 
still higher than 60% powerd might kick it up again.  After experiments 
I wound up using "-a adp -b adp -i 50 -r 80 -p 200" which is nearer the 
defaults, but mine is only a two-speed P3 and not so indicative for you.

Best way is likely to stop powerd (service powerd stop) then run 'powerd 
-v ..' in a root terminal - maybe using script(1) to record results - 
and watch it dance under various sorts of load, with different -i and -r 
parameters.  You will clearly see the difference between adp and hadp.

 > I am always looking for the "perfect" FreeBSD laptop, but I guess it just
 > doesn't exist. And I do need my 7-8 hours of battery with wireless on. If
 > you guys have any suggestions on further optimizing the power usage and
 > automating the regulation, please let me know (like turning off and on USB
 > devices, spinning down the HDD, etc), also if you know about controlling
 > the multiplier instead of the frequency.

Adrian, true to form, has pounced on your wireless :)

I'm not a fan of spinning down HDs myself; if you do, you need to watch 
out for the dreaded Load Cycle Count issue (see ataidle(8)), and things 
like cron tasks that may spin it back up frequently.  This and very much 
more information on power saving by Alexander Motin - who most recently 
updated powerd and added eventtimers(4) to 9.X - in his excellent guide:

 http://wiki.freebsd.org/TuningPowerConsumption

As for the multiplier thing, it depends on which cpufreq(4) drivers your 
system is using.  If it's a Core 2 Duo or i{5,7}, then both voltage and 
frequency are controlled, frequency by changing multiplier I assume; you 
should look at the code used by your processor.  Also, don't miss advice 
there and elsewhere to disable throttling and just use est cpufreq(4) 
drivers, and for using C states to advantage.  Before and after doing 
all that, compare differences for:

% sysctl dev.cpu.0.freq_levels
% sysctl dev.cpu |grep cx

cheers, Ian
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to "freebsd-acpi-unsubscr...@freebsd.org"


X220 suspend/resume debugging on 10-CURRENT

2012-10-17 Thread Любомир Григоров
I decided to play around with suspend/resume on my X220 for a while and
here are my findings. I hope this helps to bring a solution to a working
suspend/resume in X220 (BTW it's reported as working correctly in X1).
Below my tests are also the relevant outputs of "dmesg", "devinfo -rv" and
"pciconf -clv".

- testing was done in console mode
$ uname -a
FreeBSD LGX 10.0-CURRENT FreeBSD 10.0-CURRENT #2: Tue Oct 9 11:37:31 PDT
2012 alakazam@LGX:/usr/obj/usr/src/sys/GENERIC amd64

- With acpi_ibm.ko unloaded, it suspends with "acpiconf -s 3"
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off.
- Keyboard works and I am able to "reboot"
- "kldload acpi_ibm" "kldload vesa" "kldload i915kms" do nothing

- With acpi_ibm.ko loaded, it suspends with "acpiconf -s 3"
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off
- Keyboard works and I am able to "reboot"
- "kldload vesa" "kldload i915kms" do nothing

- With acpi_ibm.ko loaded, "sysctl debug.acpi.suspend_bounce=1", it doesn't
suspend with  "acpiconf -s 3"
- Doesn't suspend
- Screen is on, but it's all black
 - Keyboard works and I am able to "reboot"
- "kldload vesa" "kldload i915kms" do nothing

- With acpi_ibm.ko and i915kms.ko loaded, it suspends with "acpiconf -s 3"
- Screen turns off after loading module, solution is to startx, but I am
not testing that.
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off
- "startx" turns on screen, but it's black with random line in top left.
- "kldload vesa" "kldload i915kms" do nothing



==
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #2: Tue Oct 9 11:37:31 PDT 2012
alakazam@LGX:/usr/obj/usr/src/sys/GENERIC amd64
WARNING: WITNESS option enabled, expect reduced performance.
CPU: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz (2491.97-MHz K8-class CPU)
Origin = "GenuineIntel" Id = 0x206a7 Family = 0x6 Model = 0x2a Stepping = 7
Features=0xbfebfbff
Features2=0x1fbae3ff
AMD Features=0x28100800
AMD Features2=0x1
TSC: P-state invariant, performance statistics
real memory = 17179869184 (16384 MB)
avail memory = 16408248320 (15648 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: 
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 SMT threads
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP): APIC ID: 3
ioapic0  irqs 0-23 on motherboard
kbd1 at kbdmux0
hpt27xx: RocketRAID 27xx controller driver v1.0 (Oct 9 2012 11:36:43)
ctl: CAM Target Layer loaded
acpi0:  on motherboard
acpi_ec0:  port 0x62,0x66 on acpi0
acpi0: Power Button (fixed)
acpi0: reservation of 0, a (3) failed
acpi0: reservation of 10, df90 (3) failed
cpu0:  on acpi0
cpu1:  on acpi0
cpu2:  on acpi0
cpu3:  on acpi0
attimer0:  port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0:  iomem 0xfed0-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 550
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Event timer "HPET3" frequency 14318180 Hz quality 440
Event timer "HPET4" frequency 14318180 Hz quality 440
atrtc0:  port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
acpi_lid0:  on acpi0
acpi_button0:  on acpi0
pcib0:  port 0xcf8-0xcff on acpi0
pci0:  on pcib0
vgapci0:  port 0x5000-0x503f mem
0xf000-0xf03f,0xe000-0xefff irq 16 at device 2.0 on pci0
agp0:  on vgapci0
agp0: aperture size is 256M, detected 65532k stolen memory
pci0:  at device 22.0 (no driver attached)
em0:  port 0x5080-0x509f mem
0xf250-0xf251,0xf252b000-0xf252bfff irq 20 at device 25.0 on pci0
em0: Using an MSI interrupt
em0: Ethernet address: f0:de:f1:dd:a2:6f
ehci0:  mem 0xf252a000-0xf252a3ff irq 16
at device 26.0 on pci0
usbus0: EHCI version 1.0
usbus0 on ehci0
hdac0:  mem 0xf252-0xf2523fff irq 22
at device 27.0 on pci0
pcib1:  irq 16 at device 28.0 on pci0
pci2:  on pcib1
pcib2:  irq 17 at device 28.1 on pci0
pci3:  on pcib2
iwn0:  mem 0xf240-0xf2401fff irq 17 at
device 0.0 on pci3
pcib3:  irq 19 at device 28.3 on pci0
pci5:  on pcib3
pcib4:  irq 16 at device 28.4 on pci0
pci13:  on pcib4
sdhci0:  mem 0xf140-0xf14000ff irq 16 at device 0.0 on pci13
sdhci0: 1 slot(s) allocated
ehci1:  mem 0xf2529000-0xf25293ff irq 23
at device 29.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci1
isab0:  at device 31.0 on pci0
isa0:  on isab0
ahci0:  port
0x50a8-0x50af,0x50bc-0x50bf,0x50a0-0x50a7,0x50b8-0x50bb,0x5060-0x507f mem
0xf2528000-0xf2528