Skip to contentSkip to conversation

Radeon FB troubles with recent kernels

DISCUSSION Matt Mackall 3 participants 7 messages Feb 14, 2005 – Feb 15, 2005

lore
Share & tools
lore
#0 lore raw

On my Thinkpad T30 with a Radeon Mobility M7 LW, I get interesting console video corruption if I start GDM, switch back to text mode, then stop it again. X is Xfree86 from Debian/unstable or X.org 6.8.2.

The corruption shows up whenever the console scrolls after X has been shut down and manifests as horizontal lines spaced about 4 pixel rows apart containing contents recognizable as the X display. Switch from vt1 to vt2 and back or visual bell clears things back to normal, but corruption will reappear on the next scroll.

This has appeared in at least 2.6.11-rc3-mm2 and rc4.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#1 lore raw
Quoted 11 lines · Matt Mackall

On my Thinkpad T30 with a Radeon Mobility M7 LW, I get interesting console video corruption if I start GDM, switch back to text mode, then stop it again. X is Xfree86 from Debian/unstable or X.org 6.8.2.

The corruption shows up whenever the console scrolls after X has been shut down and manifests as horizontal lines spaced about 4 pixel rows apart containing contents recognizable as the X display. Switch from vt1 to vt2 and back or visual bell clears things back to normal, but corruption will reappear on the next scroll.

This has appeared in at least 2.6.11-rc3-mm2 and rc4.

Appeared ? hah... that's strange. X is known to fuck up the chip when quit, but I wouldn't have expected any change due to the new version of radeonfb. From what you describe, it looks like an offset register is changed by X, or the surface control.

My patch did not change any of radeonfb accel code though...

I'll catch up with you on IRC ...

Ben.

#2 lore raw
Quoted 9 lines

Appeared ? hah... that's strange. X is known to fuck up the chip when quit, but I wouldn't have expected any change due to the new version of radeonfb. From what you describe, it looks like an offset register is changed by X, or the surface control.

My patch did not change any of radeonfb accel code though...

I'll catch up with you on IRC ...

Ok, from our discussions, it's not related to the power management code, and an engine reset triggered by fbset fixes it. So at this point, I can see no change in the driver explaining it...

We did some changes to the VT layer to force a mode setting (and thus an engine reset) when going away from X, so I can't see why that wouldn't work, while using fbset later on works ... this goes through the same code path in the driver... unless we are facing a timing issue...

X is known to play funny tricks, like touching the engine when it's in the background (not frontmost VT) and quit, or possibly other bad things on console switch. Maybe I changed enough delays (speeded up) the mode switch so that we fall into a case where X has not finished mucking up with us...

Can you try adding some msleep(200) or so at the beginning at radeonfb_set_par() or radeon_write_mode() to see if that makes any difference ?

Some printk's in there would help to... I expect calls to radeon_engine_init() to fix it and such a call is present in the mode restore unless accel is disabled...

Can you check what's happening ?

Ben.

#3 lore raw
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 8 lines

Appeared ? hah... that's strange. X is known to fuck up the chip when quit, but I wouldn't have expected any change due to the new version of radeonfb. From what you describe, it looks like an offset register is changed by X, or the surface control.

My patch did not change any of radeonfb accel code though...

I'll catch up with you on IRC ...

Quoted 8 lines

Ok, from our discussions, it's not related to the power management code, and an engine reset triggered by fbset fixes it. So at this point, I can see no change in the driver explaining it...

We did some changes to the VT layer to force a mode setting (and thus an engine reset) when going away from X, so I can't see why that wouldn't work, while using fbset later on works ... this goes through the same code path in the driver... unless we are facing a timing issue...

You can also try inserting something like this before register_framebuffer()

info->flags |= FBINFO_MISC_MODESWITCHLATE;

to delay the call to set_par as late as possible. It's the same hack used in rivafb, but there were reports before that it does not work with a few radeon setups.

Tony

Quoted 18 lines

