drm: rcar-du: Turn vblank on/off when enabling/disabling CRTC
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 18 Feb 2015 11:14:46 +0000 (13:14 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 3 Mar 2015 14:16:05 +0000 (16:16 +0200)
commit0cd90a542885a1272b58f96bbe4010588105e1bc
tree4f02df15583c0221e417d036c7e0fa0509536a9e
parent36693f3c3254d9361095f6b225d5e69bd8da5c32
drm: rcar-du: Turn vblank on/off when enabling/disabling CRTC

The DRM core vblank handling mechanism requires drivers to forcefully
turn vblank reporting off when disabling the CRTC, and to restore the
vblank reporting status when enabling the CRTC.

Implement this using the drm_crtc_vblank_on/off helpers. When disabling
vblank we must first wait for page flips to complete, so implement page
flip completion wait as well.

Finally, drm_crtc_vblank_off() must be called at startup to synchronize
the state of the vblank core code with the hardware, which is initially
disabled. This is performed at CRTC creation time, requiring vertical
blanking to be initialized before creating CRTCs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_drv.c