Bug 29227

Summary: xorg display corruption after suspend/resume with drm-next
Product: xorg Reporter: Pierre Ossman <pierre-bugzilla>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Pierre Ossman 2010-07-23 05:18:08 UTC
Using drm-next (v2.6.34-rc5-10857-g7d8d9ac) and doing a suspend of my machine, then Xorg fails to provide any sensible output upon resume. The console works fine, and the bug doesn't appear with Fedora kernel 2.6.33.6-147.fc13.x86_64.

Hardware: RV790

Software:

xorg-x11-server-Xorg-1.8.2-2.fc13.x86_64
DDX: xf86-video-ati-6.13.0-56-g37b3480
Mesa: mesa_7_6_1_rc1-9178-g7743791
DRM: 2.4.20-20-g66375fd
Comment 1 Pierre Ossman 2010-07-24 15:30:10 UTC
I did some more testing and the bug exists in plain 2.6.35-rc5 (on which drm-next is currently based), but not in rc4. I'll see if I can find something more precise...
Comment 2 Pierre Ossman 2010-07-24 15:52:45 UTC
Sorry, disregard that last comment. drm-next is based on -rc4, not -rc5. And it seems I tested the wrong kernel. Actual results:

2.6.35-rc4: works fine
drm-next: breaks on resume
Comment 3 Pierre Ossman 2010-07-25 05:26:34 UTC
Result from some bisecting:

5cffee1be7a2b62385fe1e80deecf491042a6f06 is the first bad commit
commit 5cffee1be7a2b62385fe1e80deecf491042a6f06
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Jun 22 01:54:48 2010 -0400

    drm/radeon: optimize default 3D state for r6xx/r7xx blits
    
    Re-organize emit order to reduce the number of dwords in the
    default 3D state.  This change reduces the default state size
    from 514 dwords to 282.
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
Comment 4 Rafał Miłecki 2010-07-25 15:50:32 UTC
Also reported on
http://lists.freedesktop.org/archives/dri-devel/2010-July/002322.html
Comment 5 Alex Deucher 2010-07-26 11:57:00 UTC
Can you revert that commit and try this set of patches instead?
http://people.freedesktop.org/~agd5f/reduce_emit/
And see which if any of those cause a problem?
Comment 6 Pierre Ossman 2010-07-27 06:30:55 UTC
Patch 0002 breaks things. And patch 0003 also makes the suspend hang somewhere (same behaviour as RH bug 617561). Applying all 6 patches makes the hang go away, but the corruption remain.
Comment 7 Alex Deucher 2010-07-27 08:28:22 UTC
Rafał tracked it down to the missing sampler emit.  New patch set:
http://people.freedesktop.org/~agd5f/reduce_emit/
Comment 8 Pierre Ossman 2010-07-27 12:25:59 UTC
New patch set seems to work fine. No hangs and no corruption from what I can see.
Comment 9 Alex Deucher 2010-07-29 21:57:34 UTC
Final version:
http://people.freedesktop.org/~agd5f/reduce_emit/
Comment 10 Pierre Ossman 2010-08-11 02:59:11 UTC
(Thumb dislodged from backside)

Latest set of patches work fine as well.
Comment 11 Alex Deucher 2010-08-11 09:36:14 UTC
Already upstream for 2.6.36.

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.