Bug 96593 - [i915] Mouse movement jitter after 'drm/i915: Use atomic commits for legacy page_flips'
Summary: [i915] Mouse movement jitter after 'drm/i915: Use atomic commits for legacy p...
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
Keywords: regression
Depends on:
Reported: 2016-06-19 14:08 UTC by Rafael Ristovski
Modified: 2016-12-13 08:26 UTC (History)
5 users (show)

See Also:
i915 platform: HSW
i915 features: display/atomic

Another attempt at not excessively stalling (3.23 KB, patch)
2016-06-22 13:21 UTC, Daniel Vetter
no flags Details | Splinter Review

Description Rafael Ristovski 2016-06-19 14:08:54 UTC
Kernel: next-20160617
OS: Gentoo Linux
xf86-video-intel: latest git
Xorg: latest git

  Dell Inspiron 3537
    i7-4500U (Haswell)
    Graphics 4400

Upon switching from next-20160615 to next-20160617,
I noticed that moving the cursor randomly causes its movement to jitter in a lag-behind/catch-up fashion (most noticeable when dragging windows as this applies the effect to the whole window, thus causing it not to move fluently).

Upon some bisecting I have found that this is caused by the following commit in linux-next:

ee042aa40b66d18d465206845b0752c6a617ba3f - drm/i915: Use atomic commits for legacy page_flips

Upon reverting this commit the issue is no longer present.

Another intriguing fact is that in some applications (ex. Games) which bind the mouse input - the movement is fine.

// Dmesg/Xorg.0.log not attached yet as those do not seem to contain any relevant data.
Comment 1 Rafael Ristovski 2016-06-19 14:27:19 UTC
Additional info:

DE: None
WM: XMonad

Xorg config:

Section "Device"
   Identifier "Intel Graphics"
   Driver "intel"
   Option "TearFree" "1"
   Option "TripleBuffer" "1"
   Option "DRI" "3"
   Option "Present" "1"
   Option "Accel" "1"
   Option "AccelMethod" "SNA"

i915 options: default
Comment 2 Daniel Vetter 2016-06-20 12:39:18 UTC
Write a bunch of quick hacks which all blew up in testing (just wanted to confirm that my hunch about the stalls was right).

Proper fix I think needs the following bits:
- address the FIXME in intel_atomic_commit_tail about when commit_hw_done() should be called. We need to make sure that this is before any of the expensive vblank waits, which needs the separate worker as described in the comments.

- in wait_for_depencies don't stall for flip_done for legacy cursor updates

This essentially gets us halfway there to faster-than-vrefresh updates. The other bits needed would just be the correct flip_done signalling, and switching the wait_for_vblank (before cleanup_planes) over to wait_for_flip.

Typing this down since I'm going on vacation soon and probably won't be able to fix this all up.
Comment 3 Daniel Vetter 2016-06-22 13:21:30 UTC
Created attachment 124666 [details] [review]
Another attempt at not excessively stalling

Please test.
Comment 4 Chris Wilson 2016-06-30 10:17:45 UTC
commit 527b6abe5fd2d24fba69e9564a2d608e1796ca8d
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 24 13:44:03 2016 +0100

    Revert "drm/i915: Use atomic commits for legacy page_flips"
    This reverts commit ee042aa40b66d18d465206845b0752c6a617ba3f.

Be prepared for next time!
Comment 5 Jari Tahvanainen 2016-12-13 08:26:59 UTC
Closing resolved+fixed. Commit causing the failure reverted by commit: 527b6abe.

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.