Bug 2529 - ATI radeon M7 causes unusable video if switching between X and vt
Summary: ATI radeon M7 causes unusable video if switching between X and vt
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/other (show other bugs)
Version: XOrg git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-12 09:30 UTC by Alessandro Sappia
Modified: 2006-05-09 14:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch against 2.6.10-gentoo-r7 to fix this issue (342 bytes, patch)
2005-02-16 03:43 UTC, Alessandro Sappia
no flags Details | Splinter Review

Description Alessandro Sappia 2005-02-12 09:30:32 UTC
I've noticed that after a suspend to ram or disk
I can't switch between X and vt
if I suspend on vt, on resume switching to X causes hags on video ( I still can
use ssh not connect thru net)
if I suspend on X, on resmue X works but if I switch on vt and then back to X
I've the same effect as above...

I watched some code and I've found a possible solution:
on radeon_cp.c around line 1343 

        radeon_do_engine_reset( dev );
        /* this let a DRI X server to work */
+        radeon_acknowledge_irqs( dev_priv );
+        radeon_do_cp_start( dev_priv );
+        radeon_emit_irq( dev );

        DRM_DEBUG("radeon_do_resume_cp() complete\n");

and this let X work fine...

$ uname -a
Linux phoenix 2.6.10-gentoo-r7 #9 Sat Feb 12 02:25:55 CET 2005 i686 Mobile
Intel(R) Pentium(R) 4 - M CPU 1.90GHz GenuineIntel GNU/Linux

Contect me if you need any other infos..
Comment 1 Andrew D. Keyser 2005-02-14 12:06:25 UTC
I do see this as well, with my Radeon IGP320M (on an HP ze4560us). This doesn't
just have to do with suspending, it's any time when switching between VT and X.
switch to VT, ok, switch to X, hang. ctrl-alt-delete works to reboot it though.

