drm/imx: move arming of the vblank event to atomic_flush
authorLucas Stach <l.stach@pengutronix.de>
Thu, 15 Mar 2018 09:11:59 +0000 (10:11 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 15 Mar 2018 16:52:41 +0000 (17:52 +0100)
commit6a055b92de15af987b4027826d43aa103c65a3c4
treecc31f87b70c42d341c811fd689f02fb8c5c83a58
parenta71d3241db6b9430e613cff168611bad97297ba2
drm/imx: move arming of the vblank event to atomic_flush

Right now the vblank event completion is racing with the atomic update,
which is especially bad when the PRE is in use, as one of the hardware
issue workaround might extend the atomic commit for quite some time.

If the vblank IRQ happens to trigger during that time, we will prematurely
signal the atomic commit completion to userspace, which causes tearing
when userspace re-uses a framebuffer we haven't managed to flip away from
yet.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/ipuv3-crtc.c