Bug 34584 - [i945gm] Screen Corruption with new Xorg stack with terminal programs (bisected)
[i945gm] Screen Corruption with new Xorg stack with terminal programs (bisected)
Status: RESOLVED FIXED
Product: xorg
Classification: Unclassified
Component: Driver/intel
7.6 (2010.12)
x86-64 (AMD64) Linux (All)
: high critical
Assigned To: Chris Wilson
Xorg Project Team
: regression
: 34714 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-22 16:05 UTC by Bryce Harrington
Modified: 2011-03-22 23:53 UTC (History)
4 users (show)

See Also:


Attachments
BootDmesg.txt (73.46 KB, text/plain)
2011-02-22 16:06 UTC, Bryce Harrington
no flags Details
CurrentDmesg.txt (247.84 KB, text/plain)
2011-02-22 16:07 UTC, Bryce Harrington
no flags Details
XorgLog.txt (34.32 KB, text/plain)
2011-02-22 16:07 UTC, Bryce Harrington
no flags Details
Still-Present.png (476.04 KB, image/png)
2011-02-22 16:09 UTC, Bryce Harrington
no flags Details
Reorder the pipelined flush (1.45 KB, patch)
2011-03-17 03:32 UTC, Chris Wilson
no flags Details | Splinter Review
Fix piplelined fence corruption (9.33 KB, patch)
2011-03-17 12:04 UTC, Chris Wilson
no flags Details | Splinter Review
Fix piplelined fence corruption (9.78 KB, patch)
2011-03-17 12:26 UTC, Chris Wilson
no flags Details | Splinter Review
Fix tiling corruption (2.54 KB, patch)
2011-03-18 02:53 UTC, Chris Wilson
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Bryce Harrington 2011-02-22 16:05:04 UTC
Forwarding this bug from Ubuntu reporter Stefano Rivera:
http://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/717114

[Problem]
With recent kernels a number of people are noticing various corruption in terminal programs.

It appears there was a regression introduced with the introduction of the 2.6.38-1 kernel. The issue is irregular but affects text rendering by interlacing pixels from text elsewhere in the given text buffer when doing rapid scrolling of large quantities of text. This most often shows itself in terminal windows but can also be seen sometimes in firefox's rendered text. The issue seems to appear more often with compiz but has been seen in metacity. Only a minority of users seem to be reproducing the behavior, suggesting these users have some sort of hardware or configurational aspect in common, but so far the commonality between the users is not known.  Perhaps it's an 64-bit-specific issue?

Stefano bisected the problem and found this as the first commit where the misbehavior can be reproduced:

commit 6bda10d152735c22baf1dcd92937420b4b0a359a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Dec 5 21:04:18 2010 +0000

    drm/i915: Completely disable fence pipelining.

    I'm still seeing tiling corruption of PutImage and CopyArea (I think)
    under mutter on pnv, so obviously the pipelining logic is deeply flawed.

    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

[Original Description]
Corruption seen in gnome-terminal. And also seen in the chromium tab-bar.
Just caught one now with Firefox on slashdot (first try).

The first time I reported this (in a comment on lp #710961), I was using Unity, but I'm back to GNOME with Compiz.

> Do you recall more precisely when you started noticing it?

I seem to remember it was very soon after your announcement [of moving to xorg-server 1.9.99, coinciding with an update from 2.6.37 to 2.6.38 on the kernel side], but I don't know why I didn't file it immediately then. Maybe I was waiting for Xorg to be uploaded too. Sorry, life in development releases means you run into quite a lot of bugs, and don't file them all immediately (hope someone else saw them and did the work).

Just ran a bisection, and it pinpoints 6bda10d152735c22baf1dcd92937420b4b0a359a

commit 6bda10d152735c22baf1dcd92937420b4b0a359a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Dec 5 21:04:18 2010 +0000

    drm/i915: Completely disable fence pipelining.

    I'm still seeing tiling corruption of PutImage and CopyArea (I think)
    under mutter on pnv, so obviously the pipelining logic is deeply flawed.

    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Bisection log:
    See - https://bugs.launchpad.net/ubuntu/+bug/717114/comments/23


DistroRelease: Ubuntu 11.04
Package: xserver-xorg-video-intel 2:2.14.0-1ubuntu6
ProcVersionSignature: Ubuntu 2.6.38-3.30-generic 2.6.38-rc4
Uname: Linux 2.6.38-3-generic x86_64
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,scale,session,unityshell]
CompositorRunning: compiz
DRM.card0.DVI.D.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes: 
 edid-base64:
