All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004-hi6Y0CQ0nG0@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Matthias Hentges
	<mailinglisten-H4PcyxPeSRnR7s880joybQ@public.gmane.org>,
	Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
Subject: Re: Re: Samsung P35 and S3 suspend
Date: Tue, 21 Dec 2004 01:39:43 +0100	[thread overview]
Message-ID: <41C770CF.1020408@gmx.net> (raw)
In-Reply-To: <41C7374D.6090407-hi6Y0CQ0nG0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

PROBLEM SOLVED COMPLETELY! Read on for details (and excuse the yelling)
;-)

Search engine hint: Samsung P30 P35 S3 suspend resume

Carl-Daniel Hailfinger schrieb:
> Matthew Garrett schrieb:
> 
>>On Thu, 2004-12-16 at 19:41 +0100, Matthias Hentges wrote:
>>
>>
>>
>>>1: VGA POST
>>>2. VESA reset
>>
>>
>>Can you try the vm86_video_post and vbestate programs from
>>http://www.srcf.ucam.org/~mjg59/laptops/ ? You want to do something like
>>this:
>>
>>1) chvt away from X on suspend
>>2) vbestate save >/tmp/state
>>3) suspend
>>4) resume
>>5) vm86_video_post
>>6) vbestate restore </tmp/state
>>7) chvt back to X
>>
>>This sequence (possibly with a dpms on in there somewhere) seems to work
>>on a fairly large number of machines.
> 
> 
> It sort of works. Before step 7, the (text mode) display contains garbage.

OK, I have a patch for vbestate which allows resume back to a text console
(no X server involved at all) and you should have clean fonts and usable
text console afterwards. The screen needs to be redrawn and Unicode fonts
have to be reloaded, but that can be handled, too.

The following script makes S3 from text console and/or X a breeze:

#!/bin/bash
statedir=/root/s3/state
curcons=`fgconsole`
fuser /dev/tty$curcons 2>/dev/null|xargs ps -o comm= -p|grep -q X && chvt 2
cat /dev/vcsa >$statedir/vcsa
sync
echo 3 >/proc/acpi/sleep
sync
vm86_video_post
vbestate restore <$statedir/vbe.5
cat $statedir/vcsa >/dev/vcsa
rckbd restart
chvt $[curcons%6+1]
chvt $curcons

IMPORTANT NOTES:
$statedir/vbe should be saved directly after bootup before entering X. It
only has to be saved once, you can use it for every situation afterwards.
That includes new boots, having switched from X to console, etc.
vbestate has to be patched with my patch to work correctly.
The script assumes that no harmful modules are loaded.
The kernel was 2.6.10-rc3 or later and had to be patched with
pci-resume-2.6.10.patch and resume-finish-split.patch.
.config available on request (see earlier in this thread for details).
You don't need a patched X for this to work.

With the above script my machine survived 32 iterations of S3 suspend
without any visible problems (no screen corruption, no freezes, even
umlauts are preserved). Sometimes I was in X, sometimes working on the
text console and it came back every time to the console I had used,
screen contents exactly the same as before.

Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

