Bug 72343

Summary: Parts of complex GUI applications are blinking (becoming transparent for a short period of time) with Option "TearFree" set to "true"
Product: xorg Reporter: Alexander Tumin <iamtakingiteasy>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Alexander Tumin 2013-12-05 10:29:46 UTC
With Option "TearFree" "true" in xorg.conf as in 

Section "Device"
	Identifier  "Card0"
	Driver      "intel"
	BusID       "PCI:0:2:0"
	Option      "AccelMethod"  "sna"
	Option      "TearFree" "true"
EndSection

latest git version (on the moment of this report this was bd22abee8f33b20ff6bc7297b0a9ae8708d18727 commit on master branch) of xf86-video-intel is producing "blinking" effect for parts of application with complex GUI with lots of elements, when they are getting updated and redrawn or obscured by mouse cursor. When "TearFree" is commented out -- all works flawlessly. Only complex GUI applications like IDEs, or IMs (e.g. IntelliJ IDEA or Skype) are affected, simple ones (like terminal emulators) are working fine even with TearFree set to true.

My setup is:

X.Org X Server 1.14.99.903 (1.15.0 RC 3)
Release Date: 2013-11-23
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.12.2-tuxonice x86_64 Gentoo
Current Operating System: Linux noteshi 3.12.2-tuxonice #1 SMP Thu Dec 5 12:44:51 MSK 2013 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.12.2-tuxonice rootfstype=ext4 root=/dev/sda4

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0-devel (git-7435d9f)

Hardware: 

Lenovo ThinkPad X230 (HD4000)

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 21fa
        Flags: bus master, fast devsel, latency 0, IRQ 40
        Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 5000 [size=64]
        Expansion ROM at <unassigned> [disabled]
        Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [a4] PCI Advanced Features
        Kernel driver in use: i915
Comment 1 Chris Wilson 2013-12-05 10:32:30 UTC
Can you please keep expanding that list of broken applications until I have a match... ;-)
Comment 2 Alexander Tumin 2013-12-05 11:04:31 UTC
Sorry, i am failing to do so in much detail, i only have these additional applications where i were able to reproduce this bug:

Kdevelop -- using text editor in this IDE is almost impossible as any keypress thre makes many GUI element to "blink". I think qt-creator will have the same issue.

Gimp -- some menus are becoming invisible but current selected item, but this is rare.
Comment 3 Chris Wilson 2013-12-05 11:28:39 UTC
I've kdevelop under awesome with TearFree enabled. Typing is fairly busy, but I am not noticing a flash of broken rendering. Is there any chance you can grab a screencast or record a movie? (A picture is worth a thousand words when it comes to trying to spot relevant differences between setups.)
Comment 4 Chris Wilson 2013-12-05 16:22:55 UTC
Found (I guess) a similar issue using vncviewer:

commit 46256fa5a0ca4230ae7c226781c78c525e2648c6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Dec 5 16:12:22 2013 +0000

    sna: Pass MOVE_READ for partial TearFree move-to-gpu
    
    When fixing up a pending shadow pageflip for TearFree, we must tell it
    that it needs to flush the damage for a partial move-to-gpu. Even though
    the current area does not read from the destination, the move-to-gpu
    callback is a global pass, and we need to assume the worst for the
    region outside of the target.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72343
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

How does everything fare applying that patch?
Comment 5 Andreas Klauer 2013-12-09 12:59:04 UTC
I had similar issues with blinking and stuff ( mentioned in https://bugs.freedesktop.org/show_bug.cgi?id=68410#c77 ). They seem to be fixed now, nothing blinked anymore using the git version for a day.
Comment 6 Chris Wilson 2013-12-10 10:02:16 UTC
commit ade25f4f95994b565a8ed8eb3811ff7453a8b0e5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Dec 9 10:49:56 2013 +0000

    sna: Only discard READ hint for TearFree copy iff it subsumes the pixmap
    
    Remembering that the target window may be smaller than its backing
    pixmap.
    
    Reported-by: Andreas Klauer <Andreas.Klauer@metamorpher.de>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72430
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Should be the last...

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.