X is known to play funny tricks, like touching the engine when it's in the background (not frontmost VT) and quit, or possibly other bad things on console switch. Maybe I changed enough delays (speeded up) the mode switch so that we fall into a case where X has not finished mucking up with us...

Can you try adding some msleep(200) or so at the beginning at radeonfb_set_par() or radeon_write_mode() to see if that makes any difference ?

Some printk's in there would help to... I expect calls to radeon_engine_init() to fix it and such a call is present in the mode restore unless accel is disabled...

Can you check what's happening ?

Ben.

#4 lore raw
In reply to Benjamin Herrenschmidt
Quoted 25 lines · Benjamin Herrenschmidt
Quoted 9 lines

Appeared ? hah... that's strange. X is known to fuck up the chip when quit, but I wouldn't have expected any change due to the new version of radeonfb. From what you describe, it looks like an offset register is changed by X, or the surface control.

My patch did not change any of radeonfb accel code though...

I'll catch up with you on IRC ...

Ok, from our discussions, it's not related to the power management code, and an engine reset triggered by fbset fixes it. So at this point, I can see no change in the driver explaining it...

We did some changes to the VT layer to force a mode setting (and thus an engine reset) when going away from X, so I can't see why that wouldn't work, while using fbset later on works ... this goes through the same code path in the driver... unless we are facing a timing issue...

X is known to play funny tricks, like touching the engine when it's in the background (not frontmost VT) and quit, or possibly other bad things on console switch. Maybe I changed enough delays (speeded up) the mode switch so that we fall into a case where X has not finished mucking up with us...

Quoted 3 lines

Can you try adding some msleep(200) or so at the beginning at radeonfb_set_par() or radeon_write_mode() to see if that makes any difference ?

Nope. No printk outputs from _set_par, _write_mode, or _engine_init.

Just to clarify: the gdm stop is done from tty1 while gdm is running on tty7, so I don't think it's a matter of mode switch logic.

If I do "sleep 5; /etc/init.d/gdm stop" and then switch to tty7 and wait for it to stop, all is fine.

Also, I'm still seeing the LCD blooming + hang on starting radeonfb. It's something like 1 in 10 boots rather than every boot now though.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#5 lore raw
Quoted 5 lines

Nope. No printk outputs from _set_par, _write_mode, or _engine_init.

Just to clarify: the gdm stop is done from tty1 while gdm is running on tty7, so I don't think it's a matter of mode switch logic.

Ohhh, this is a known bug then. When you kill X while it's not on the front VT, it will crap on the engine. This has always been the case, I suppose that if you didn't notice it before, it 's because you are lucky :)

Quoted 2 lines

If I do "sleep 5; /etc/init.d/gdm stop" and then switch to tty7 and wait for it to stop, all is fine.

Yes.

Quoted 3 lines

Also, I'm still seeing the LCD blooming + hang on starting radeonfb. It's something like 1 in 10 boots rather than every boot now though.

Does it actually hangs ? That's weird... looks like a chip crash. Can you check if that happens with radeonfb.default_dynclk=-1 on the kernel command line ?

Ben.

#6 lore raw
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 5 lines

Nope. No printk outputs from _set_par, _write_mode, or _engine_init.

Just to clarify: the gdm stop is done from tty1 while gdm is running on tty7, so I don't think it's a matter of mode switch logic.

Ohhh, this is a known bug then. When you kill X while it's not on the front VT, it will crap on the engine. This has always been the case, I suppose that if you didn't notice it before, it 's because you are lucky :)

I think I noticed it in the course of testing recent fbdev and console code changes..

Quoted 6 lines
Quoted 2 lines

Also, I'm still seeing the LCD blooming + hang on starting radeonfb. It's something like 1 in 10 boots rather than every boot now though.

Does it actually hangs ? That's weird... looks like a chip crash. Can you check if that happens with radeonfb.default_dynclk=-1 on the kernel command line ?

Hard to say, it's rather a pain to reproduce. I can add that to my default boot and if it shows up again, I'll let you know.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.