Bug 29986 - evergreen: 2D corruption (likely in EVERGREENDownloadFromScreen())
Summary: evergreen: 2D corruption (likely in EVERGREENDownloadFromScreen())
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/Radeon (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: xf86-video-ati maintainers
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 17:12 UTC by Christian Authmann
Modified: 2010-10-19 15:01 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
gcc testcase.c -lX11, run, watch testcase_out.ppm (1.52 KB, text/x-c)
2010-09-02 17:12 UTC, Christian Authmann
no flags Details
corrupted example-screenshot of two xterm on black background (24.31 KB, image/png)
2010-09-02 17:12 UTC, Christian Authmann
no flags Details
Yet another testcase (203.33 KB, image/jpeg)
2010-09-03 07:12 UTC, boris64
no flags Details
fix (1.90 KB, patch)
2010-09-09 16:13 UTC, Alex Deucher
no flags Details | Splinter Review

Description Christian Authmann 2010-09-02 17:12:02 UTC
Created attachment 38392 [details]
gcc testcase.c -lX11, run, watch testcase_out.ppm

I noticed these symptoms:

- corruption in screenshots taken with ImageMagick (import)
- corruption in kde3 unless RenderAccel Off

I've boiled ImageMagick down to a simple testcase (attached). A ErrorF() in the radeon driver told me that the corruption only happens in cases where EVERGREENDownloadFromScreen() is called - it's called in kde3 with RenderAccel On, it's never called with RenderAccel off.


I cannot test against a non-evergreen EXA implementation, but since there are no related bug reports for older cards, it's probably evergreen only. Can confirm that the testcase works with fglrx and nvidia.

using latest git from evergreen_accel branch, but the bug is present since the initial code-drop
Radeon HD 5770
Xorg 1.7.7
2.6.35
Comment 1 Christian Authmann 2010-09-02 17:12:49 UTC
Created attachment 38393 [details]
corrupted example-screenshot of two xterm on black background
Comment 2 Alex Deucher 2010-09-02 21:39:08 UTC
Can you try with the latest ddx code from git and this drm patch:
http://lists.freedesktop.org/archives/dri-devel/2010-September/003531.html
Comment 3 Christian Authmann 2010-09-03 06:32:12 UTC
I applied the patch and updated xf86-radeon and mesa to latest git. No changes.

upgraded to linux 2.6.36_rc3 (with or without the drm patch), no changes.

Upgraded libdrm from 2.4.21-r1 to git, no change.

Upgraded to xorg-server-1.8.2 (from 1.7.7), no change.

I wanted to try enabling ColorTiling, but even with Option "ColorTiling" "on", Xorg.0.log says it's off.

anything else I can try?
Comment 4 boris64 2010-09-03 07:12:23 UTC
Created attachment 38403 [details]
Yet another testcase

This is just another testcase run, taken
on an HD5850 using the latest git stuff
of drm/ddx(evergreen_accel)/mesa.

I also tried the attached patch above on
kernel 2.6.35.4 with no success.

I have lots of desktop corruptions + corrupted
mouse cursor as well, but i'll better create a 
new bug report for that, right?
Comment 5 Rafael Monica 2010-09-03 10:24:20 UTC
The patch fixes my lockups but corruption is still there. The corruption does indeed appear to originate in EVERGREENDownloadFromScreen. Adding 

Option "EXANoDownloadFromScreen" "on"

to xorg.conf makes the corruption disappear at the expense of some operations being slow.
Comment 6 boris64 2010-09-04 06:51:53 UTC
Comment #5 (++)

PS: Mouse cursor corruption is gone when setting 
Option "Renderaccel" in xorg.conf to "off". Is this worth 
a bug report or is it already known?
Comment 7 Alex Deucher 2010-09-09 11:16:43 UTC
using avivotool, available here:
http://cgit.freedesktop.org/~airlied/radeontool/
can you post the output (as root) of:
./avivotool regmatch 0x98fc

Then try the following and see if any of these settings fix the cursor corruption:
./avivotool regset 0x98fc 0x00006420
./avivotool regset 0x98fc 0x75316420
Comment 8 boris64 2010-09-09 11:53:44 UTC
Original 0x98fc setting
[output]avivotool regmatch 0x98fc
0x98fc  0x76543210 (1985229328)
[/output]

Yay, and i tried your settings. They both seem 
to fix the cursor corruption for me ;)
Comment 9 Rafael Monica 2010-09-09 13:34:04 UTC
Also fixes it for me.

Original reg settings:

0x98fc	0x00003210 (12816)
Comment 10 Christian Authmann 2010-09-09 16:06:59 UTC
> ./avivotool regmatch 0x98fc

0x98fc  0x00003210 (12816)
(both after a reboot from fglrx and a clean boot, both before and after starting X)

confirmed that testcase is still not working.

> Then try the following and see if any of these settings fix the cursor
> corruption:
> ./avivotool regset 0x98fc 0x00006420

testcase works

> ./avivotool regset 0x98fc 0x75316420

testcase works

No more visible artefacts in kde3 in 2d apps.
Comment 11 Alex Deucher 2010-09-09 16:13:42 UTC
Created attachment 38590 [details] [review]
fix

This drm kernel patch should fix the issues.
Comment 12 Christian Authmann 2010-09-10 04:02:46 UTC
> This drm kernel patch should fix the issues.

indeed it does, thanks a lot.
Comment 13 boris64 2010-09-10 05:21:33 UTC
(In reply to comment #12)
> > This drm kernel patch should fix the issues.
> 
> indeed it does, thanks a lot.

Works for me, too ;)
Comment 14 Maggioni Marcello 2010-09-12 18:04:02 UTC
Hi, I've applied the patch submitted above, at it solved a lot of corruption problems I had in KDE4 (before almost all the lower bar, the plasmoids and the mouse cursor where corrupted), the problem is that remains a corruption of the menu icons.
Comment 15 boris64 2010-09-12 18:12:49 UTC
(In reply to comment #14)
> Hi, I've applied the patch submitted above, at it solved a lot of corruption
> problems I had in KDE4 (before almost all the lower bar, the plasmoids and the
> mouse cursor where corrupted), the problem is that remains a corruption of the
> menu icons.

Please try to change your kde icon theme (and afterwards 
change it back to your favorite icon style) in systemsettings. 
This made those persistent corruption on my icons&desktop
theme go away (i think this must a rendering cache problem 
or something like that).
Comment 16 Alex Deucher 2010-10-19 15:01:49 UTC
fixed in kernel.


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.