Re: Suspend/Resume on Lenovo IdeaPad S400 with FreeBSD 10?

Ivan Rokotov <[email protected]>
Newsgroups gmane.os.freebsd.devel.mobile
Message-ID <CAOTTJKFPTTbg9GZv1Vvwc+RYRQXXYA2pk5Lr+Zid64gp3b4-9w@mail.gmail.com>
Hi Kevin,

Thank you for your useful suggestions. It took me several days to test
and debug everything. Here are my results:

2014-04-09 10:14 GMT+04:00 Kevin Oberman <[email protected]>:
> If you want to stay with syscon, try removing VESA from your kernel by
> adding "nodevice VESA" to your kernel.

Tried, changed nothing.

> vt has been MFCed to 10-STABLE, but it is not in 10.0-RELEASE. I believe
> that you can pull vt out of the STABLE repo and build in on RELEASE, but I'd
> suggest just moving to STABLE. I've been using it on my T320 with no issues
> for a couple of months.

Then I tried 10-STABLE, this build:
https://pub.allbsd.org/FreeBSD-snapshots/amd64-amd64/10.0-RELENG_10-r264300-JPSNAP/
Recompiled kernel to include vt and vt_vga.

With acpi_video and i915kms loaded from the console, suspend/resume works.

Under X, with a real Xfce4 environment:

* with xfwm4 windows manager, without any compositing effects,
everything works like a charm. All peripherals wake up, wifi
reconnects, mplayer continues playing video, etc.

* with xfwm4 and any compositing enabled, however, I got screen
corruption, like this:
http://i327.photobucket.com/albums/k477/ivan_rokotov_bsd/1_zps099b1f6d.png
or
http://i327.photobucket.com/albums/k477/ivan_rokotov_bsd/4_zps8ec8912e.png
This is not a big problem, because scrolling/typing inside the window
or simply moving a mouse over it solves the problem.

However, I need compiz (I like Mac-style tabbing) and some GL stuff
(e.g. asymptote). With compiz enabled, I get this horrible corruption:
http://i327.photobucket.com/albums/k477/ivan_rokotov_bsd/2_zpsd7564e4b.png
and no moving or switching to console help. No GL application starts.
I also found this in the X log after resume:

[  1173.617] (EE) intel(0): Failed to submit batch buffer, expect
rendering corruption: Device busy.
 (II) AIGLX: Suspending AIGLX clients for VT switch
[  1173.663] (WW) intel(0): drmDropMaster failed: Unknown error: -22
[  1177.289] (II) AIGLX: Resuming AIGLX clients after VT switch
[  1177.340] (II) intel(0): EDID vendor "CMN", prod id 5239
[  1177.340] (II) intel(0): Printing DDC gathered Modelines:
[  1177.340] (II) intel(0): Modeline "1366x768"x0.0   71.59  1366 1410
1439 1512  768 771 775 789 -hsync -vsync (47.3 kHz eP)

After some experimenting, I found this patch, which solved the problem
completely:
http://lists.freebsd.org/pipermail/freebsd-x11/2013-October/013727.html

Now, I have this in X log after resume:
[  4561.749] (WW) intel(0): retrying batchbuffer submit
[  4561.803] (WW) intel(0): retrying batchbuffer submit
[  4561.857] (WW) intel(0): retrying batchbuffer submit
[  4561.908] (WW) intel(0): retrying batchbuffer submit
[  4561.959] (WW) intel(0): retrying batchbuffer submit
[  4562.012] (WW) intel(0): retrying batchbuffer submit
[  4562.063] (WW) intel(0): retrying batchbuffer submit
[  4562.117] (WW) intel(0): retrying batchbuffer submit
[  4562.171] (WW) intel(0): retrying batchbuffer submit
[  4562.225] (WW) intel(0): retrying batchbuffer submit
[  4562.279] (WW) intel(0): retrying batchbuffer submit
[  4562.333] (WW) intel(0): retrying batchbuffer submit
[  4562.386] (WW) intel(0): retrying batchbuffer submit
[  4562.439] (WW) intel(0): retrying batchbuffer submit
[  4562.493] (WW) intel(0): retrying batchbuffer submit
[  4562.547] (WW) intel(0): retrying batchbuffer submit
[  4564.779] (II) AIGLX: Suspending AIGLX clients for VT switch
[  4564.779] (WW) intel(0): drmDropMaster failed: Unknown error: -22
[  4565.994] (II) AIGLX: Resuming AIGLX clients after VT switch
[  4566.096] (II) intel(0): EDID vendor "CMN", prod id 5239
[  4566.096] (II) intel(0): Printing DDC gathered Modelines:
[  4566.096] (II) intel(0): Modeline "1366x768"x0.0   71.59  1366 1410
1439 1512  768 771 775 789 -hsync -vsync (47.3 kHz eP)

but everything is alive: compiz restarts correctly, GL applications
work as they did before resume. Job done!

A question: is this patch ok? Nothing wrong with it? Do you or anybody
else experienced a similar problem and found a different solution?

> I also add:
> # Out : speaker + headphones
> hint.hdac.0.cad0.nid25.config="as=1 seq=15"
> # In : mic + external mic
> hint.hdac.0.cad0.nid35.config="as=2"
> hint.hdac.0.cad0.nid27.config="as=2 seq=15"

While we are here... I have:
hint.hdaa.0.nid20.config="as=1 seq=0 device=Speaker"
hint.hdaa.0.nid21.config="as=1 seq=15 device=Headphones"
hint.hdaa.0.nid18.config="as=3 seq=0 device=Mic"
hint.hdaa.0.nid24.config="as=3 seq=15 device=Mic"

"as=2" for your mic means anything special?

> # Minimize the number of interrupts from the sound card
> hint.pcm.0.buffersize=65536
> hint.pcm.1.buffersize=65536
> hw.snd.feeder_buffersize=65536
> hw.snd.latency=7

hw.snd.latency=7 is for reducing power consumption?

Thank you very much!
Ivan
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-mobile
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.