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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 11:36:03 +0000 (12:36 +0100)
commit230ca8fb951528f298e06a9c15257df5df85ecbd
tree0b4f972a4b913640afd436188de266aee621be16
parent758e22acf4fd9aaf51c7bae93a47401b8f792d56
drm: rcar-du: Fix race condition when disabling planes at CRTC stop

commit 641307df71fe77d7b38a477067495ede05d47295 upstream.

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>
Signed-off-by: thongsyho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_crtc.h