drm: rcar-du: Arm the page flip event after queuing the page flip
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sat, 4 Mar 2017 13:14:47 +0000 (15:14 +0200)
committerKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Mon, 22 May 2017 15:11:41 +0000 (16:11 +0100)
commit7f53b19cdff78f696b61cd5987dfe1a5d432676b
tree4696d60807e57b00835294b014e5b6099c17e74d
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6
drm: rcar-du: Arm the page flip event after queuing the page flip

The page flip event is armed in the atomic begin handler, creating a
race condition with the frame end interrupt that could send the event
before the atomic operation actually completes. To avoid that, arm the
event in the atomic flush handler after queuing the page flip.

This change doesn't fully close the race window, as the frame end
interrupt could be generated before the page flip is committed to
hardware but only handled after the event is armed. However, the race
window is now much smaller.

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