drm: rcar-du: Wait for flip completion instead of vblank in commit tail
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 13 Jul 2017 22:26:52 +0000 (01:26 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 3 Aug 2017 13:17:26 +0000 (16:17 +0300)
commitd6160246f651b7cbd370408248f95c3bea8c24ed
treea3b1b118e8f1889ee886df6555fbc72ad923f30b
parentcbbb90b0c084d7dfb2ed8e3fecf8df200fbdd2a0
drm: rcar-du: Wait for flip completion instead of vblank in commit tail

Page flips can take more than one vertical blanking to complete if
arming the page flips races with the vertical blanking interrupt.
Waiting for one vblank to complete the atomic commit in the commit tail
handler is thus incorrect, and can lead to framebuffers being released
while still being scanned out.

Fix this by waiting for flip completion instead, using the
drm_atomic_helper_wait_for_flip_done() helper.

Fixes: 0d230422d256 ("drm: rcar-du: Register a completion callback with VSP1")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_kms.c