Skip to contentSkip to conversation

resource for S3 suspend/resume of Radeon

DISCUSSION Charl P. Botha 6 participants 12 messages Mar 17, 2003 – Mar 21, 2003 6 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

Dear list,

This patch to Linux kernel 2.4.20-ben8 has just been brought to my
attention: http://penguinppc.org/~benh/new_sleep.diff

benh and ATI seem to have fixed the suspension code of the radeon. I have looked at this (see the Radeon bits) and at Patrick Mochel's power management architecture code and documentation and it does look like a lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

I don't have time to look at this right now, but will do so as soon as another lazy weekend comes up. If someone else has the time and inclination (Ole Rohne? ;), please go ahead!

Thanks,
Charl

Signature · 8 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Thus wrote Charl P. Botha:

Quoted 8 lines

This patch to Linux kernel 2.4.20-ben8 has just been brought to my
attention: http://penguinppc.org/~benh/new_sleep.diff

benh and ATI seem to have fixed the suspension code of the radeon. I have looked at this (see the Radeon bits) and at Patrick Mochel's power management architecture code and documentation and it does look like a lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

Which radeon do you have in mind exactly? I use an M7 LW chip, and I get the following: both in 2.4.x and 2.5.x the display does not power-off when in S1 (which is, I believe, expected), and during S3 it poweroffs and comes back in, provided I pass the acpi_sleep=s3_bios option.
The latter was only tested using VGA console, because AFAIK the framebuffer support in current 2.5 kernels is faulty (at least it didn'r work for me, and since I have problems with 2.5 that are more serious, I didn't investigate).

Anyway, my Radeon seems to work quite fine.
Best regards,

Signature · 9 lines
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/[email protected]


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): 20030317153434.GB3936-DETuoxkZsSqrDJvtcaxF/[email protected]

#4 lore raw
Quoted 6 lines · Karol Kozimor

Thus wrote Charl P. Botha:

Quoted 2 lines

lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

Which radeon do you have in mind exactly? I use an M7 LW chip, and I get the following: both in 2.4.x and 2.5.x the display does not power-off when

You could try using the radeontool (google it) to remedy this.

Quoted 2 lines

in S1 (which is, I believe, expected), and during S3 it poweroffs and comes back in, provided I pass the acpi_sleep=s3_bios option.

Wow, you mean to say that you can flawlessly S3 suspend/resume with kernel 2.4? I would assume that this is due to your laptop's support for S3 in BIOS. Not all laptops have this... see for instance what Ole had to do to get his working:
http://home.cern.ch/mrohne/P2120/P2120_Linux_S3.html

Drivers in the new kernel need to be able to suspend/resume (S1, S3 and S4) without more than the minimum required support in the BIOS.

Thanks,
Charl

Signature · 8 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Thus wrote Charl P. Botha:

Quoted 3 lines
Quoted 2 lines

Which radeon do you have in mind exactly? I use an M7 LW chip, and I get the following: both in 2.4.x and 2.5.x the display does not power-off when

You could try using the radeontool (google it) to remedy this.

Thanks, I will. I'm currently trying to deal with it on ACPI level, but perhaps using radeontool is better.

No that I've tested it: it seems that radeontool goes further than ACPI, disabling not only the backlight (as my laptop does), but also the LCD itself. Neat.

Quoted 4 lines
Quoted 2 lines

in S1 (which is, I believe, expected), and during S3 it poweroffs and comes back in, provided I pass the acpi_sleep=s3_bios option.

Wow, you mean to say that you can flawlessly S3 suspend/resume with kernel 2.4? I would assume that this is due to your laptop's support

No, I meant S3 only in 2.5. 2.4 has no S3 code whatsoever, at least AFAIK.

Quoted 3 lines

for S3 in BIOS. Not all laptops have this... see for instance what Ole had to do to get his working:
http://home.cern.ch/mrohne/P2120/P2120_Linux_S3.html

Anyway, since the first 2.5 I used (2.5.59) I am able to suspend-to-RAM, then resume. Normally, the screen is off, and the keyboard is mute, but appending acpi_sleep=s3_bios does it for the screen, and reloading the atkeyb module brings the keyboard back to life. NIC needs several seconds (and several pings also) to resume (it's a rtl8139 chip).

Quoted 2 lines

Drivers in the new kernel need to be able to suspend/resume (S1, S3 and S4) without more than the minimum required support in the BIOS.

S4 is a bit easier. See this: I have radeonfb hard-compiled in the kernel. When I resume, the kernel that boots first initializes the display properly, and then the kernel that is read from swap has the display already running, so it doesn't have to worry about it. I suppose it would be much harder when radeonfb was compiled as a module. Then, I think that it's S3 that is the most difficult.
Best regards,

Signature · 9 lines
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/[email protected]


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): 20030317162624.GB2249-DETuoxkZsSqrDJvtcaxF/[email protected]

#8 lore raw
Quoted 5 lines · Karol Kozimor

