Bug 8038 - Wobbly image on Radeon Mobility X700 (RV410)
Summary: Wobbly image on Radeon Mobility X700 (RV410)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: 7.1 (2006.05)
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-27 22:43 UTC by Martijn van de Streek
Modified: 2007-12-13 23:18 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log for X 6.8.2 + ati experiencing this (48.04 KB, patch)
2006-09-05 22:26 UTC, Martijn van de Streek
no flags Details | Splinter Review
Same log, but using fglrx (which does not experience the bug) (36.62 KB, text/x-log)
2006-09-05 22:28 UTC, Martijn van de Streek
no flags Details
Register dump (made with radeontool) of broken situation (13.43 KB, application/octet-stream)
2006-09-05 22:28 UTC, Martijn van de Streek
no flags Details
Register dump (made with radeontool) of working situation (fglrx driver) (13.43 KB, application/octet-stream)
2006-09-05 22:29 UTC, Martijn van de Streek
no flags Details
Xorg.conf (broken edition; working only replaces ati with fglrx) (4.36 KB, application/octet-stream)
2006-09-05 22:34 UTC, Martijn van de Streek
no flags Details
Xorg.log using current 'ati' driver (broken/wobbly) (52.61 KB, application/octet-stream)
2006-09-05 22:35 UTC, Martijn van de Streek
no flags Details
Xorg.log using current 'fglrx' driver (working) (47.05 KB, application/octet-stream)
2006-09-05 22:35 UTC, Martijn van de Streek
no flags Details
The requested BIOS of my broken ATI (56.50 KB, application/octet-stream)
2007-06-01 01:59 UTC, Martijn van de Streek
no flags Details
The video bios of a laptop with the same card, but working video (56.50 KB, application/octet-stream)
2007-06-01 02:01 UTC, Martijn van de Streek
no flags Details
radeondump-dump, using fglrx driver (5.83 KB, application/octet-stream)
2007-06-22 23:14 UTC, Martijn van de Streek
no flags Details
radeondump dump, made using the radeon driver, after using fglrx (5.83 KB, application/octet-stream)
2007-06-22 23:15 UTC, Martijn van de Streek
no flags Details
radeondump, using the radeon driver, cold boot (5.83 KB, application/octet-stream)
2007-06-22 23:15 UTC, Martijn van de Streek
no flags Details
radeondump dump, after first radeondump fixed things (5.83 KB, application/octet-stream)
2007-06-22 23:17 UTC, Martijn van de Streek
no flags Details
radeontool regmatch \* output, after fixing using radeondump (14.58 KB, application/octet-stream)
2007-06-23 02:46 UTC, Martijn van de Streek
no flags Details
possible fix (1.14 KB, patch)
2007-12-13 21:32 UTC, Alex Deucher
no flags Details | Splinter Review

Description Martijn van de Streek 2006-08-27 22:43:10 UTC
Ever since I got my laptop, X (or rather, the 'ati' driver) has been behaving
weirdly on it. The screen seems to 'wobble' and miss output lines.

Everything works fine using the proprietarty ATI drievr (fglrx).

I've already extensively probed for the cause of the problem, but had no luck.
The results are on:
https://launchpad.net/distros/ubuntu/+source/xserver-xorg-video-ati/+bug/20283

A video of the breakage: http://foodfight.org/zut/ati-breakage.ogg
Comment 1 Chris Lee 2006-09-05 13:30:25 UTC
Please specify more information. Try attaching your xorg.conf and Xorg.0.log
files. Also, any other relevant information would be useful - Linux
distribution, installation method, compiler version (if you compiled from source)...
Comment 2 Martijn van de Streek 2006-09-05 22:18:48 UTC
All the information you requested is already on the launchpad.net link (Xorg log
files, radeon register dumps, config files, everything).

I used the Ubuntu versions of X. I've had this bug for over a year now.

Latest versions I've had the problem with:

- Xorg 7.1.1
- 'ati' driver 6.6.2. both with and without the patch from #5473

