Bug 96180 - TearFree is lost after switching output monitors
Summary: TearFree is lost after switching output monitors
Status: NEW
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 08:30 UTC by Martin Jørgensen
Modified: 2017-02-01 10:23 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
xorg server log (134.28 KB, text/plain)
2016-05-25 08:30 UTC, Martin Jørgensen
no flags Details
new xorg log, after latest kernel and git code (45.86 KB, text/plain)
2016-06-27 06:35 UTC, Martin Jørgensen
no flags Details
xorg server log with new error (35.73 KB, text/plain)
2016-06-28 09:45 UTC, Martin Jørgensen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jørgensen 2016-05-25 08:30:18 UTC
I'm running latest Debian Stretch on a ThinkPad X1 Carbon 20A7, sometimes attached to a dock.

When detaching or attaching my dock with a DP monitor attached, my video output gets teared. I saw this in the attached Xorg.0.log:

[   807.026] (II) intel(0): switch to mode 2560x1440@60.0 on DP2-2 using pipe 1, position (0, 0), rotation normal, reflection none
[  1123.133] (EE) intel(0): Failed to prepare CRTC for page flipping, disabling TearFree
[  1123.690] (II) intel(0): switch to mode 2560x1440@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[  1123.986] (EE) intel(0): Failed to prepare CRTC for page flipping, disabling TearFree
[  1123.991] (II) intel(0): Disabled output DP2-1
[  1123.991] (II) intel(0): Disabled output DP2-2
[  1123.991] (II) intel(0): Disabled output DP2-3
[ 11204.479] (II) intel(0): Enabled output DP2-1
[ 11204.479] (II) intel(0): Enabled output DP2-2
[ 11204.479] (II) intel(0): Enabled output DP2-3


Any ideas?
Comment 1 Martin Jørgensen 2016-05-25 08:30:52 UTC
Created attachment 124077 [details]
xorg server log
Comment 2 Chris Wilson 2016-05-25 09:16:38 UTC
Hmm, tricksy. We stop pageflipping because the HW reports a failure, so the only question is when to try and start again. Usually I pick a modeset, in this case trying after a topology change would make the most sense.
Comment 3 Martin Jørgensen 2016-05-26 13:28:16 UTC
Anything I can do yo help/test?
Comment 4 Chris Wilson 2016-05-28 18:28:50 UTC
Only vaguely sensible idea, try and re-enable TearFree next time everything is turned off. If reconfiguring isn't enough, a DPMS cycle should be.

commit 4458f1bf8a5cfbed0c4bbe9d968719c47ee0ea7d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat May 28 19:23:38 2016 +0100

    sna: Restore TearFree operation after switching everything off
    
    We give up on TearFree if we ever see an error whilst page flipping (in
    the hope that we can keep displaying via direct use of the scanout).
    With the advent of MST, this can happen simply by the user unplugging a
    dock causing connectors to disappear and if we flip before we see the
    uevent telling us which outputs are disabled, we get an error.
    
    So, lets try and re-enable TearFree on the next opportunity, when all
    the outputs are off and we can rebuild the shadow buffer.
    
    Reported-by: Martin Jørgensen <mkj@gotu.dk>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=96180
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 5 Martin Jørgensen 2016-06-27 06:35:29 UTC
Today I tested with latest code from git, and now got different result.
After unpluging a second time the same error was produced, although it *seems* TearFree is still on. Games and video still seem to be in "sync". I haven't tested it thoroughly yet...


[  3758.654] (EE) intel(0): Failed to prepare CRTC for page flipping, disabling TearFree
[  3758.692] (II) intel(0): switch to mode 2560x1440@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none
[  3758.973] (II) intel(0): Disabled output DP2-1
[  3758.973] (II) intel(0): Disabled output DP2-2
[  3758.973] (II) intel(0): Disabled output DP2-3

Adding new Xorg.0.log
Comment 6 Martin Jørgensen 2016-06-27 06:35:56 UTC
Created attachment 124738 [details]
new xorg log, after latest kernel and git code
Comment 7 Martin Jørgensen 2016-06-27 19:13:35 UTC
Nope, I was wrong. Still some tearing, like videos in web browsers.
Comment 8 Martin Jørgensen 2016-06-28 09:45:08 UTC
Just came about a new error, after unplug:

[  6490.718] (EE) intel(0): sna_mode_redisplay: page flipping failed, disabling CRTC:30 (pipe=1)


Full Xorg.0.log attached later
Comment 9 Martin Jørgensen 2016-06-28 09:45:44 UTC
Created attachment 124757 [details]
xorg server log with new error


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.