Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | Video issues with S3 resume |
| 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 4 | 2003-2006, Pavel Machek |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
| 6 | During S3 resume, hardware needs to be reinitialized. For most |
| 7 | devices, this is easy, and kernel driver knows how to do |
| 8 | it. Unfortunately there's one exception: video card. Those are usually |
| 9 | initialized by BIOS, and kernel does not have enough information to |
| 10 | boot video card. (Kernel usually does not even contain video card |
| 11 | driver -- vesafb and vgacon are widely used). |
| 12 | |
| 13 | This is not problem for swsusp, because during swsusp resume, BIOS is |
Pavel Machek | 36fabc2 | 2005-11-07 00:58:39 -0800 | [diff] [blame] | 14 | run normally so video card is normally initialized. It should not be |
| 15 | problem for S1 standby, because hardware should retain its state over |
| 16 | that. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 18 | We either have to run video BIOS during early resume, or interpret it |
Matt LaPlante | 992caac | 2006-10-03 22:52:05 +0200 | [diff] [blame] | 19 | using vbetool later, or maybe nothing is necessary on particular |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 20 | system because video state is preserved. Unfortunately different |
| 21 | methods work on different systems, and no known method suits all of |
| 22 | them. |
| 23 | |
| 24 | Userland application called s2ram has been developed; it contains long |
| 25 | whitelist of systems, and automatically selects working method for a |
| 26 | given system. It can be downloaded from CVS at |
| 27 | www.sf.net/projects/suspend . If you get a system that is not in the |
| 28 | whitelist, please try to find a working solution, and submit whitelist |
| 29 | entry so that work does not need to be repeated. |
| 30 | |
| 31 | Currently, VBE_SAVE method (6 below) works on most |
| 32 | systems. Unfortunately, vbetool only runs after userland is resumed, |
| 33 | so it makes debugging of early resume problems |
| 34 | hard/impossible. Methods that do not rely on userland are preferable. |
| 35 | |
| 36 | Details |
| 37 | ~~~~~~~ |
| 38 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | There are a few types of systems where video works after S3 resume: |
| 40 | |
| 41 | (1) systems where video state is preserved over S3. |
| 42 | |
| 43 | (2) systems where it is possible to call the video BIOS during S3 |
| 44 | resume. Unfortunately, it is not correct to call the video BIOS at |
| 45 | that point, but it happens to work on some machines. Use |
| 46 | acpi_sleep=s3_bios. |
| 47 | |
| 48 | (3) systems that initialize video card into vga text mode and where |
| 49 | the BIOS works well enough to be able to set video mode. Use |
| 50 | acpi_sleep=s3_mode on these. |
| 51 | |
| 52 | (4) on some systems s3_bios kicks video into text mode, and |
| 53 | acpi_sleep=s3_bios,s3_mode is needed. |
| 54 | |
| 55 | (5) radeon systems, where X can soft-boot your video card. You'll need |
Pavel Machek | a4ffad5 | 2005-04-16 15:25:34 -0700 | [diff] [blame] | 56 | a new enough X, and a plain text console (no vesafb or radeonfb). See |
| 57 | http://www.doesi.gmxhome.de/linux/tm800s3/s3.html for more information. |
| 58 | Alternatively, you should use vbetool (6) instead. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | (6) other radeon systems, where vbetool is enough to bring system back |
| 61 | to life. It needs text console to be working. Do vbetool vbestate |
| 62 | save > /tmp/delme; echo 3 > /proc/acpi/sleep; vbetool post; vbetool |
| 63 | vbestate restore < /tmp/delme; setfont <whatever>, and your video |
| 64 | should work. |
| 65 | |
| 66 | (7) on some systems, it is possible to boot most of kernel, and then |
| 67 | POSTing bios works. Ole Rohne has patch to do just that at |
| 68 | http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2. |
| 69 | |
Pavel Machek | 7e95888 | 2005-09-03 15:56:56 -0700 | [diff] [blame] | 70 | (8) on some systems, you can use the video_post utility mentioned here: |
| 71 | http://bugzilla.kernel.org/show_bug.cgi?id=3670. Do echo 3 > /sys/power/state |
| 72 | && /usr/sbin/video_post - which will initialize the display in console mode. |
| 73 | If you are in X, you can switch to a virtual terminal and back to X using |
| 74 | CTRL+ALT+F1 - CTRL+ALT+F7 to get the display working in graphical mode again. |
| 75 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | Now, if you pass acpi_sleep=something, and it does not work with your |
| 77 | bios, you'll get a hard crash during resume. Be careful. Also it is |
| 78 | safest to do your experiments with plain old VGA console. The vesafb |
| 79 | and radeonfb (etc) drivers have a tendency to crash the machine during |
| 80 | resume. |
| 81 | |
| 82 | You may have a system where none of above works. At that point you |
| 83 | either invent another ugly hack that works, or write proper driver for |
| 84 | your video card (good luck getting docs :-(). Maybe suspending from X |
| 85 | (proper X, knowing your hardware, not XF68_FBcon) might have better |
| 86 | chance of working. |
| 87 | |
Pavel Machek | 36fabc2 | 2005-11-07 00:58:39 -0800 | [diff] [blame] | 88 | Table of known working notebooks: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
| 90 | Model hack (or "how to do it") |
| 91 | ------------------------------------------------------------------------------ |
| 92 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI |
Pavel Machek | e084dbd | 2006-06-23 02:04:50 -0700 | [diff] [blame] | 93 | Acer TM 230 s3_bios (2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | Acer TM 242FX vbetool (6) |
Pavel Machek | 7e95888 | 2005-09-03 15:56:56 -0700 | [diff] [blame] | 95 | Acer TM C110 video_post (8) |
| 96 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | Acer TM 4052LCi s3_bios (2) |
Pavel Machek | 36fabc2 | 2005-11-07 00:58:39 -0800 | [diff] [blame] | 98 | Acer TM 636Lci s3_bios,s3_mode (4) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back |
| 100 | Acer TM 660 ??? (*) |
| 101 | Acer TM 800 vga=normal, X patches, see webpage (5) or vbetool (6) |
| 102 | Acer TM 803 vga=normal, X patches, see webpage (5) or vbetool (6) |
| 103 | Acer TM 803LCi vga=normal, vbetool (6) |
| 104 | Arima W730a vbetool needed (6) |
| 105 | Asus L2400D s3_mode (3)(***) (S1 also works OK) |
Pavel Machek | a4ffad5 | 2005-04-16 15:25:34 -0700 | [diff] [blame] | 106 | Asus L3350M (SiS 740) (6) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | Asus L3800C (Radeon M7) s3_bios (2) (S1 also works OK) |
Pavel Machek | a4ffad5 | 2005-04-16 15:25:34 -0700 | [diff] [blame] | 108 | Asus M6887Ne vga=normal, s3_bios (2), use radeon driver instead of fglrx in x.org |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | Athlon64 desktop prototype s3_bios (2) |
| 110 | Compal CL-50 ??? (*) |
| 111 | Compaq Armada E500 - P3-700 none (1) (S1 also works OK) |
| 112 | Compaq Evo N620c vga=normal, s3_bios (2) |
| 113 | Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1 |
| 114 | Dell D600, ATI RV250 vga=normal and X, or try vbestate (6) |
Pavel Machek | 2a96206 | 2005-06-25 14:55:18 -0700 | [diff] [blame] | 115 | Dell D610 vga=normal and X (possibly vbestate (6) too, but not tested) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | Dell Inspiron 4000 ??? (*) |
| 117 | Dell Inspiron 500m ??? (*) |
Pavel Machek | 2a96206 | 2005-06-25 14:55:18 -0700 | [diff] [blame] | 118 | Dell Inspiron 510m ??? |
Pavel Machek | e084dbd | 2006-06-23 02:04:50 -0700 | [diff] [blame] | 119 | Dell Inspiron 5150 vbetool needed (6) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | Dell Inspiron 600m ??? (*) |
| 121 | Dell Inspiron 8200 ??? (*) |
| 122 | Dell Inspiron 8500 ??? (*) |
| 123 | Dell Inspiron 8600 ??? (*) |
| 124 | eMachines athlon64 machines vbetool needed (6) (someone please get me model #s) |
| 125 | HP NC6000 s3_bios, may not use radeonfb (2); or vbetool (6) |
| 126 | HP NX7000 ??? (*) |
| 127 | HP Pavilion ZD7000 vbetool post needed, need open-source nv driver for X |
| 128 | HP Omnibook XE3 athlon version none (1) |
| 129 | HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV |
Pavel Machek | e084dbd | 2006-06-23 02:04:50 -0700 | [diff] [blame] | 130 | HP Omnibook XE3L-GF vbetool (6) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 131 | HP Omnibook 5150 none (1), (S1 also works OK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294 Savage/IX-MV, vesafb gets "interesting" but X work. |
| 133 | IBM 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 :-(] |
| 134 | IBM TP R32 / Type 2658-MMG none (1) |
| 135 | IBM TP R40 2722B3G ??? (*) |
| 136 | IBM TP R50p / Type 1832-22U s3_bios (2) |
Pavel Machek | a4ffad5 | 2005-04-16 15:25:34 -0700 | [diff] [blame] | 137 | IBM TP R51 none (1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | IBM TP T30 236681A ??? (*) |
| 139 | IBM TP T40 / Type 2373-MU4 none (1) |
| 140 | IBM TP T40p none (1) |
| 141 | IBM TP R40p s3_bios (2) |
| 142 | IBM TP T41p s3_bios (2), switch to X after resume |
Pavel Machek | a4ffad5 | 2005-04-16 15:25:34 -0700 | [diff] [blame] | 143 | IBM TP T42 s3_bios (2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | IBM ThinkPad T42p (2373-GTG) s3_bios (2) |
| 145 | IBM TP X20 ??? (*) |
Antonino A. Daplas | 9587c4b | 2006-04-27 18:40:39 -0700 | [diff] [blame] | 146 | IBM TP X30 s3_bios, s3_mode (4) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 148 | IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 150 | IBM TP 600e none(1), but a switch to console and back to X is needed |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | Medion MD4220 ??? (*) |
| 152 | Samsung P35 vbetool needed (6) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 153 | Sharp PC-AR10 (ATI rage) none (1), backlight does not switch off |
Pavel Machek | 374a6cf | 2005-07-07 17:59:33 -0700 | [diff] [blame] | 154 | Sony Vaio PCG-C1VRX/K s3_bios (2) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | Sony Vaio PCG-F403 ??? (*) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 156 | Sony Vaio PCG-GRT995MP none (1), works with 'nv' X driver |
| 157 | Sony Vaio PCG-GR7/K none (1), but needs radeonfb, use radeontool (http://fdd.com/software/radeon/) to turn off backlight. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | Sony Vaio PCG-N505SN ??? (*) |
| 159 | Sony Vaio vgn-s260 X or boot-radeon can init it (5) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 160 | Sony Vaio vgn-S580BH vga=normal, but suspend from X. Console will be blank unless you return to X. |
| 161 | Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | Toshiba Libretto L5 none (1) |
Pavel Machek | e084dbd | 2006-06-23 02:04:50 -0700 | [diff] [blame] | 163 | Toshiba Libretto 100CT/110CT vbetool (6) |
Pavel Machek | 543cc27 | 2006-03-23 03:00:02 -0800 | [diff] [blame] | 164 | Toshiba Portege 3020CT s3_mode (3) |
| 165 | Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK) |
| 166 | Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | Toshiba Satellite 4090XCDT ??? (*) |
| 168 | Toshiba Satellite P10-554 s3_bios,s3_mode (4)(****) |
Pavel Machek | 2a96206 | 2005-06-25 14:55:18 -0700 | [diff] [blame] | 169 | Toshiba M30 (2) xor X with nvidia driver using internal AGP |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | Uniwill 244IIO ??? (*) |
| 171 | |
Pavel Machek | 36fabc2 | 2005-11-07 00:58:39 -0800 | [diff] [blame] | 172 | Known working desktop systems |
| 173 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 174 | |
| 175 | Mainboard Graphics card hack (or "how to do it") |
| 176 | ------------------------------------------------------------------------------ |
| 177 | Asus A7V8X nVidia RIVA TNT2 model 64 s3_bios,s3_mode (4) |
| 178 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | |
| 180 | (*) from http://www.ubuntulinux.org/wiki/HoaryPMResults, not sure |
| 181 | which options to use. If you know, please tell me. |
| 182 | |
| 183 | (***) To be tested with a newer kernel. |
| 184 | |
| 185 | (****) Not with SMP kernel, UP only. |