Bug 14001 - Screen corruption on dual-link DVI with r500.
Summary: Screen corruption on dual-link DVI with r500.
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: git
Hardware: x86 (IA32) All
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-09 18:39 UTC by Chris Ball
Modified: 2008-01-14 13:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Photo after running "X" (825.30 KB, image/jpeg)
2008-01-09 18:44 UTC, Chris Ball
no flags Details
Photo after logging in (798.08 KB, image/jpeg)
2008-01-09 18:45 UTC, Chris Ball
no flags Details
Xorg.0.log (90.74 KB, text/x-log)
2008-01-09 18:47 UTC, Chris Ball
no flags Details
xorg.conf (2.45 KB, application/octet-stream)
2008-01-09 18:48 UTC, Chris Ball
no flags Details
avivotool regs all, under fglrx (190.19 KB, application/octet-stream)
2008-01-10 11:46 UTC, Chris Ball
no flags Details
avivotool regs all, under radeon (190.18 KB, application/octet-stream)
2008-01-10 11:46 UTC, Chris Ball
no flags Details
regs all diff from radeon to fglrx (5.79 KB, application/octet-stream)
2008-01-10 15:11 UTC, Chris Ball
no flags Details
Patch to clear scaler registers (465 bytes, patch)
2008-01-12 13:32 UTC, Chris Ball
no flags Details | Splinter Review
atom scaler code (708 bytes, patch)
2008-01-12 17:52 UTC, Alex Deucher
no flags Details | Splinter Review

Description Chris Ball 2008-01-09 18:39:36 UTC
Hi, 

I have an Apple 30" display and X1650 PCIe.  1280x800 works fine, but 2560x1600 generates corruption, as shown as in the two attached screenshots.

airlied and agd5f helped on IRC, and we tried a few things:

* it's not DRM; same happens with DRM off.
* turning ColorTiling off doesn't help.
* it's not a sync polarity problem.
* it's not a regression; although this was working on ajax's monitor around Nov 20th, a Nov 20th checkout doesn't work here.
* it *does* work in fglrx.

Log attached.  Tomorrow I'll run "avivotool regs all" with fglrx and radeon and attach that.
Comment 1 Chris Ball 2008-01-09 18:44:50 UTC
Created attachment 13628 [details]
Photo after running "X"
Comment 2 Chris Ball 2008-01-09 18:45:23 UTC
Created attachment 13629 [details]
Photo after logging in
Comment 3 Chris Ball 2008-01-09 18:47:43 UTC
Created attachment 13630 [details]
Xorg.0.log
Comment 4 Chris Ball 2008-01-09 18:48:18 UTC
Created attachment 13631 [details]
xorg.conf
Comment 5 Chris Ball 2008-01-10 11:46:01 UTC
Created attachment 13648 [details]
avivotool regs all, under fglrx
Comment 6 Chris Ball 2008-01-10 11:46:21 UTC
Created attachment 13649 [details]
avivotool regs all, under radeon
Comment 7 Chris Ball 2008-01-10 15:11:51 UTC
Created attachment 13654 [details]
regs all diff from radeon to fglrx
Comment 8 Chris Ball 2008-01-12 13:29:49 UTC
I have this fixed now!  I don't yet understand the fix, though.

I noticed that radeon worked when run *after* fglrx, which made things
a lot easier -- fglrx was obviously changing a necessary register that
radeon doesn't touch.  Finding that register was difficult; the 
<0x1000 registers weren't helping anything, and the "regs all" diff
between radeon-before-fglrx (failing case) and radeon-after-fglrx
(working case) had >100 registers in.

I wrote a perl script which takes two "avivotool regs all" dumps, the
first assumed to be the working state and the second assumed to be the
bad state, and sets every register currently in the bad state to the
good state, with a one second delay between each regset for you to see
whether it fixed the problem on the screen.  The script is here:

   http://dev.laptop.org/~cjb/apply-regs-diff.pl

This found the culprit register, which is a set of two:  0x6590
(which radeon_reg.h knows to be AVIVO_D1SCL_SCALER_ENABLE) and 0x6594.
Neither of these are touched by radeon, but the problem state is when
they are set; fglrx clears them, and they aren't changed by radeon at 
all.  The default state at bootup, before any drivers have been loaded, 
is for them to be set.

So, the attached works-for-me patch clears just those two registers 
at load-time.  The placement in atombios_crtc.c is just a guess, and 
I haven't commented the writes because I don't expect them to be
committed while 0x6594 remains magic.  How would I learn more about
these registers?  The AMD docs don't seem to cover them.

By the way, I'm sure other people have similar tools to my perl
script, but I don't know where any are.  You're welcome to include
my script with avivotool/radeontool if you'd like to.
Comment 9 Chris Ball 2008-01-12 13:32:19 UTC
Created attachment 13678 [details] [review]
Patch to clear scaler registers
Comment 10 Alex Deucher 2008-01-12 17:52:00 UTC
Created attachment 13683 [details] [review]
atom scaler code

Does this patch help?  This will disable the scaler if scaling is not enabled.  Enabling doesn't work just yet.
Comment 11 Chris Ball 2008-01-14 13:00:43 UTC
(In reply to comment #10)
> Does this patch help?  This will disable the scaler if scaling is not enabled. 
> Enabling doesn't work just yet.

Yep, works, thanks.  Can your patch be committed?
Comment 12 Alex Deucher 2008-01-14 13:14:56 UTC
committed.  thanks!


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.