DRM.card0.LVDS.1:
 status: connected
 enabled: enabled
 dpms: On
 modes: 1280x800
 edid-base64: AP///////wAGEF+cAAAAAAgQAQOAHRJ4Ci8wl1hTiyklUFQAAAABAQEBAQEBAQEBAQEBAQEBvBsAoFAgFzAwIDYAHrMQAAAYAAAAAQAGECAAAAAAAAAAAAogAAAA/gBMUDEzM1dYMS1UTEExAAAA/gBDb2xvciBMQ0QKICAgAMI=
DRM.card0.VGA.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes: 
 edid-base64:
Date: Fri Feb 11 15:30:32 2011
DistUpgraded: Yes, recently upgraded Log time: 2009-12-11 10:51:59.838477
DistroCodename: natty
DistroVariant: ubuntu
DkmsStatus:
 
GraphicsCard:
 Subsystem: Intel Corporation Device [8086:7270]
   Subsystem: Intel Corporation Device [8086:7270]
MachineType: Apple Inc. MacBook2,1
ProcEnviron:
 LANGUAGE=en_ZA:en
 PATH=(custom, user)
 LANG=en_ZA.UTF-8
 LC_MESSAGES=en_ZA.utf8ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-3-generic root=UUID=3345fa7f-d2c4-456f-8d0d-8fdb515433f7 ro quiet splash vt.handoff=7
Renderer: Hardware acceleration
SourcePackage: xserver-xorg-video-intel
dmi.bios.date: 06/27/07
dmi.bios.vendor: Apple Inc.
dmi.bios.version: MB21.88Z.00A5.B07.0706270922
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: Mac-F4208CAA
dmi.board.vendor: Apple Inc.
dmi.board.version: PVT
dmi.chassis.asset.tag: Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: Apple Inc.
dmi.chassis.version: Mac-F4208CAA
dmi.modalias: dmi:bvnAppleInc.:bvrMB21.88Z.00A5.B07.0706270922:bd06/27/07:svnAppleInc.:pnMacBook2,1:pvr1.0:rvnAppleInc.:rnMac-F4208CAA:rvrPVT:cvnAppleInc.:ct10:cvrMac-F4208CAA:
dmi.product.name: MacBook2,1
dmi.product.version: 1.0
dmi.sys.vendor: Apple Inc.
version.compiz: compiz 1:0.9.2.1+glibmainloop4-0ubuntu10
version.libdrm2: libdrm2 2.4.23-1ubuntu3
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10-1ubuntu1
version.xserver-xorg: xserver-xorg 1:7.6~3ubuntu4
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.13.2+git20110124.fadee040-0ubuntu4
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-1ubuntu6
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu4
Comment 1 Bryce Harrington 2011-02-22 16:06:38 UTC
Created attachment 43684 [details]
BootDmesg.txt
Comment 2 Bryce Harrington 2011-02-22 16:07:28 UTC
Created attachment 43685 [details]
CurrentDmesg.txt
Comment 3 Bryce Harrington 2011-02-22 16:07:46 UTC
Created attachment 43686 [details]
XorgLog.txt
Comment 4 Bryce Harrington 2011-02-22 16:09:33 UTC
Created attachment 43687 [details]
Still-Present.png

Screenshot.

