[HSW][bisected] "sna: Defer submission of the next shadow frame until halfway through" causes stuttering
Submitted by Thomas Lindroth
Assigned to Chris Wilson @ickle
Link to original bug (#107421)
Description
Hardware: Haswell i7-4790K IGPU using all 3 connectors. All 3 monitors run at 1920x1200@59.95hz
Software: kernel-4.14.59, xorg-server-1.19.5, xf86-video-intel-git (AccelMethod=sna, TearFree=on), mesa-17.3.9, xfce-4.12 without compositing.
commit af36a4ab
Author: Chris Wilson chris@chris-wilson.co.uk
Date: Sun Apr 1 13:13:19 2018 +0100
sna: Defer submission of the next shadow frame until halfway through
Do not immediately post the next shadow flip on completion of the
current flips, but instead queue a timer for half way through the next
vblank so that try to we keep the additional input-output lag to less
than a frame.
After commit af36a4ab I've been getting a lot of stuttering when playing video. Both mpv and glxgears stutters. By stutter I mean dropped and duplicated frames.
The stutter only happens when multiple heads are active. Either clone mode or side by side. The stutter is periodic. It happens every 20 sec and last for about 5 sec. The remaining 15 sec is smooth. My guess is that I just ended up with those times on my system by accident. A side effect of my framerate and how fast the framerate drifts between my monitors or something like that.
I assumed the problem was in kernel space first and while debugging I noticed that the tracepoint i915:intel_engine_notify ring=0 fires a lot during stuttering but not when playback is smooth. notify_ring() is part of the irq handler so the RCS engine sends interrupts during stutter but not otherwise. I don't know what that means. The commit before the bad commit have no periodic stutter but the RCS engine sends interrupts almost constantly instead.
Let me know if you need any special debug output.