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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:15 +0000 (07:52 +0200)
commit872398068503bfb5eb58f5ff5aaac38c3cea41d8
treec6182433dc5784267732bc2641184daa0a29b698
parent418c85ea458a01522a2a61f5fd111043940b8e4e
drm/imx: move arming of the vblank event to atomic_flush

[ Upstream commit 6a055b92de15af987b4027826d43aa103c65a3c4 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/imx/ipuv3-crtc.c