Notice the lines of pixels through certain text elements.  These appear sometimes when scrolling rapidly.
Comment 5 Bryce Harrington 2011-02-22 16:10:17 UTC
(Fwiw, we've gotten some other bug reports relating to terminal corruption regressions, which may or may not be related, but I'm keeping them separate for now.)
Comment 6 Simon Strandman 2011-03-03 13:40:30 UTC
*** Bug 34714 has been marked as a duplicate of this bug. ***
Comment 7 Simon Strandman 2011-03-03 13:46:20 UTC
I reported #34714 but I'm pretty sure this is the same issue. It's not a 64bit issue btw, I have it on my 32bit netbook.
Comment 8 Chris Wilson 2011-03-08 02:14:39 UTC
I'm optimistic that

commit 467cffba85791cdfce38c124d75bd578f4bb8625
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Mar 7 10:42:03 2011 +0000

    drm/i915: Rebind the buffer if its alignment constraints changes with tiling
    
    Early gen3 and gen2 chipset do not have the relaxed per-surface tiling
    constraints of the later chipsets, so we need to check that the GTT
    alignment is correct for the new tiling. If it is not, we need to
    rebind.
    
    Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

will have had some positive impact on a few of these corruptions...
Comment 9 Stefano Rivera 2011-03-09 14:58:50 UTC
(In reply to comment #8)
> I'm optimistic that
> commit 467cffba85791cdfce38c124d75bd578f4bb8625
> will have had some positive impact on a few of these corruptions...

Hard to say if it has, I still see lots of corruption.

I tested with the Ubuntu 2.6.38-6.34 kernel + 467cffba85791cdfce38c124d75bd578f4bb8625.
Comment 10 Andy Whitcroft 2011-03-17 01:48:23 UTC
Can confirm that this corruption is still present in the Ubuntu-2.6.38-7.35 kernel which is v2.6.38 based and contains Chris' fix.
Comment 11 Andy Whitcroft 2011-03-17 02:58:56 UTC
In the Ubuntu bug it has been suggested that reverting commit 6bda10d152735c22baf1dcd92937420b4b0a359a helps with this corruption.  I can confirm that reverting that does indeed eliminate the corruption in terminal windows for me, _however_ I then get corruption elsewhere mostly in icons for flies on the desktop and on chromiums toolbar icons as they change colour; mostly a striated look, as if incorrectly tiled.
Comment 12 Chris Wilson 2011-03-17 03:32:10 UTC
Created attachment 44535 [details] [review]
Reorder the pipelined flush

Had a chat with Andy Whitcroft and we put together this patch for testing, there will be a Ubuntu kernel availably shortly.
Comment 13 Stefano Rivera 2011-03-17 09:00:59 UTC
(In reply to comment #12)
> Created an attachment (id=44535) [details]
> Reorder the pipelined flush
> 
> Had a chat with Andy Whitcroft and we put together this patch for testing,
> there will be a Ubuntu kernel availably shortly.

Makes a massive difference. I haven't seen any corruption with this patch.
Comment 14 Chris Wilson 2011-03-17 12:04:59 UTC
Created attachment 44552 [details] [review]
Fix piplelined fence corruption

A second variant I want to try. Hopefully this introduces far fewer stalls than the first.
Comment 15 Chris Wilson 2011-03-17 12:26:42 UTC
Created attachment 44553 [details] [review]
Fix piplelined fence corruption
Comment 16 Chris Wilson 2011-03-18 02:53:27 UTC
Created attachment 44574 [details] [review]
Fix tiling corruption

New version for linus/master
Comment 17 Chris Wilson 2011-03-22 23:53:40 UTC
Working on the theory that it is one and the same bug:

commit b5b5ac2dec49ea5ae033434efa90863aa5cdfb2c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 17 15:23:22 2011 +0000

    drm/i915: Fix tiling corruption from pipelined fencing
    
    ... even though it was disabled. A mistake in the handling of fence reuse
    caused us to skip the vital delay of waiting for the object to finish
    rendering before changing the register.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34584
    Cc: Andy Whitcroft <apw@canonical.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    [Note for 2.6.38-stable, we need to reintroduce the interruptible passing]
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Tested-by: Dave Airlie <airlied@linux.ie>