Anyway, since the first 2.5 I used (2.5.59) I am able to suspend-to-RAM, then resume. Normally, the screen is off, and the keyboard is mute, but appending acpi_sleep=s3_bios does it for the screen, and reloading the atkeyb module brings the keyboard back to life. NIC needs several seconds (and several pings also) to resume (it's a rtl8139 chip).

I still need to find out why my laptop doesn't even want to begin waking up. :) Maybe it's very tired.

Quoted 9 lines
Quoted 2 lines

Drivers in the new kernel need to be able to suspend/resume (S1, S3 and S4) without more than the minimum required support in the BIOS.

S4 is a bit easier. See this: I have radeonfb hard-compiled in the kernel. When I resume, the kernel that boots first initializes the display properly, and then the kernel that is read from swap has the display already running, so it doesn't have to worry about it. I suppose it would be much harder when radeonfb was compiled as a module. Then, I think that it's S3 that is the most difficult.

swsusp has worked perfectly for me for some time, at least ever since
http://cpbotha.net/dri_resume.html :)

Signature · 8 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
#9 lore raw
In reply to a message not in the archive

Hi!

Quoted 5 lines

S4 is a bit easier. See this: I have radeonfb hard-compiled in the kernel. When I resume, the kernel that boots first initializes the display properly, and then the kernel that is read from swap has the display already running, so it doesn't have to worry about it. I suppose it would be much harder when radeonfb was compiled as a module. Then, I think that

Well, you'd need to copy module insertion
code into radeon_resume and module
deletion in radeon_suspend... It should
not be too hard.
Pavel

Signature · 10 lines
				Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
#10 lore raw
In reply to a message not in the archive
Quoted 1 line · Karol Kozimor

provided I pass the acpi_sleep=s3_bios option.

...which probably shows that your BIOS is more helpful than what is on the P2120 (cf our previous exchange about waking up the 8139too).

Quoted 2 lines

The latter was only tested using VGA console, because AFAIK the framebuffer support in current 2.5 kernels is faulty

I think there is a bug in the 8MB special case of radeonfb memory sizing.

Quoted 1 line

Anyway, my Radeon seems to work quite fine.

...with your BIOS.

IUC, there is no requirement that the BIOS should POST (or allow lcall $0xc000,$3 to work) on S3 resume.

Ole

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

#11 lore raw
In reply to a message not in the archive
Quoted 5 lines · Charl P. Botha

benh and ATI seem to have fixed the suspension code of the radeon. I have looked at this (see the Radeon bits) and at Patrick Mochel's power management architecture code and documentation and it does look like a lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

Hmmm, this might not be AS useful as I thought. Could a pmac expert elaborate on the differences between its suspend and ACPI S3? For S3 we need something that can init the chip almost from scratch.

Signature · 8 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 10 lines · Charl P. Botha
Quoted 5 lines · Charl P. Botha

benh and ATI seem to have fixed the suspension code of the radeon. I have looked at this (see the Radeon bits) and at Patrick Mochel's power management architecture code and documentation and it does look like a lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

Hmmm, this might not be AS useful as I thought. Could a pmac expert elaborate on the differences between its suspend and ACPI S3? For S3 we need something that can init the chip almost from scratch.

I am not a great pmac expert, but as I understand the whole things (and also what I get actually from my powerbook), suspending a pmac look like 'S3'.
The only difference, though, is that there is a unified
PMU which is more 'friendly' to control, instead of having a lot of southbridges with different behaviour. Also openfirmware for pmac is more easy to hack-fix (there is only one OEM...)

Cheers,

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
#14 lore raw
In reply to a message not in the archive
Quoted 10 lines · Charl P. Botha
Quoted 5 lines · Charl P. Botha

benh and ATI seem to have fixed the suspension code of the radeon. I have looked at this (see the Radeon bits) and at Patrick Mochel's power management architecture code and documentation and it does look like a lot of this code could be used to make ACPI S3 (suspend to RAM) a reality on Radeon-using laptops.

Hmmm, this might not be AS useful as I thought. Could a pmac expert elaborate on the differences between its suspend and ACPI S3? For S3 we need something that can init the chip almost from scratch.

The concepts are identical - the OS must suspend/resume devices before telling the platform to enter the sleep state. And, the code should be identical. IIRC, the pmac doesn't ever have the liberty of re-POSTing any devices, as the OpenFirmware context is completely lost after booting. In general, the pmac is a few steps ahead of x86 in terms of power management support.

On top of that, Ben is incredibly talented and has the benefit (or curse ;) of knowing both power management and the ATI cards very well.

-pat

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

#15 lore raw
In reply to a message not in the archive
Quoted 1 line · Charl P. Botha

benh and ATI seem to have fixed the suspension code of the radeon.

It is certainly encouraging to see that someone is working on the radeon resume! The following comment calls however for some caution when it comes to hoping that a direct port to an ACPI-based system will work:

* only supports the mobile chips in D2 mode, that is typically what
* is used on Apple laptops,

If I'm guessing correctly, D2 is "clocks off, static registers preserved" while ACPI/S3 certainly means D3 (power off) -> even more device state to be restored.

Quoted 2 lines

I don't have time to look at this right now, but will do so as soon as another lazy weekend comes up.

If you haven't already done so, you might want get access to the ATI docs *before* your lazy weekend...

Quoted 2 lines

If someone else has the time and inclination (Ole Rohne? ;), please go ahead!

I've resolved not to waste more time on it - at least for the moment. And I'm quite happy with the POST-hack - dirty as it might be...

Ole

PS: I've updated the patches at
<http://home.cern.ch/mrohne/P2120/P2120_Linux_S3.html> to linux-2.5.64-bk11 and XFree86-4.3.0. I hope they're OK this time...

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw
Quoted 6 lines · Ole Myren Rohne

* only supports the mobile chips in D2 mode, that is typically what
* is used on Apple laptops,

If I'm guessing correctly, D2 is "clocks off, static registers preserved" while ACPI/S3 certainly means D3 (power off) -> even more device state to be restored.

I thought about something like this, but at least benh's work gives us something to work with.

Quoted 5 lines
Quoted 2 lines

I don't have time to look at this right now, but will do so as soon as another lazy weekend comes up.

If you haven't already done so, you might want get access to the ATI docs *before* your lazy weekend...

Urgh, then I have to become part of the xfree86/dri in-crowd. I don't think this can be easily organised in the near future.

Thanks,
Charl

Signature · 8 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en