Dell D600: teaching radeonfb how to wake up...
Hi all.
I'm one of the many folks not really delighted with my dell d600's behaviour w/ acpi.
I'm running 2.6.0-test9 ; S1 works more or less, if you care to shut down usb and network before.
S3 works halfway. Meaning the ``going to sleep'' part works ;). USB is completely dead on bootup (megabytes of ``host controller halted'' messages), but that's not my #1 concern. My #1 concern is the radeon 9000 (M9) graphics card, which doesn't come up (fortunately, network is relatively polite, and enables me to investigate). I'm not even talking graphic mode.
There has been some short threads on the topic on this list before ( http://sourceforge.net/mailarchive/message.php?msg_id=6162540 ).
s3_mode and s3_bios reboot the box on wakeup.
There seems to be no other choice but to manually wake up & reprogram the device. And to get the docs (I'm discussing with /dev/null at ati.com on that. Maybe /dev/null, or some alternate source, will provide me with a bit of info. Maybe).
Fortunately, the kernel tree contains bits of code which can be useful. All the registers are known by name and number, for example (and it's a pity that the documentation about the ``PWR_MAN'' register is inexistent). And the radeonfb driver contains a few things and hints. I'd gladly try a piece of code, supposedly coming from ATI, which ought to reset the device somehow. This piece of code was to be linked to the powerbook power management system, and is #if0'ed anyway since it is quoted to be no cure for some problem. Still, I think it's worth trying.
I'm not an expert on kernel programming. On which code paths should I plug things ? Say I have to functions radeon_go_sleep and radeon_wake_up, what device info can I expect to access, and where should I plug my functions ? Does anybody know of a well-educated fb driver, where such a manual reset of the device is done on wakeup. I could follow this as an example.
E.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thus wrote Emmanuel Thomé:
Quoted 6 lines
S3 works halfway. Meaning the ``going to sleep'' part works ;). USB is completely dead on bootup (megabytes of ``host controller halted'' messages), but that's not my #1 concern. My #1 concern is the radeon 9000 (M9) graphics card, which doesn't come up (fortunately, network is relatively polite, and enables me to investigate). I'm not even talking graphic mode.
I thought framebuffer was considered "graphic mode", wasn't it? Anyway, contact Benjamin Herrenschmidt (lkml arschives), he's the one doing a major rework of radeonfb for 2.6, so he might be able to help.
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031119194303.GA16571-DETuoxkZsSqrDJvtcaxF/[email protected]
Quoted 9 lines · Karol Kozimor
Thus wrote Emmanuel Thomé:
Quoted 6 lines
S3 works halfway. Meaning the ``going to sleep'' part works ;). USB is completely dead on bootup (megabytes of ``host controller halted'' messages), but that's not my #1 concern. My #1 concern is the radeon 9000 (M9) graphics card, which doesn't come up (fortunately, network is relatively polite, and enables me to investigate). I'm not even talking graphic mode.
I thought framebuffer was considered "graphic mode", wasn't it? Anyway,
Granted. I meant ``I'm not yet trying to handle the case where X comes to play''.
The fact that radeonfb is loaded or not does not make a big difference anyway. It would, if eventually the radeonfb driver were able to talk the right language to the device. Which is something I'm not going to expect from vesafb. Proper acpi power management would be a dramatic feature to add to radeonfb...
Quoted 2 lines
contact Benjamin Herrenschmidt (lkml arschives), he's the one doing a major rework of radeonfb for 2.6, so he might be able to help.
yup, done that a few moments ago. I'll be glad if he answers email.
E.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thus wrote Emmanuel Thome:
Quoted 3 lines
The fact that radeonfb is loaded or not does not make a big difference anyway. It would, if eventually the radeonfb driver were able to talk the right language to the device. Which is something I'm not going to expect
Right.
Quoted 2 lines
from vesafb. Proper acpi power management would be a dramatic feature to add to radeonfb...
I'm not sure I fully understand, but I think it's not really that complicated -- all you need is the radeonfb driver to receive the suspend request using standard driver model, and power down the graphic adapter using standard PCI methods, or do any card-specific wizardry, which, as you implied, should not be difficult to implement. A similar thing should be done at resume et voila, you get the display back on.
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 20 lines · Emmanuel Thome
Quoted 9 lines · Karol Kozimor
Thus wrote Emmanuel Thomé:
Quoted 6 lines
S3 works halfway. Meaning the ``going to sleep'' part works ;). USB is completely dead on bootup (megabytes of ``host controller halted'' messages), but that's not my #1 concern. My #1 concern is the radeon 9000 (M9) graphics card, which doesn't come up (fortunately, network is relatively polite, and enables me to investigate). I'm not even talking graphic mode.
I thought framebuffer was considered "graphic mode", wasn't it? Anyway,
Granted. I meant ``I'm not yet trying to handle the case where X comes to play''.
The fact that radeonfb is loaded or not does not make a big difference anyway. It would, if eventually the radeonfb driver were able to talk the right language to the device. Which is something I'm not going to expect from vesafb. Proper acpi power management would be a dramatic feature to add to radeonfb...
Quoted 4 lines
Quoted 2 lines
contact Benjamin Herrenschmidt (lkml arschives), he's the one doing a major rework of radeonfb for 2.6, so he might be able to help.
yup, done that a few moments ago. I'll be glad if he answers email.
radeonfb contains suspend/resume code for pmac, written by some ATI folks (at least on the 2.4 benh kernels, and certainly in his 2.6 bk tree), so I guess you can start with (looking the code, you will see some ref. to ACPI, even though it is for pmac..). Also, dri cvs have some interresting stuff as well.
Signature · 11 lines
Ducrot Bruno -- Which is worse: ignorance or apathy? -- Don't know. Don't care. ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Hi!
Quoted 9 lines
Fortunately, the kernel tree contains bits of code which can be useful. All the registers are known by name and number, for example (and it's a pity that the documentation about the
__PWR_MAN'' register is inexistent). And the radeonfb driver contains a few things and hints. I'd gladly try a piece of code, supposedly coming from ATI, which ought to reset the device somehow. This piece of code was to be linked to the powerbook power management system, and is #if0'ed anyway since it is quoted to be no cure for some problem. Still, I think it's worth trying.
Quoted 6 lines
I'm not an expert on kernel programming. On which code paths should I plug things ? Say I have to functions
radeon_go_sleepandradeon_wake_up, what device info can I expect to access, and where should I plug my functions ? Does anybody know of a well-educated fb driver, where such a manual reset of the device is done on wakeup. I could follow this as an example.
If I were you, I'd create fix_ati.o module which would "do the stuff", then insert it over network. That should make debugging easier...
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: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 1069370504.705.32.camel@gaston
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 8 lines
Quoted 3 lines
If I were you, I'd create fix_ati.o module which would "do the stuff", then insert it over network. That should make debugging easier...
Nah, we really have to re-POST the chip. I don't know how we are supposed to do that though. Either we'll have to have the full POST code for a bunch of ATI chips around, which doesn't seem reasonable and I don't think windows drivers do that, or
Well, if he wants to do the work for his concrete ATI chip, its fine with me, and I'd like to see the results.
Having fix_ati.o module is certainly easier than playing with driver model for testing...
Pavel
Signature · 9 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031120234708.GA431-I/[email protected]
Quoted 11 lines · Pavel Machek
Hi!
Quoted 8 lines
Quoted 3 lines
If I were you, I'd create fix_ati.o module which would "do the stuff", then insert it over network. That should make debugging easier...
Nah, we really have to re-POST the chip. I don't know how we are supposed to do that though. Either we'll have to have the full POST code for a bunch of ATI chips around, which doesn't seem reasonable and I don't think windows drivers do that, or
Quoted 5 lines
Well, if he wants to do the work for his concrete ATI chip, its fine with me, and I'd like to see the results.
Having fix_ati.o module is certainly easier than playing with driver model for testing...
My point is that he can probably NOT do the work, POSTing such a chip is hell. I'm trying to figure out how we are supposed to do, that is how ATI does with their own windows drivers ...
Ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thus wrote Benjamin Herrenschmidt:
Quoted 2 lines
My point is that he can probably NOT do the work, POSTing such a chip is hell. I'm trying to figure out how we are supposed to do,
Then how is Xfree86 doing that? I'm not sure if it's the whole chip that gets POSTed, or only the 3D engine, but something definitely is done at VT switch for the radeon driver (note: DRM module must be at least 1.9.0 and the XFree part must also be recent).
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031121123239.GB9973-DETuoxkZsSqrDJvtcaxF/[email protected]
Quoted 8 lines · Karol Kozimor
Thus wrote Benjamin Herrenschmidt:
Quoted 2 lines
My point is that he can probably NOT do the work, POSTing such a chip is hell. I'm trying to figure out how we are supposed to do,
Then how is Xfree86 doing that? I'm not sure if it's the whole chip that gets POSTed, or only the 3D engine, but something definitely is done at VT switch for the radeon driver (note: DRM module must be at least 1.9.0 and the XFree part must also be recent).
It's not posting, it's reprogramming some of the firmware and basically doing a hardware re-init. This re-init assumes that a POST has already been done, as in after an S4 resume.
Signature · 10 lines
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/ ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 9 lines · Karol Kozimor
Thus wrote Benjamin Herrenschmidt:
Quoted 2 lines
My point is that he can probably NOT do the work, POSTing such a chip is hell. I'm trying to figure out how we are supposed to do,
Then how is Xfree86 doing that? I'm not sure if it's the whole chip that gets POSTed, or only the 3D engine, but something definitely is done at VT switch for the radeon driver (note: DRM module must be at least 1.9.0 and the XFree part must also be recent).
Best regards,
It's the whole chip, and I think an XFree based solution isn't an option as the kernel own console would die on a non-POSTed chip before XFree has a chance to kick in anyway.
Ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 11 lines · Pavel Machek
Hi!
Quoted 8 lines
Quoted 3 lines
If I were you, I'd create fix_ati.o module which would "do the stuff", then insert it over network. That should make debugging easier...
Nah, we really have to re-POST the chip. I don't know how we are supposed to do that though. Either we'll have to have the full POST code for a bunch of ATI chips around, which doesn't seem reasonable and I don't think windows drivers do that, or
Quoted 6 lines
Well, if he wants to do the work for his concrete ATI chip, its fine with me, and I'd like to see the results.
Having fix_ati.o module is certainly easier than playing with driver model for testing...
Pavel
Certainly, it would be of great value, even if the finally chosen path is to do the POST code. If I recall recent discussions about this on the list, a couple of folks seem to prefer this ``hard way'' than the real mode/int10 stuff, for reasons I understand.
Still, as you (Pavel) have yourself remarked, video chips suffering from this unconfigured wake-up disease are tantamount. It could even be the case of _most_ chips. If an interface for calling real mode stuff makes it possible to cure, say half of these graphics cards for x86 laptops, then that's not bad at all.
OTOH, even if the windows ati drivers do not fully repost the chip, the MacOS drivers possibly _do_ such a thing, don't they ? Or do they really get by using D2 state always ? Ben ?
E.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 12 lines
Certainly, it would be of great value, even if the finally chosen path is to do the POST code. If I recall recent discussions about this on the list, a couple of folks seem to prefer this ``hard way'' than the real mode/int10 stuff, for reasons I understand.
Still, as you (Pavel) have yourself remarked, video chips suffering from this unconfigured wake-up disease are tantamount. It could even be the case of _most_ chips. If an interface for calling real mode stuff makes it possible to cure, say half of these graphics cards for x86 laptops, then that's not bad at all.
Quoted 3 lines
OTOH, even if the windows ati drivers do not fully repost the chip, the MacOS drivers possibly _do_ such a thing, don't they ? Or do they really get by using D2 state always ? Ben ?
ATI drivers on Mac do re-POST most chips except the few earlier laptops and iMacs which only needed D2 mode. All "desktops" cards need re-POST (Desktops Macs will shut down the power to the PCI/AGP slots when going to sleep) and latest laptops models need that too.
I just have confirmation from ATI contacts that their Windows driver knows how to re-POST all chips on wakeup, it doesn't rely on BIOS services. They might help us get something into shape for Linus but it will take time.
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 5 lines
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Look at arch/i386/kernel/acpi/wakeup.S code. It attempts to do real-mode reinitialization (if you pass right acpi_sleep= paramater), but it only works for some people.
If it is possible to improve that real-mode code to work more people, feel free to send patches.
[I now have another machine -- arima notebook -- where none of current methods works. I'll need to look at it closely.]
Pavel
Signature · 9 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031124173603.GA298-I/[email protected]
Quoted 12 lines · Pavel Machek
Hi!
Quoted 5 lines
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Look at
arch/i386/kernel/acpi/wakeup.Scode. It attempts to do real-mode reinitialization (if you pass right acpi_sleep= paramater), but it only works for some people.
Quoted 5 lines
If it is possible to improve that real-mode code to work more people, feel free to send patches.
[I now have another machine -- arima notebook -- where none of current methods works. I'll need to look at it closely.]
Well, I did a quick look only, I'm a bit dumb with x86 assembly, but it looks you are only trying to call VESA for setting a mode, not doing a full POST of the card
Ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 13 lines
Quoted 13 lines
Quoted 5 lines
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Look at
arch/i386/kernel/acpi/wakeup.Scode. It attempts to do real-mode reinitialization (if you pass right acpi_sleep= paramater), but it only works for some people.If it is possible to improve that real-mode code to work more people, feel free to send patches.
Quoted 6 lines
Quoted 2 lines
[I now have another machine -- arima notebook -- where none of current methods works. I'll need to look at it closely.]
Well, I did a quick look only, I'm a bit dumb with x86 assembly, but it looks you are only trying to call VESA for setting a mode, not doing a full POST of the card
Yes, that's what I'm optionaly doing, but I'm also (optionally) doing:
testl $1, video_flags - wakeup_code
jz 1f
lcall $0xc000,$3
movw %cs, %ax
movw %ax, %ds # Biosmight have played with that
movw %ax, %ss
1:
...that should be POST(?)
Pavel
Signature · 9 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031125120443.GA297-I/[email protected]
Quoted 29 lines · Pavel Machek
Hi!
Quoted 13 lines
Quoted 13 lines
Quoted 5 lines
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Look at
arch/i386/kernel/acpi/wakeup.Scode. It attempts to do real-mode reinitialization (if you pass right acpi_sleep= paramater), but it only works for some people.If it is possible to improve that real-mode code to work more people, feel free to send patches.
Quoted 6 lines
Quoted 2 lines
[I now have another machine -- arima notebook -- where none of current methods works. I'll need to look at it closely.]
Well, I did a quick look only, I'm a bit dumb with x86 assembly, but it looks you are only trying to call VESA for setting a mode, not doing a full POST of the card
Yes, that's what I'm optionaly doing, but I'm also (optionally) doing:
testl $1, video_flags - wakeup_code jz 1f lcall $0xc000,$3 movw %cs, %ax movw %ax, %ds # Bios
Quoted 8 lines
might have played with that
movw %ax, %ss
1:...that should be POST(?)
PavelFrom Ralph Brown interrupt list:
--------V--/YfH7FhGJxf49RI1O+iZ8Pj1EjU76Jnw+PUSNTvomfDsgDyMMLuEDg@public.gmane.org CALL C000h:0003h - VIDEO BIOS INITIALIZATION
InstallCheck: C000h:0000h must contain the word AA55h and the
512*BYTE[C000h:0002h] bytes must sum to 00h (mod 256)
Note: is normally called only by the System ROM BIOS initialization code
In fact, this is a general method to POST any card if you know the location of the ROM in the EISA space.
Signature · 11 lines
Ducrot Bruno -- Which is worse: ignorance or apathy? -- Don't know. Don't care. ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 36 lines
Quoted 27 lines
Quoted 13 lines
Quoted 13 lines
Quoted 5 lines
In the meantime, if we can (not sure about it) call back into the BIOS when waking up (Andi seemed to imply we are in real mode when getting out of sleep), we may just use int10 to hard re-POST video cards at this point. We must also make sure we do that for the AGP bridge if possible.
Look at
arch/i386/kernel/acpi/wakeup.Scode. It attempts to do real-mode reinitialization (if you pass right acpi_sleep= paramater), but it only works for some people.If it is possible to improve that real-mode code to work more people, feel free to send patches.
Quoted 6 lines
Quoted 2 lines
[I now have another machine -- arima notebook -- where none of current methods works. I'll need to look at it closely.]
Well, I did a quick look only, I'm a bit dumb with x86 assembly, but it looks you are only trying to call VESA for setting a mode, not doing a full POST of the card
Yes, that's what I'm optionaly doing, but I'm also (optionally) doing:
testl $1, video_flags - wakeup_code jz 1f lcall $0xc000,$3 movw %cs, %ax movw %ax, %ds # BiosQuoted 8 lines
might have played with that
movw %ax, %ss
1:...that should be POST(?)
PavelFrom Ralph Brown interrupt list:
Quoted 8 lines
--------V--/YfH7FhGJxf49RI1O+iZ8Pj1EjU76Jnw+PUSNTvomfDsgDyMMLuEDg@public.gmane.org CALL C000h:0003h - VIDEO BIOS INITIALIZATION
InstallCheck: C000h:0000h must contain the word AA55h and the512*BYTE[C000h:0002h] bytes must sum to 00h (mod 256)Note: is normally called only by the System ROM BIOS initialization code
In fact, this is a general method to POST any card if you know the location of the ROM in the EISA space.
That's what I'm doing, but it crashes machine on most machines. Perhaps PCI needs to be already initialized at this point or something like that?
Pavel
Signature · 9 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): 20031126223436.GD207-I/[email protected]
Quoted 4 lines
That's what I'm doing, but it crashes machine on most machines. Perhaps PCI needs to be already initialized at this point or something like that?
Yes, what I've been told is that you need to have re-initialized the AGP slot first, which may need yet another BIOS driver to POST, or some ACPI wakeup thingy (re-initializing the AGP bridge means in some case filling some non-documented registers with proper timing & clock skew values etc...)
Ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Quoted 3 lines · Pavel Machek
That's what I'm doing, but it crashes machine on most machines. Perhaps PCI needs to be already initialized at this point or something like that?
In fact, I don't think that POST is a good idea anyway (we had alerady that discussion). It's way too early in the resume path. Perhaps POSTing after PCI subsystem wakeup may help, but then you may have to go with int 10 instead (and that will be pretty hard to do that in kernel space).
Signature · 11 lines
Ducrot Bruno -- Which is worse: ignorance or apathy? -- Don't know. Don't care. ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Ducrot Bruno
Quoted 3 lines · Pavel Machek
That's what I'm doing, but it crashes machine on most machines. Perhaps PCI needs to be already initialized at this point or something like that?
In fact, I don't think that POST is a good idea anyway (we had alerady that discussion). It's way too early in the resume path. Perhaps POSTing after PCI subsystem wakeup may help, but then you may have to go with int 10 instead (and that will be pretty hard to do that in kernel space).
Well... we have to POST the card one way or another. So unless ATI provides us with the complete POST code for all of their chipset revisions, which may never happen, we are stuck with using the BIOS POST facility.
However, I think Pavel is right here, we should probably restore the PCI bus (and AGP !) completely before attempting that. Which means we'll probably have to add a facility to x86 to go back to real mode run that dawn int10 thing.
Something else we need on x86 (I need that at least in radeonfb), provided that doesn't exist already, is a small hook in the PCI code at probe time that "detects" which VGA PCI chbip had IO decoding enabled, that is which one is the primary one.
I need that in order to properly retreive some tables, as on a bunch of laptops, the video BIOS ROM isn't accessible on the PCI ROM BAR of the card. So I need to check when dealing with the primary card and peek at the BIOS image at c0000 instead of the PCI ROM.
ben.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): yzo1xs3ijgr.fsf-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
Then you've hacked the thing way further than its current state, at least... Would you mind sharing your code ?
E.
Quoted 7 lines · On Thu, Nov 20, 2003 at 08:32:04AM +0100…
I've done similar exercises on my Fujitsu P2120 (it's an M6), and I concluded that the card needed to go through the BIOS POST sequence, but for some reason
s3_bioscannot be used. I tried backporting the powerbook code, with no result except a hanging computer. I suspect even ATI docs wouldn't help as they "provide" the BIOS for this purpose.
Quoted 8 lines
I eventuall hacked it using the vm86 emulator that comes with XFree86, plugging in a call to BIOS POST when switching virtual console; kind of ugly but it worked. I think I also needed some PCI hackery in the radeonfb resume code, not sure if that made it back into the 2.6.0 kernel. I haven't been able to play with it at all lately as my machine reboots on S3 resume with recent kernels.
Regards, Ole
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/
Great big thanks ! Works for me as well (the int10 part for xfree ; haven't tried fb code yet. According to benh, restoring pci state as you do is likely not to help much).
I suggest you update your patch for the xf86 driver as in the attached patch, still. The reason is that I've experienced failed int10 POSTs when they turn out to be useless. There are many registers to choose from if one wants to decide whether the card is at D3cold or not. CONFIG_MEMSIZE being zero is just a reasonable guess IMHO.
Many thanks,
E.
P.S for acpi-devel folks: compiled a radeon_drv.o for XFree86-4.3.0 ; it's available at http://www.loria.fr/~thome/radeon_drv.o.gz
Quoted 7 lines · On Thu, Nov 20, 2003 at 08:32:04AM +0100…
I've done similar exercises on my Fujitsu P2120 (it's an M6), and I concluded that the card needed to go through the BIOS POST sequence, but for some reason
s3_bioscannot be used. I tried backporting the powerbook code, with no result except a hanging computer. I suspect even ATI docs wouldn't help as they "provide" the BIOS for this purpose.
Quoted 8 lines
I eventuall hacked it using the vm86 emulator that comes with XFree86, plugging in a call to BIOS POST when switching virtual console; kind of ugly but it worked. I think I also needed some PCI hackery in the radeonfb resume code, not sure if that made it back into the 2.6.0 kernel. I haven't been able to play with it at all lately as my machine reboots on S3 resume with recent kernels.
Regards, Ole
ati/radeon_driver.c renamed from usr/X11R6/lib/Server/drivers/ati/radeon_driver.c +14 -0
@@ -345,6 +345,7 @@"xf86InitInt10" ,"xf86FreeInt10" ,"xf86int10Addr" , +"xf86ExecX86int10" , NULL };
@@ -6409,9 +6410,22 @@ {ScrnInfoPtr pScrn = xf86Screens[scrnIndex];RADEONInfoPtr info =RADEONPTR (pScrn); +unsigned char *RADEONMMIO = info->MMIO;RADEONTRACE (("RADEONEnterVT\n" )); +if (INREG (RADEON_CONFIG_MEMSIZE ) ==0 ) {/* Softboot V_BIOS */ +xf86Int10InfoPtr pInt; +xf86DrvMsg (pScrn->scrnIndex,X_WARNING , +"zero MEMSIZE, probably at D3cold. Re-POSTing via int10.\n" ); + pInt =xf86InitInt10 (info->pEnt->index); +if (pInt) { + pInt->num =0xe6 ; +xf86ExecX86int10 (pInt); +xf86FreeInt10 (pInt); + } + } +if (info->FBDev) {unsigned char *RADEONMMIO = info->MMIO;if (!fbdevHWEnterVT (scrnIndex,flags))return FALSE;
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 3 lines
Great big thanks ! Works for me as well (the int10 part for xfree ; haven't tried fb code yet. According to benh, restoring pci state as you do is likely not to help much).
Does this mean that we should call int 0x10 with ah=0xe6 to correctly initialize video?
Pavel
Quoted 15 lines
ati/radeon_driver.c renamed from usr/X11R6/lib/Server/drivers/ati/radeon_driver.c +12
-0+if (INREG (RADEON_CONFIG_MEMSIZE ) ==0 ) {/* Softboot V_BIOS */ +xf86Int10InfoPtr pInt; +xf86DrvMsg (pScrn->scrnIndex,X_WARNING , +"zero MEMSIZE, probably at D3cold. Re-POSTing via int10.\n" ); + pInt =xf86InitInt10 (info->pEnt->index); +if (pInt) { + pInt->num =0xe6 ; +xf86ExecX86int10 (pInt); +xf86FreeInt10 (pInt); + } + } +if (info->FBDev) {unsigned char *RADEONMMIO = info->MMIO;if (!fbdevHWEnterVT (scrnIndex,flags))return FALSE;
Signature · 9 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/