blob: 912bed87c758457b2f42b6decb1964326efce3de [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2 Video issues with S3 resume
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 2003-2005, Pavel Machek
5
6During S3 resume, hardware needs to be reinitialized. For most
7devices, this is easy, and kernel driver knows how to do
8it. Unfortunately there's one exception: video card. Those are usually
9initialized by BIOS, and kernel does not have enough information to
10boot video card. (Kernel usually does not even contain video card
11driver -- vesafb and vgacon are widely used).
12
13This is not problem for swsusp, because during swsusp resume, BIOS is
Pavel Machek36fabc22005-11-07 00:58:39 -080014run normally so video card is normally initialized. It should not be
15problem for S1 standby, because hardware should retain its state over
16that.
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18There are a few types of systems where video works after S3 resume:
19
20(1) systems where video state is preserved over S3.
21
22(2) systems where it is possible to call the video BIOS during S3
23 resume. Unfortunately, it is not correct to call the video BIOS at
24 that point, but it happens to work on some machines. Use
25 acpi_sleep=s3_bios.
26
27(3) systems that initialize video card into vga text mode and where
28 the BIOS works well enough to be able to set video mode. Use
29 acpi_sleep=s3_mode on these.
30
31(4) on some systems s3_bios kicks video into text mode, and
32 acpi_sleep=s3_bios,s3_mode is needed.
33
34(5) radeon systems, where X can soft-boot your video card. You'll need
Pavel Macheka4ffad52005-04-16 15:25:34 -070035 a new enough X, and a plain text console (no vesafb or radeonfb). See
36 http://www.doesi.gmxhome.de/linux/tm800s3/s3.html for more information.
37 Alternatively, you should use vbetool (6) instead.
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39(6) other radeon systems, where vbetool is enough to bring system back
40 to life. It needs text console to be working. Do vbetool vbestate
41 save > /tmp/delme; echo 3 > /proc/acpi/sleep; vbetool post; vbetool
42 vbestate restore < /tmp/delme; setfont <whatever>, and your video
43 should work.
44
45(7) on some systems, it is possible to boot most of kernel, and then
46 POSTing bios works. Ole Rohne has patch to do just that at
47 http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2.
48
Pavel Machek7e958882005-09-03 15:56:56 -070049(8) on some systems, you can use the video_post utility mentioned here:
50 http://bugzilla.kernel.org/show_bug.cgi?id=3670. Do echo 3 > /sys/power/state
51 && /usr/sbin/video_post - which will initialize the display in console mode.
52 If you are in X, you can switch to a virtual terminal and back to X using
53 CTRL+ALT+F1 - CTRL+ALT+F7 to get the display working in graphical mode again.
54
Linus Torvalds1da177e2005-04-16 15:20:36 -070055Now, if you pass acpi_sleep=something, and it does not work with your
56bios, you'll get a hard crash during resume. Be careful. Also it is
57safest to do your experiments with plain old VGA console. The vesafb
58and radeonfb (etc) drivers have a tendency to crash the machine during
59resume.
60
61You may have a system where none of above works. At that point you
62either invent another ugly hack that works, or write proper driver for
63your video card (good luck getting docs :-(). Maybe suspending from X
64(proper X, knowing your hardware, not XF68_FBcon) might have better
65chance of working.
66
Pavel Machek36fabc22005-11-07 00:58:39 -080067Table of known working notebooks:
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69Model hack (or "how to do it")
70------------------------------------------------------------------------------
71Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI
72Acer TM 242FX vbetool (6)
Pavel Machek7e958882005-09-03 15:56:56 -070073Acer TM C110 video_post (8)
74Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075Acer TM 4052LCi s3_bios (2)
Pavel Machek36fabc22005-11-07 00:58:39 -080076Acer TM 636Lci s3_bios,s3_mode (4)
Linus Torvalds1da177e2005-04-16 15:20:36 -070077Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back
78Acer TM 660 ??? (*)
79Acer TM 800 vga=normal, X patches, see webpage (5) or vbetool (6)
80Acer TM 803 vga=normal, X patches, see webpage (5) or vbetool (6)
81Acer TM 803LCi vga=normal, vbetool (6)
82Arima W730a vbetool needed (6)
83Asus L2400D s3_mode (3)(***) (S1 also works OK)
Pavel Macheka4ffad52005-04-16 15:25:34 -070084Asus L3350M (SiS 740) (6)
Linus Torvalds1da177e2005-04-16 15:20:36 -070085Asus L3800C (Radeon M7) s3_bios (2) (S1 also works OK)
Pavel Macheka4ffad52005-04-16 15:25:34 -070086Asus M6887Ne vga=normal, s3_bios (2), use radeon driver instead of fglrx in x.org
Linus Torvalds1da177e2005-04-16 15:20:36 -070087Athlon64 desktop prototype s3_bios (2)
88Compal CL-50 ??? (*)
89Compaq Armada E500 - P3-700 none (1) (S1 also works OK)
90Compaq Evo N620c vga=normal, s3_bios (2)
91Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1
92Dell D600, ATI RV250 vga=normal and X, or try vbestate (6)
Pavel Machek2a962062005-06-25 14:55:18 -070093Dell D610 vga=normal and X (possibly vbestate (6) too, but not tested)
Linus Torvalds1da177e2005-04-16 15:20:36 -070094Dell Inspiron 4000 ??? (*)
95Dell Inspiron 500m ??? (*)
Pavel Machek2a962062005-06-25 14:55:18 -070096Dell Inspiron 510m ???
Linus Torvalds1da177e2005-04-16 15:20:36 -070097Dell Inspiron 600m ??? (*)
98Dell Inspiron 8200 ??? (*)
99Dell Inspiron 8500 ??? (*)
100Dell Inspiron 8600 ??? (*)
101eMachines athlon64 machines vbetool needed (6) (someone please get me model #s)
102HP NC6000 s3_bios, may not use radeonfb (2); or vbetool (6)
103HP NX7000 ??? (*)
104HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X
105HP Omnibook XE3 athlon version none (1)
106HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV
107IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work.
108IBM TP A31 / Type 2652-M5G s3_mode (3) [works ok with BIOS 1.04 2002-08-23, but not at all with BIOS 1.11 2004-11-05 :-(]
109IBM TP R32 / Type 2658-MMG none (1)
110IBM TP R40 2722B3G ??? (*)
111IBM TP R50p / Type 1832-22U s3_bios (2)
Pavel Macheka4ffad52005-04-16 15:25:34 -0700112IBM TP R51 none (1)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113IBM TP T30 236681A ??? (*)
114IBM TP T40 / Type 2373-MU4 none (1)
115IBM TP T40p none (1)
116IBM TP R40p s3_bios (2)
117IBM TP T41p s3_bios (2), switch to X after resume
Pavel Macheka4ffad52005-04-16 15:25:34 -0700118IBM TP T42 s3_bios (2)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119IBM ThinkPad T42p (2373-GTG) s3_bios (2)
120IBM TP X20 ??? (*)
Pavel Macheka4ffad52005-04-16 15:25:34 -0700121IBM TP X30 s3_bios (2)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
Pavel Machekd7ae79c2005-09-06 15:16:21 -0700123IBM TP X32 none (1), but backlight is on and video is trashed after long suspend
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
125Medion MD4220 ??? (*)
126Samsung P35 vbetool needed (6)
127Sharp PC-AR10 (ATI rage) none (1)
Pavel Machek374a6cf2005-07-07 17:59:33 -0700128Sony Vaio PCG-C1VRX/K s3_bios (2)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129Sony Vaio PCG-F403 ??? (*)
130Sony Vaio PCG-N505SN ??? (*)
131Sony Vaio vgn-s260 X or boot-radeon can init it (5)
132Toshiba Libretto L5 none (1)
133Toshiba Satellite 4030CDT s3_mode (3)
134Toshiba Satellite 4080XCDT s3_mode (3)
135Toshiba Satellite 4090XCDT ??? (*)
136Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****)
Pavel Machek2a962062005-06-25 14:55:18 -0700137Toshiba M30 (2) xor X with nvidia driver using internal AGP
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138Uniwill 244IIO ??? (*)
139
Pavel Machek36fabc22005-11-07 00:58:39 -0800140Known working desktop systems
141~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
143Mainboard Graphics card hack (or "how to do it")
144------------------------------------------------------------------------------
145Asus A7V8X nVidia RIVA TNT2 model 64 s3_bios,s3_mode (4)
146
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147
148(*) from http://www.ubuntulinux.org/wiki/HoaryPMResults, not sure
149 which options to use. If you know, please tell me.
150
151(***) To be tested with a newer kernel.
152
153(****) Not with SMP kernel, UP only.
154
155VBEtool details
156~~~~~~~~~~~~~~~
157(with thanks to Carl-Daniel Hailfinger)
158
159First, boot into X and run the following script ONCE:
160#!/bin/bash
161statedir=/root/s3/state
162mkdir -p $statedir
163chvt 2
164sleep 1
165vbetool vbestate save >$statedir/vbe
166
167
168To suspend and resume properly, call the following script as root:
169#!/bin/bash
170statedir=/root/s3/state
171curcons=`fgconsole`
172fuser /dev/tty$curcons 2>/dev/null|xargs ps -o comm= -p|grep -q X && chvt 2
173cat /dev/vcsa >$statedir/vcsa
174sync
175echo 3 >/proc/acpi/sleep
176sync
177vbetool post
178vbetool vbestate restore <$statedir/vbe
179cat $statedir/vcsa >/dev/vcsa
180rckbd restart
181chvt $[curcons%6+1]
182chvt $curcons
183
184
185Unless you change your graphics card or other hardware configuration,
186the state once saved will be OK for every resume afterwards.
187NOTE: The "rckbd restart" command may be different for your
188distribution. Simply replace it with the command you would use to
189set the fonts on screen.