drm: rcar-du: Fix race condition when disabling planes at CRTC stop
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 28 Jul 2017 23:31:33 +0000 (02:31 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 3 Aug 2017 13:17:27 +0000 (16:17 +0300)
commit641307df71fe77d7b38a477067495ede05d47295
treee67af091860fae6e9ca454db8ba0a1e50a2699bb
parentd6160246f651b7cbd370408248f95c3bea8c24ed
drm: rcar-du: Fix race condition when disabling planes at CRTC stop

When stopping the CRTC the driver must disable all planes and wait for
the change to take effect at the next vblank. Merely calling
drm_crtc_wait_one_vblank() is not enough, as the function doesn't
include any mechanism to handle the race with vblank interrupts.

Replace the drm_crtc_wait_one_vblank() call with a manual mechanism that
handles the vblank interrupt race.

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_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_crtc.h