Flush GL commands before a DRM page flip
Otherwise unfinished frames get drawn to the screen.
BUG=chromium-os:25587
TEST=None
Change-Id: Ifd0cd6ad2065294fee7003df555735a26908c7a0
Signed-off-by: Simon Que <sque@chromium.org>
diff --git a/src/canvas-drm.cpp b/src/canvas-drm.cpp
index 5513849..596d03d 100644
--- a/src/canvas-drm.cpp
+++ b/src/canvas-drm.cpp
@@ -476,6 +476,7 @@
// Attempt to flip to the first rendered buffer in the queue.
if (current_front_buffer_index_ < 0) {
+ glFlush();
ret = drmModePageFlip(fd_, kms_.encoder->crtc_id,
kms_.fb_ids[rendered_buffers_.front()],
DRM_MODE_PAGE_FLIP_EVENT, this);