All compiled on the latest Ubuntu (Edgy):
gcc version 4.1.2 20060903 (prerelease) (Ubuntu 4.1.1-13ubuntu1)
Comment 3 Martijn van de Streek 2006-09-05 22:26:52 UTC
Created attachment 6834 [details] [review]
Xorg.0.log for X 6.8.2 + ati experiencing this
Comment 4 Martijn van de Streek 2006-09-05 22:28:05 UTC
Created attachment 6835 [details]
Same log, but using fglrx (which does not experience the bug)
Comment 5 Martijn van de Streek 2006-09-05 22:28:41 UTC
Created attachment 6836 [details]
Register dump (made with radeontool) of broken situation
Comment 6 Martijn van de Streek 2006-09-05 22:29:20 UTC
Created attachment 6837 [details]
Register dump (made with radeontool) of working situation (fglrx driver)
Comment 7 Martijn van de Streek 2006-09-05 22:34:41 UTC
Created attachment 6838 [details]
Xorg.conf (broken edition; working only replaces ati with fglrx)
Comment 8 Martijn van de Streek 2006-09-05 22:35:08 UTC
Created attachment 6839 [details]
Xorg.log using current 'ati' driver (broken/wobbly)
Comment 9 Martijn van de Streek 2006-09-05 22:35:48 UTC
Created attachment 6840 [details]
Xorg.log using current 'fglrx' driver (working)
Comment 10 Martijn van de Streek 2006-09-05 22:42:31 UTC
The 'current ati' is actually 6.6.1 + the first patch from #5473
(https://bugs.freedesktop.org/attachment.cgi?id=5950)
Comment 11 Dave Airlie 2006-10-03 23:09:35 UTC
Can you send me a copy of your BIOS from that card?

we appear to have trouble processing the BIOS in your card in the same way as
fglrx does... 

if you have a newish kernel you can probably just go 
cd /sys/bus/pci/devices/<device:id>/
echo 1 > rom
cat rom > /tmp/fglrom

and mail it to me airlied@gmail.com
Comment 12 Martijn van de Streek 2006-10-04 11:07:16 UTC
Mail sent.
Comment 13 Martijn van de Streek 2006-12-20 02:15:39 UTC
Did you get the mail?
Comment 14 Samuel Bernard 2007-03-23 05:57:15 UTC
I have the same laptop than Martijn (HP nw8240) and the same bug and effects.
Tested today on version 6.6.3 and today git.

Notice that it's not a simple mobility x700 but a firegl mobility v5000 based on the same core.

fglrx works very well.
Comment 15 Hans Deragon 2007-04-20 11:36:09 UTC
With Ubuntu 7.04 Live-CD, it fails completely for me.  The screen generates bizarre effects (sort of like a b/w screensaver with fading effects) and you do not see the desktop.  My system reports "ATI Technologies Inc Radeon Mobility X700 (PCIE)".

Both drivers "ati" and "radeon" have the above symptoms.  "vesa" just fails with an error message telling that no matching mode can be found.  There is no way for me to get any desktop screen up on this laptop.
Comment 16 Hans Deragon 2007-04-20 11:55:54 UTC
According to:

http://h10010.www1.hp.com/wwpc/aa/en/sm/WF06a/7498257-7498765-7498765-7498765-12434670-12115736.html

and

http://avkrok.net/nw8240/

The graphic card is indeed a ATI Mobility FireGL V5000 with discrete PCI Express, as reported by Samuel Bernard previously.
Comment 17 Martijn van de Streek 2007-06-01 01:59:45 UTC
Created attachment 10150 [details]
The requested BIOS of my broken ATI
Comment 18 Martijn van de Streek 2007-06-01 02:01:27 UTC
Created attachment 10151 [details]
The video bios of a laptop with the same card, but working video

Too bad there doesn't seem to be a way to upgrade the video bios -- the HP website doesn't list any video bioses, just system bioses.
Comment 19 Martijn van de Streek 2007-06-22 23:14:42 UTC
Created attachment 10409 [details]
radeondump-dump, using fglrx driver
Comment 20 Martijn van de Streek 2007-06-22 23:15:11 UTC
Created attachment 10410 [details]
radeondump dump, made using the radeon driver, after using fglrx
Comment 21 Martijn van de Streek 2007-06-22 23:15:32 UTC
Created attachment 10411 [details]
radeondump, using the radeon driver, cold boot
Comment 22 Martijn van de Streek 2007-06-22 23:16:16 UTC
For some reason, running the "radeondump" utility, fixes the problem instantly. The screen stopps wobbling around and becomes usable.
Comment 23 Martijn van de Streek 2007-06-22 23:17:36 UTC
Created attachment 10412 [details]
radeondump dump, after first radeondump fixed things
Comment 24 Martijn van de Streek 2007-06-23 02:46:20 UTC
Created attachment 10417 [details]
radeontool regmatch \* output, after fixing using radeondump
Comment 25 Martijn van de Streek 2007-06-25 01:32:19 UTC
I've run radeondump with breakpoints now, to see when it happens.

The function radeon_in_pll in radeontool.c in the radeondump source does the magic. Specifically, this call does:

radeon_set(radeon, RADEON_CLOCK_CNTL_INDEX, offset & 0x3f);
Comment 26 Martijn van de Streek 2007-06-25 01:59:19 UTC
I've tried the three errata bits (CHIP_ERRATA_R300_CG, CHIP_ERRATA_R300_CG, CHIP_ERRATA_R300_CG), both alone and in all possible combinations, and none of them resolve the problem.
Comment 27 Martijn van de Streek 2007-06-25 04:18:59 UTC
Breakpoint 1, radeon_in_pll (radeon=0xbff1b600, offset=0) at radeontool.c:215
215             radeon_set(radeon, RADEON_CLOCK_CNTL_INDEX, offset & 0x3f);
(gdb) s
radeon_set (radeon=0xbff1b600, offset=8, value=0) at radeontool.c:142
142             if (radeon->mmio_mem == NULL) {
(gdb) s
153             *(unsigned int * volatile)(radeon->mmio_mem + offset) = value;  
(gdb) s
155     }
Comment 28 Martijn van de Streek 2007-06-25 04:23:31 UTC
(In reply to comment #26)
> I've tried the three errata bits (CHIP_ERRATA_R300_CG, CHIP_ERRATA_R300_CG,
> CHIP_ERRATA_R300_CG), both alone and in all possible combinations, and none of
> them resolve the problem.
> 

I mean CHIP_ERRATA_R300_CG, CHIP_ERRATA_PLL_DUMMYREADS and CHIP_ERRATA_PLL_DELAY, of course
Comment 29 Alex Deucher 2007-07-19 06:52:42 UTC
try adding:

INPLL(pScrn, 0x00);

to the end of RADEONRestorePLLRegisters() and RADEONRestorePLL2Registers() in radeon_driver.c and let me know if that helps.
Comment 30 Martijn van de Streek 2007-07-19 21:20:52 UTC
No difference
Comment 31 Alex Deucher 2007-07-19 21:38:54 UTC
(In reply to comment #30)
> No difference
> 

how about adding:

usleep(5000);
INPLL(pScrn, RADEON_VCLK_ECP_CNTL);

to the end of RADEONRestorePLLRegisters() and 

usleep(5000);
INPLL(pScrn, RADEON_PIXCLKS_CNTL);

to the end of RADEONRestorePLL2Registers()
Comment 32 Martijn van de Streek 2007-07-20 10:16:07 UTC
That doesn't fix it either..
Comment 33 Alex Deucher 2007-07-20 13:48:08 UTC
Several options to try:

See if you can isolate what PLL radeondump is reading that fixes things. It starts out by looping through the PLL index starting from 0x00 (line 139 of radeon_dump.c).  Maybe step through it and see which PLL reg fixes it.

Can you test the randr-1.2 branch of the radeon driver and see if it works better for you?
Comment 34 Martijn van de Streek 2007-07-20 21:25:36 UTC
The very first radeon_in_pll call fixes it.

I'll try the randr-1.2 branch
Comment 35 Martijn van de Streek 2007-07-20 21:45:07 UTC
Switching to randr-1.2 doesn't fix the problem either.
Comment 36 Alex Deucher 2007-07-21 07:14:20 UTC
try adding:

usleep(5000);
INPLL(pScrn, 0x00);

to the end of RADEONModeInit() before the return (ati master branch), both with and without the usleep().
Comment 37 Martijn van de Streek 2007-07-21 22:37:16 UTC
Still no lock (maybe the usleep has to be even longer?)
Comment 38 Martijn van de Streek 2007-07-21 22:37:33 UTC
uhr, luck of course
Comment 39 Alex Deucher 2007-07-22 16:01:33 UTC
Does switching modes after starting X fix it?  If you switch modes after running radeondump, do you have to run radeondump again to fix the problem?
Comment 40 Martijn van de Streek 2007-07-22 22:18:37 UTC
On every mode switch (like some games do), the breakage re-appears.
Switching back to text mode doesn't break -- text mode looks normal.
Mode-switching before running radeondump doesn't help.
Running radeondump always fixes it.
Comment 41 Alex Deucher 2007-07-23 06:19:34 UTC
try increasing the delay or try adding:

usleep(5000);
INPLL(pScrn, 0x00);

right before the returns in RADEONScreenInit() and RADEONSwitchMode() and RADEONEnterVT().
Comment 42 Alex Deucher 2007-07-23 06:24:10 UTC
one more thing to try.  loop through the whole set of PLLs at the end of RADEONModeInit(), e.g.:

usleep(10000);
for (i = 0x00; i < 0x3F; i += 4)
    INPLL(pScrn, i);
Comment 43 Martijn van de Streek 2007-07-23 09:42:59 UTC
(In reply to comment #41)
> try increasing the delay or try adding:
> 
> usleep(5000);
> INPLL(pScrn, 0x00);
> 
> right before the returns in RADEONScreenInit() and RADEONSwitchMode() and
> RADEONEnterVT().

I've added this, it didn't work, with delays from 5000-50000 in 5000 increments.
Comment 44 Martijn van de Streek 2007-07-23 09:43:16 UTC
(In reply to comment #42)
> one more thing to try.  loop through the whole set of PLLs at the end of
> RADEONModeInit(), e.g.:
> 
> usleep(10000);
> for (i = 0x00; i < 0x3F; i += 4)
>     INPLL(pScrn, i);
> 

This doesn't do it either.
Comment 45 Dave Airlie 2007-08-23 02:14:23 UTC
I think we should punt this to using randr 1.2 driver and we can attempt to fix it in master, it's not showing up as an easy fix for 6.7.
Comment 46 Timo Aaltonen 2007-10-09 01:35:19 UTC
Any update on this? Apparently it's still an issue with the latest ati.
Comment 47 Alex Deucher 2007-10-09 05:58:02 UTC
(In reply to comment #46)
> Any update on this? Apparently it's still an issue with the latest ati.
> 

It's hard to sort out this kind of problem unless you have hardware that exhibits it.  When we add full atom support to the radeon driver that might fix the issue, but I don't really have an ETA on when that will happen.
Comment 48 Alex Deucher 2007-12-13 21:32:16 UTC
Created attachment 13100 [details] [review]
possible fix

I think I may have found the fix.  Looks like newer cards may prefer using a full 32 bit R/W for RADEON_CLOCK_CNTL_INDEX.
Comment 49 Martijn van de Streek 2007-12-13 22:03:21 UTC
(In reply to comment #48)
> Created an attachment (id=13100) [details]
> possible fix
> 
> I think I may have found the fix.  Looks like newer cards may prefer using a
> full 32 bit R/W for RADEON_CLOCK_CNTL_INDEX.

I LOVE YOU!!


(it works :))
Comment 50 Alex Deucher 2007-12-13 23:18:14 UTC
fixed:
a84d446fd301d456bcea8f7abdc52e5a30776412


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.