[-- Attachment #2: vbestate-s3.diff --]
[-- Type: text/plain, Size: 778 bytes --]

diff -urN vbestate-0.1/vbestate.c vbestate-0.1-s3/vbestate.c
--- vbestate-0.1/vbestate.c	2004-12-09 00:42:51.000000000 +0100
+++ vbestate-0.1-s3/vbestate.c	2004-12-21 01:37:06.132044112 +0100
@@ -119,6 +119,9 @@
 		short tmpbuffer[524288];
 		size_t i,length=0;
 		
+		/* The loop below doesn't make any sense unless we think our
+		input data contains length/sizeof(tmpbuffer)*sizeof(tmpbuffer)
+		bytes of leading garbage */
 		while (i=read(0, tmpbuffer, sizeof(tmpbuffer))) {
 			length+=i;
 		}
@@ -127,6 +130,12 @@
 		memcpy(data,tmpbuffer,length);
 
 		restore_state(data);
+		text_mode();
+
+		data = LRMI_alloc_real(length);
+		memcpy(data,tmpbuffer,length);
+
+		restore_state(data);
 	} else {
 		fprintf(stderr,"%s: Usage %s [save|restore]\n",
 			argv[0],argv[0]);

  parent reply	other threads:[~2004-12-21  0:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-15  4:55 Samsung P35 and S3 suspend Carl-Daniel Hailfinger
     [not found] ` <41BFC3AD.5030001-hi6Y0CQ0nG0@public.gmane.org>
2004-12-15 13:28   ` Matthias Hentges
2004-12-15 17:59     ` Carl-Daniel Hailfinger
     [not found]       ` <41C07B6F.70900-hi6Y0CQ0nG0@public.gmane.org>
2004-12-16  1:03         ` Matthias Hentges
2004-12-16  3:24           ` Carl-Daniel Hailfinger
     [not found]             ` <41C0FFF3.4010902-hi6Y0CQ0nG0@public.gmane.org>
2004-12-16 14:29               ` Carl-Daniel Hailfinger
     [not found]                 ` <41C19BD8.7050201-hi6Y0CQ0nG0@public.gmane.org>
2004-12-16 17:32                   ` Stefan Dösinger
     [not found]                     ` <200412161832.09711.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-12-16 18:28                       ` Carl-Daniel Hailfinger
     [not found]                         ` <41C1D3CB.5010805-hi6Y0CQ0nG0@public.gmane.org>
2004-12-16 20:57                           ` Stefan Dösinger
     [not found]                             ` <200412162157.02741.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-12-16 21:10                               ` Matthew Garrett
2004-12-16 21:26                                 ` Stefan Dösinger
     [not found]                                   ` <200412162226.43166.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-12-16 21:42                                     ` Matthew Garrett
2004-12-17  0:25                               ` Carl-Daniel Hailfinger
     [not found]                                 ` <41C22792.2000205-hi6Y0CQ0nG0@public.gmane.org>
2004-12-17 15:49                                   ` Stefan Dösinger
     [not found]                                     ` <200412171649.08125.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-12-20 18:12                                       ` Carl-Daniel Hailfinger
2004-12-16 18:10                   ` Carl-Daniel Hailfinger
     [not found]                     ` <41C1CFA2.20304-hi6Y0CQ0nG0@public.gmane.org>
2004-12-16 18:41                       ` Matthias Hentges
2004-12-16 19:09                         ` Matthew Garrett
2004-12-20 20:34                           ` Carl-Daniel Hailfinger
     [not found]                             ` <41C7374D.6090407-hi6Y0CQ0nG0@public.gmane.org>
2004-12-21  0:39                               ` Carl-Daniel Hailfinger [this message]
2004-12-22  2:06                       ` Carl-Daniel Hailfinger
2004-12-22  2:06                         ` [ACPI] " Carl-Daniel Hailfinger
     [not found]                         ` <41C8D689.3020502-hi6Y0CQ0nG0@public.gmane.org>
2004-12-22 11:37                           ` Johan Vromans
     [not found]                             ` <m2zn067edh.fsf-KjnUIgV0B0bak1Ioo/c9IoRWq/SkRNHw@public.gmane.org>
2004-12-22 15:35                               ` Carl-Daniel Hailfinger
     [not found]                                 ` <41C9945E.9080101-hi6Y0CQ0nG0@public.gmane.org>
2004-12-26 12:13                                   ` Pavel Machek
     [not found]                                     ` <20041226121316.GA1590-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-26 14:43                                       ` Stefan Dösinger
     [not found]                                         ` <20041226194039.GC1739@elf.ucw.cz>
     [not found]                                           ` <20041226194039.GC1739-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-12-30 21:39                                             ` PATCH: Call acpi_leave_sleep_state before resuming devices Stefan Dösinger
2004-12-27  1:43 Re: Samsung P35 and S3 suspend Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575D82398-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-12-27 12:18   ` Stefan Dösinger
     [not found]     ` <200412271318.32251.stefandoesinger-RbZlAiThDcE@public.gmane.org>
2004-12-28  2:12       ` Li Shaohua
2004-12-27  2:08 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575D823DC-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-12-27 11:51   ` Stefan Dösinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41C770CF.1020408@gmx.net \
    --to=c-d.hailfinger.kernel.2004-hi6y0cq0ng0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=mailinglisten-H4PcyxPeSRnR7s880joybQ@public.gmane.org \
    --cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.