Checking if the suggested patch works now, will report back later today.
Comment 2 Andrew D. Keyser 2005-02-15 05:22:27 UTC
Unfortunatley that doesn't seem to fix it for me. 
Using 6.8.2, Gentoo Linux kernel 2.6.10-gentoo-r7, ATI Mobility Radeon U1
(IGP320M) w/ 64MB Shared Mem, AMD Athlon XP-M 2500+, 512Mb RAM. This issue does
_not_ happen with 6.8.1 stable. Anything newer seems to have the problem.
Comment 3 Alessandro Sappia 2005-02-15 10:33:24 UTC
This patch resolve a bug on acpi resume...
Comment 4 Michel Dänzer 2005-02-15 12:07:48 UTC
(In reply to comment #2)
> Unfortunatley that doesn't seem to fix it for me. 
> Using 6.8.2, Gentoo Linux kernel 2.6.10-gentoo-r7, ATI Mobility Radeon U1
> (IGP320M) w/ 64MB Shared Mem, AMD Athlon XP-M 2500+, 512Mb RAM. This issue does
> _not_ happen with 6.8.1 stable. Anything newer seems to have the problem.

Try removing the RADEONSetFBLocation() call from RADEONAdjustFrame(), see
http://lists.freedesktop.org/archives/xorg/2005-February/006126.html .

(In reply to comment #0)
> 
>         radeon_do_engine_reset( dev );
>         /* this let a DRI X server to work */
> +        radeon_acknowledge_irqs( dev_priv );
> +        radeon_do_cp_start( dev_priv );
> +        radeon_emit_irq( dev );
> 
>         DRM_DEBUG("radeon_do_resume_cp() complete\n");

Does it also work with radeon_acknowledge_irqs() only? The radeon_do_cp_start()
call seems pointless as the X server will start the CP after this ioctl anyway,
and the radeon_emit_irq() call seems pointless.
Comment 5 Andrew D. Keyser 2005-02-15 20:40:33 UTC
The Gentoo patches for xorg already remove that RADEONSetFBLocation(). So that
isn't the problem. Does this deserve a different bug than this or is it probably
the same thing? Really quite annoying not to be able to switch back to X.
Potential data loss if it occurs to an unexpecting user as well.
Comment 6 Michel Dänzer 2005-02-15 20:59:50 UTC
It might be related, but as the original submitter only seems to encounter the
problem on suspend/resume, and his patch doesn't help for you, it's probably
better to track these separately for now.
Comment 7 Alessandro Sappia 2005-02-16 03:26:26 UTC
(In reply to comment #4)
> (In reply to comment #0)
> > 
> >         radeon_do_engine_reset( dev );
> >         /* this let a DRI X server to work */
> > +        radeon_acknowledge_irqs( dev_priv );
> > +        radeon_do_cp_start( dev_priv );
> > +        radeon_emit_irq( dev );
> > 
> >         DRM_DEBUG("radeon_do_resume_cp() complete\n");
> 
> Does it also work with radeon_acknowledge_irqs() only? The radeon_do_cp_start()
> call seems pointless as the X server will start the CP after this ioctl anyway,
> and the radeon_emit_irq() call seems pointless.

Yes.
You're right.
That was the way I obtained Radeon Mobility M7 working, but it work also just
using the radeon_acknowledge_irqs()...
So the radeon_cp_start() and radeon_emit_irq() aren't needed...
suspend/resume from dirsk|ram works fine now...

Thanks.
Comment 8 Alessandro Sappia 2005-02-16 03:43:26 UTC
Created attachment 1912 [details] [review]
patch against 2.6.10-gentoo-r7 to fix this issue
Comment 9 Andrew D. Keyser 2005-02-16 07:47:19 UTC
This looks like it's going to cause problems with the 2.6.11 kernel; there is no
more radeon_acknowledge_irqs anymore. Plus, that patch patches in the wrong spot
on 2.6.11-rc4.

Excuse me for claiming it didn't work before.. I was very tired at the time and
never updated the module..
Comment 10 Andrew D. Keyser 2005-02-16 08:26:05 UTC
ahrg, looks like this won't even work on 2.6.10-gentoo-r7. As I said before
radeon_acknowledge_irqs doesn't exist...
Comment 11 Michel Dänzer 2005-02-16 08:37:29 UTC
(In reply to comment #10)
> ahrg, looks like this won't even work on 2.6.10-gentoo-r7. As I said before
> radeon_acknowledge_irqs doesn't exist...

Wasn't it just made static and needs to be properly exported?
Comment 12 Alessandro Sappia 2005-02-16 08:55:12 UTC
(In reply to comment #10)
> ahrg, looks like this won't even work on 2.6.10-gentoo-r7. As I said before
> radeon_acknowledge_irqs doesn't exist...

so,... why I've this ?

phoenix linux-2.6.10-gentoo-r7 # grep radeon_acknowledge_irqs
drivers/char/drm/radeon_irq.c
static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)
        radeon_acknowledge_irqs( dev_priv );
        radeon_acknowledge_irqs( dev_priv );
        radeon_acknowledge_irqs( dev_priv );
phoenix linux-2.6.10-gentoo-r7 #

furthermore...
I've just taken patch to see 
linux-2.6.11-rc4-bk4 and I see that radeon_acknowledge_irqs() exists...

I don't know if bk4 has latest DRI...
?!?!??
I'm little confused... I see that function on gentoo-dev-sources-2.6.10-r7 and 
I still see the same function on 2.6.11-rc4-bk4...
so what's the matter ?
Comment 13 Erik Andren 2006-05-10 06:32:44 UTC
Alessandro, lets start from the beginning. Are you still experiencing this using
a modern version of xorg? Also, are you using the radeon framebuffer?
Comment 14 Alessandro Sappia 2006-05-10 07:40:42 UTC
(In reply to comment #13)
> Alessandro, lets start from the beginning. Are you still experiencing this using
> a modern version of xorg? Also, are you using the radeon framebuffer?

this is my actual results:

$ X -version

X Window System Version 7.0.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 7.0
Build Operating System:Linux 2.6.16-gentoo-r4 i686
Current Operating System: Linux phoenix 2.6.16-gentoo-r4 #2 PREEMPT Thu Apr 27
02:27:46 CEST 2006 i686
Build Date: 04 May 2006
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present

$ uname -a
Linux phoenix 2.6.16-gentoo-r4 #2 PREEMPT Thu Apr 27 02:27:46 CEST 2006 i686
Mobile Intel(R) Pentium(R) 4 - M CPU 1.90GHz GNU/Linux

At this point (except that I cannot resuspend twice or more) I got video working
on resume (both disk and ram) and can successfully fwitch between radeonfb
consoles and X (with radeon driver)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.