요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===========================
Video issues with S3 resume
===========================
2003-2006, Pavel Machek
During S3 resume, hardware needs to be reinitialized. For most
devices, this is easy, and kernel driver knows how to do
it. Unfortunately there's one exception: video card. Those are usually
initialized by BIOS, and kernel does not have enough information to
boot video card. (Kernel usually does not even contain video card
driver -- vesafb and vgacon are widely used).
This is not problem for swsusp, because during swsusp resume, BIOS is
run normally so video card is normally initialized. It should not be
problem for S1 standby, because hardware should retain its state over
that.
We either have to run video BIOS during early resume, or interpret it
using vbetool later, or maybe nothing is necessary on particular
system because video state is preserved. Unfortunately different
methods work on different systems, and no known method suits all of
them.
Userland application called s2ram has been developed; it contains long
whitelist of systems, and automatically selects working method for a
given system. It can be downloaded from CVS at
www.sf.net/projects/suspend . If you get a system that is not in the
whitelist, please try to find a working solution, and submit whitelist
entry so that work does not need to be repeated.
Currently, VBE_SAVE method (6 below) works on most
systems. Unfortunately, vbetool only runs after userland is resumed,
so it makes debugging of early resume problems
hard/impossible. Methods that do not rely on userland are preferable.
Details
~~~~~~~
There are a few types of systems where video works after S3 resume:
(1) systems where video state is preserved over S3.
(2) systems where it is possible to call the video BIOS during S3
resume. Unfortunately, it is not correct to call the video BIOS at
that point, but it happens to work on some machines. Use
acpi_sleep=s3_bios.
(3) systems that initialize video card into vga text mode and where
the BIOS works well enough to be able to set video mode. Use
acpi_sleep=s3_mode on these.
(4) on some systems s3_bios kicks video into text mode, and
acpi_sleep=s3_bios,s3_mode is needed.
(5) radeon systems, where X can soft-boot your video card. You'll need
a new enough X, and a plain text console (no vesafb or radeonfb). See
http://www.doesi.gmxhome.de/linux/tm800s3/s3.html for more information.
Alternatively, you should use vbetool (6) instead.
(6) other radeon systems, where vbetool is enough to bring system back
to life. It needs text console to be working. Do vbetool vbestate
save > /tmp/delme; echo 3 > /proc/acpi/sleep; vbetool post; vbetool
vbestate restore < /tmp/delme; setfont <whatever>, and your video
should work.
(7) on some systems, it is possible to boot most of kernel, and then
POSTing bios works. Ole Rohne has patch to do just that at
http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2.
(8) on some systems, you can use the video_post utility and or
do echo 3 > /sys/power/state && /usr/sbin/video_post - which will
initialize the display in console mode. If you are in X, you can switch
to a virtual terminal and back to X using CTRL+ALT+F1 - CTRL+ALT+F7 to get
the display working in graphical mode again.
Now, if you pass acpi_sleep=something, and it does not work with your
bios, you'll get a hard crash during resume. Be careful. Also it is
safest to do your experiments with plain old VGA console. The vesafb
and radeonfb (etc) drivers have a tendency to crash the machine during
resume.
You may have a system where none of above works. At that point you
either invent another ugly hack that works, or write proper driver for
your video card (good luck getting docs :-(). Maybe suspending from X
(proper X, knowing your hardware, not XF68_FBcon) might have better
chance of working.
Table of known working notebooks:
=============================== ===============================================
Model hack (or "how to do it")
=============================== ===============================================
Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI
Acer TM 230 s3_bios (2)
Acer TM 242FX vbetool (6)
Acer TM C110 video_post (8)
Acer TM C300 vga=normal (only suspend on console, not in X),
vbetool (6) or video_post (8)
Acer TM 4052LCi s3_bios (2)
Acer TM 636Lci s3_bios,s3_mode (4)
Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text
console back
Acer TM 660 ??? [#f1]_
Acer TM 800 vga=normal, X patches, see webpage (5)
or vbetool (6)
Acer TM 803 vga=normal, X patches, see webpage (5)
or vbetool (6)
Acer TM 803LCi vga=normal, vbetool (6)
Arima W730a vbetool needed (6)
Asus L2400D s3_mode (3) [#f2]_ (S1 also works OK)
Asus L3350M (SiS 740) (6)
Asus L3800C (Radeon M7) s3_bios (2) (S1 also works OK)
Asus M6887Ne vga=normal, s3_bios (2), use radeon driver
instead of fglrx in x.org
Athlon64 desktop prototype s3_bios (2)
Compal CL-50 ??? [#f1]_
Compaq Armada E500 - P3-700 none (1) (S1 also works OK)
Compaq Evo N620c vga=normal, s3_bios (2)
Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1
Dell D600, ATI RV250 vga=normal and X, or try vbestate (6)
Dell D610 vga=normal and X (possibly vbestate (6) too,
but not tested)
Dell Inspiron 4000 ??? [#f1]_
Dell Inspiron 500m ??? [#f1]_
Dell Inspiron 510m ???
Dell Inspiron 5150 vbetool needed (6)
Dell Inspiron 600m ??? [#f1]_
Dell Inspiron 8200 ??? [#f1]_
Dell Inspiron 8500 ??? [#f1]_
Dell Inspiron 8600 ??? [#f1]_
eMachines athlon64 machines vbetool needed (6) (someone please get
me model #s)
HP NC6000 s3_bios, may not use radeonfb (2);
or vbetool (6)
HP NX7000 ??? [#f1]_
HP Pavilion ZD7000 vbetool post needed, need open-source nv
driver for X
HP Omnibook XE3 athlon version none (1)
HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV
HP Omnibook XE3L-GF vbetool (6)
HP Omnibook 5150 none (1), (S1 also works OK)
IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294
Savage/IX-MV, vesafb gets "interesting"
but X work.
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 :-(]
IBM TP R32 / Type 2658-MMG none (1)
IBM TP R40 2722B3G ??? [#f1]_
IBM TP R50p / Type 1832-22U s3_bios (2)
IBM TP R51 none (1)
IBM TP T30 236681A ??? [#f1]_
IBM TP T40 / Type 2373-MU4 none (1)
IBM TP T40p none (1)
IBM TP R40p s3_bios (2)
IBM TP T41p s3_bios (2), switch to X after resume
IBM TP T42 s3_bios (2)
IBM ThinkPad T42p (2373-GTG) s3_bios (2)
IBM TP X20 ??? [#f1]_
IBM TP X30 s3_bios, s3_mode (4)
IBM TP X31 / Type 2672-XXH none (1), use radeontool
(http://fdd.com/software/radeon/) to
turn off backlight.
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?
IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
IBM TP 600e none(1), but a switch to console and
back to X is needed
Medion MD4220 ??? [#f1]_
Samsung P35 vbetool needed (6)
Sharp PC-AR10 (ATI rage) none (1), backlight does not switch off
Sony Vaio PCG-C1VRX/K s3_bios (2)
Sony Vaio PCG-F403 ??? [#f1]_
Sony Vaio PCG-GRT995MP none (1), works with 'nv' X driver
Sony Vaio PCG-GR7/K none (1), but needs radeonfb, use
radeontool (http://fdd.com/software/radeon/)
to turn off backlight.
Sony Vaio PCG-N505SN ??? [#f1]_
Sony Vaio vgn-s260 X or boot-radeon can init it (5)
Sony Vaio vgn-S580BH vga=normal, but suspend from X. Console will
be blank unless you return to X.
Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4)
Toshiba Libretto L5 none (1)
Toshiba Libretto 100CT/110CT vbetool (6)
Toshiba Portege 3020CT s3_mode (3)
Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK)
Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK)
Toshiba Satellite 4090XCDT ??? [#f1]_
Toshiba Satellite P10-554 s3_bios,s3_mode (4) [#f3]_
Toshiba M30 (2) xor X with nvidia driver using internal AGP
Uniwill 244IIO ??? [#f1]_
=============================== ===============================================
Known working desktop systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=================== ============================= ========================
Mainboard Graphics card hack (or "how to do it")
=================== ============================= ========================
Asus A7V8X nVidia RIVA TNT2 model 64 s3_bios,s3_mode (4)
=================== ============================= ========================
.. [#f1] from https://wiki.ubuntu.com/HoaryPMResults, not sure
which options to use. If you know, please tell me.
.. [#f2] To be tested with a newer kernel.
.. [#f3] Not with SMP kernel, UP only.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
S3 resume에서 video card만 특별히 어려운 이유
1-36Pavel Machek이 2003-2006년에 작성한 문서입니다. S3 resume에서는 hardware를 다시 초기화해야 하며 대부분은 kernel driver가 처리합니다. Video card는 보통 BIOS가 초기화하고 kernel에는 boot에 필요한 정보나 native driver가 없는 경우가 많아 예외가 됩니다. 당시 `vesafb`와 `vgacon`이 널리 쓰였습니다.
Swsusp resume은 BIOS가 정상적으로 실행돼 video card도 초기화되므로 이 문제가 없고, S1 standby는 hardware state를 유지하므로 보통 문제가 없습니다.
S3에서는 early resume에 video BIOS를 실행하거나, userland 복귀 뒤 `vbetool`로 해석하거나, 특정 system이 video state를 보존한다면 아무 조치도 하지 않는 방법이 있습니다. System마다 성공하는 방식이 달라 모든 hardware에 맞는 단일 방법은 알려지지 않았습니다.
Userland `s2ram`은 긴 system whitelist를 바탕으로 machine별 방법을 자동 선택했습니다. 목록에 없는 system은 동작하는 해법을 찾은 뒤 whitelist entry를 제출해 같은 조사를 반복하지 않도록 하는 것이 권장됐습니다.
아래 6번 `VBE_SAVE` 방식이 대부분의 system에서 동작했지만 `vbetool`은 userspace resume 뒤에야 실행되므로 early resume 문제를 debug하기 어렵습니다. 가능하면 userland에 의존하지 않는 방법이 낫습니다.
Firmware 실행 시점과 state 보존 여부가 방법을 결정합니다.
===========================
Video issues with S3 resume
===========================
2003-2006, Pavel Machek
During S3 resume, hardware needs to be reinitialized. For most
devices, this is easy, and kernel driver knows how to do
it. Unfortunately there's one exception: video card. Those are usually
initialized by BIOS, and kernel does not have enough information to
boot video card. (Kernel usually does not even contain video card
driver -- vesafb and vgacon are widely used).
This is not problem for swsusp, because during swsusp resume, BIOS is
run normally so video card is normally initialized. It should not be
problem for S1 standby, because hardware should retain its state over
that.
We either have to run video BIOS during early resume, or interpret it
using vbetool later, or maybe nothing is necessary on particular
system because video state is preserved. Unfortunately different
methods work on different systems, and no known method suits all of
them.
Userland application called s2ram has been developed; it contains long
whitelist of systems, and automatically selects working method for a
given system. It can be downloaded from CVS at
www.sf.net/projects/suspend . If you get a system that is not in the
whitelist, please try to find a working solution, and submit whitelist
entry so that work does not need to be repeated.
Currently, VBE_SAVE method (6 below) works on most
systems. Unfortunately, vbetool only runs after userland is resumed,
so it makes debugging of early resume problems
hard/impossible. Methods that do not rely on userland are preferable.
여덟 가지 video 복원 방법과 실험 경고
37-81(1) S3 동안 video state가 보존되는 system은 추가 조치가 필요 없습니다. (2) Resume 중 video BIOS 호출이 원칙상 정확하지는 않지만 일부 machine에서 동작하며 `acpi_sleep=s3_bios`를 사용합니다.
(3) Video card를 VGA text mode로 초기화하고 BIOS의 mode setting이 충분히 동작하는 system은 `acpi_sleep=s3_mode`를 사용합니다. (4) `s3_bios`가 text mode로 전환하는 일부 system은 `acpi_sleep=s3_bios,s3_mode` 두 option이 필요합니다.
(5) 일부 Radeon system에서는 충분히 최신인 X가 video card를 soft boot할 수 있습니다. `vesafb`나 `radeonfb` 없는 plain text console이 필요하며, 대안은 6번 `vbetool`입니다.
(6) 다른 Radeon system은 text console이 동작한다는 전제에서 `vbetool`로 VBE state를 저장하고 S3 뒤 POST·restore한 다음 font를 되살릴 수 있습니다.
vbetool vbestate save > /tmp/delme
echo 3 > /proc/acpi/sleep
vbetool post
vbetool vbestate restore < /tmp/delme
setfont <whatever>
(7) 일부 system은 kernel 대부분을 boot한 뒤 BIOS를 POST할 수 있으며 원문은 Ole Rohne의 당시 RadeonFB patch를 가리킵니다. (8) `video_post` utility로 console display를 초기화하고, X에서는 `CTRL+ALT+F1`로 virtual terminal에 갔다가 `CTRL+ALT+F7`로 돌아와 graphical mode를 복원할 수 있습니다.
Hardware에 맞지 않는 `acpi_sleep=` option은 resume 중 hard crash를 일으킬 수 있습니다. 실험은 plain VGA console에서 하는 것이 가장 안전하며 `vesafb`, `radeonfb` 같은 framebuffer driver는 resume crash를 유발하는 경향이 있었습니다.
문서 번호는 뒤 호환 표의 method 번호와 같습니다.
Details
~~~~~~~
There are a few types of systems where video works after S3 resume:
(1) systems where video state is preserved over S3.
(2) systems where it is possible to call the video BIOS during S3
resume. Unfortunately, it is not correct to call the video BIOS at
that point, but it happens to work on some machines. Use
acpi_sleep=s3_bios.
(3) systems that initialize video card into vga text mode and where
the BIOS works well enough to be able to set video mode. Use
acpi_sleep=s3_mode on these.
(4) on some systems s3_bios kicks video into text mode, and
acpi_sleep=s3_bios,s3_mode is needed.
(5) radeon systems, where X can soft-boot your video card. You'll need
a new enough X, and a plain text console (no vesafb or radeonfb). See
http://www.doesi.gmxhome.de/linux/tm800s3/s3.html for more information.
Alternatively, you should use vbetool (6) instead.
(6) other radeon systems, where vbetool is enough to bring system back
to life. It needs text console to be working. Do vbetool vbestate
save > /tmp/delme; echo 3 > /proc/acpi/sleep; vbetool post; vbetool
vbestate restore < /tmp/delme; setfont <whatever>, and your video
should work.
(7) on some systems, it is possible to boot most of kernel, and then
POSTing bios works. Ole Rohne has patch to do just that at
http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2.
(8) on some systems, you can use the video_post utility and or
do echo 3 > /sys/power/state && /usr/sbin/video_post - which will
initialize the display in console mode. If you are in X, you can switch
to a virtual terminal and back to X using CTRL+ALT+F1 - CTRL+ALT+F7 to get
the display working in graphical mode again.
Now, if you pass acpi_sleep=something, and it does not work with your
bios, you'll get a hard crash during resume. Be careful. Also it is
safest to do your experiments with plain old VGA console. The vesafb
and radeonfb (etc) drivers have a tendency to crash the machine during
resume.
알려진 방법이 모두 실패할 때
82-88위 방법이 모두 실패하는 system에서는 새 hardware별 workaround를 만들거나 video card의 올바른 driver를 작성해야 합니다. Hardware를 이해하는 native X에서 suspend하면 `XF68_FBcon` 같은 framebuffer 기반 X보다 성공 가능성이 높을 수 있습니다.
You may have a system where none of above works. At that point you
either invent another ugly hack that works, or write proper driver for
your video card (good luck getting docs :-(). Maybe suspending from X
(proper X, knowing your hardware, not XF68_FBcon) might have better
chance of working.
알려진 notebook별 동작 방법
89-197다음 표는 문서 작성 당시 보고된 notebook별 workaround입니다. `???`는 사용할 option이 확인되지 않았다는 뜻이고, 괄호의 숫자는 앞 절의 1-8번 방법을 가리킵니다.
Model명과 option, driver 제약 및 BIOS 주석을 원문 순서대로 보존했습니다.
Table of known working notebooks:
=============================== ===============================================
Model hack (or "how to do it")
=============================== ===============================================
Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI
Acer TM 230 s3_bios (2)
Acer TM 242FX vbetool (6)
Acer TM C110 video_post (8)
Acer TM C300 vga=normal (only suspend on console, not in X),
vbetool (6) or video_post (8)
Acer TM 4052LCi s3_bios (2)
Acer TM 636Lci s3_bios,s3_mode (4)
Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text
console back
Acer TM 660 ??? [#f1]_
Acer TM 800 vga=normal, X patches, see webpage (5)
or vbetool (6)
Acer TM 803 vga=normal, X patches, see webpage (5)
or vbetool (6)
Acer TM 803LCi vga=normal, vbetool (6)
Arima W730a vbetool needed (6)
Asus L2400D s3_mode (3) [#f2]_ (S1 also works OK)
Asus L3350M (SiS 740) (6)
Asus L3800C (Radeon M7) s3_bios (2) (S1 also works OK)
Asus M6887Ne vga=normal, s3_bios (2), use radeon driver
instead of fglrx in x.org
Athlon64 desktop prototype s3_bios (2)
Compal CL-50 ??? [#f1]_
Compaq Armada E500 - P3-700 none (1) (S1 also works OK)
Compaq Evo N620c vga=normal, s3_bios (2)
Dell 600m, ATI R250 Lf none (1), but needs xorg-x11-6.8.1.902-1
Dell D600, ATI RV250 vga=normal and X, or try vbestate (6)
Dell D610 vga=normal and X (possibly vbestate (6) too,
but not tested)
Dell Inspiron 4000 ??? [#f1]_
Dell Inspiron 500m ??? [#f1]_
Dell Inspiron 510m ???
Dell Inspiron 5150 vbetool needed (6)
Dell Inspiron 600m ??? [#f1]_
Dell Inspiron 8200 ??? [#f1]_
Dell Inspiron 8500 ??? [#f1]_
Dell Inspiron 8600 ??? [#f1]_
eMachines athlon64 machines vbetool needed (6) (someone please get
me model #s)
HP NC6000 s3_bios, may not use radeonfb (2);
or vbetool (6)
HP NX7000 ??? [#f1]_
HP Pavilion ZD7000 vbetool post needed, need open-source nv
driver for X
HP Omnibook XE3 athlon version none (1)
HP Omnibook XE3GC none (1), video is S3 Savage/IX-MV
HP Omnibook XE3L-GF vbetool (6)
HP Omnibook 5150 none (1), (S1 also works OK)
IBM TP T20, model 2647-44G none (1), video is S3 Inc. 86C270-294
Savage/IX-MV, vesafb gets "interesting"
but X work.
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 :-(]
IBM TP R32 / Type 2658-MMG none (1)
IBM TP R40 2722B3G ??? [#f1]_
IBM TP R50p / Type 1832-22U s3_bios (2)
IBM TP R51 none (1)
IBM TP T30 236681A ??? [#f1]_
IBM TP T40 / Type 2373-MU4 none (1)
IBM TP T40p none (1)
IBM TP R40p s3_bios (2)
IBM TP T41p s3_bios (2), switch to X after resume
IBM TP T42 s3_bios (2)
IBM ThinkPad T42p (2373-GTG) s3_bios (2)
IBM TP X20 ??? [#f1]_
IBM TP X30 s3_bios, s3_mode (4)
IBM TP X31 / Type 2672-XXH none (1), use radeontool
(http://fdd.com/software/radeon/) to
turn off backlight.
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?
IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
IBM TP 600e none(1), but a switch to console and
back to X is needed
Medion MD4220 ??? [#f1]_
Samsung P35 vbetool needed (6)
Sharp PC-AR10 (ATI rage) none (1), backlight does not switch off
Sony Vaio PCG-C1VRX/K s3_bios (2)
Sony Vaio PCG-F403 ??? [#f1]_
Sony Vaio PCG-GRT995MP none (1), works with 'nv' X driver
Sony Vaio PCG-GR7/K none (1), but needs radeonfb, use
radeontool (http://fdd.com/software/radeon/)
to turn off backlight.
Sony Vaio PCG-N505SN ??? [#f1]_
Sony Vaio vgn-s260 X or boot-radeon can init it (5)
Sony Vaio vgn-S580BH vga=normal, but suspend from X. Console will
be blank unless you return to X.
Sony Vaio vgn-FS115B s3_bios (2),s3_mode (4)
Toshiba Libretto L5 none (1)
Toshiba Libretto 100CT/110CT vbetool (6)
Toshiba Portege 3020CT s3_mode (3)
Toshiba Satellite 4030CDT s3_mode (3) (S1 also works OK)
Toshiba Satellite 4080XCDT s3_mode (3) (S1 also works OK)
Toshiba Satellite 4090XCDT ??? [#f1]_
Toshiba Satellite P10-554 s3_bios,s3_mode (4) [#f3]_
Toshiba M30 (2) xor X with nvidia driver using internal AGP
Uniwill 244IIO ??? [#f1]_
=============================== ===============================================
Desktop 사례와 표의 footnote
198-213알려진 desktop 사례는 Asus A7V8X mainboard와 nVidia RIVA TNT2 model 64 graphics card 조합이며 `s3_bios,s3_mode`(4)를 사용합니다.
원문의 desktop 호환 표입니다.
[#f1] 항목은 `https://wiki.ubuntu.com/HoaryPMResults`에서 가져왔지만 정확한 option을 알 수 없어 추가 제보가 필요합니다. [#f2]는 더 새 kernel에서 다시 시험해야 합니다. [#f3]은 SMP kernel에서는 동작하지 않고 UP kernel에서만 동작한다는 뜻입니다.
Known working desktop systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=================== ============================= ========================
Mainboard Graphics card hack (or "how to do it")
=================== ============================= ========================
Asus A7V8X nVidia RIVA TNT2 model 64 s3_bios,s3_mode (4)
=================== ============================= ========================
.. [#f1] from https://wiki.ubuntu.com/HoaryPMResults, not sure
which options to use. If you know, please tell me.
.. [#f2] To be tested with a newer kernel.
.. [#f3] Not with SMP kernel, UP only.
요약·해설
video.rst:1-213S3 resume에서 video BIOS와 VBE state를 복원하는 8가지 방법 및 notebook별 호환 기록입니다.