sna: Reorder vblank/flip event handling to avoid TearFree recursion
TearFree wants to grab the most recently used scanout for rendering the next frame into. If the flip event was still pending, we would then query the drm event buffer for any pending completions, but this would proceed to execute all the other events before the flip events as well. Since we they were out of sequence, we pushed them into a buffer to execute afterwards, however we forgot the side effects of the flip handlers, for example see commit af36a4ab ("sna: Defer submission of the next shadow frame until halfway through") and that there may have been events read from drm into a local buffer inside sna_mode_wakeup() that haven't been processed yet. Eliminate the need for calling sna_mode_wakeup() by ensuring that all flip events have been completed first before handing the vblank callbacks and potential drawing, ensuring the correct ordering. References: https://bugs.freedesktop.org/show_bug.cgi?id=105720 Signed-off-by:Chris Wilson <chris@chris-wilson.co.uk>
Loading
Please register or sign in to comment