From ca3a5b2a8f9f627bbaa9883e16512a21c2a0b81d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 12 Dec 2013 14:17:40 -0800 Subject: [PATCH] present: Handle PresentOptionAsync for copy mode Check for Async flag and execute immediately if set, otherwise wait for the next appropriate vblank before copying. Signed-off-by: Keith Packard --- present/present.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/present/present.c b/present/present.c index 50bd05539..4c0d63baf 100644 --- a/present/present.c +++ b/present/present.c @@ -663,10 +663,18 @@ present_pixmap(WindowPtr window, if (crtc_msc >= target_msc) { if (divisor != 0) { target_msc = crtc_msc - (crtc_msc % divisor) + remainder; - if (target_msc <= crtc_msc) - target_msc += divisor; - } else + if (options & PresentOptionAsync) { + if (target_msc < crtc_msc) + target_msc += divisor; + } else { + if (target_msc <= crtc_msc) + target_msc += divisor; + } + } else { target_msc = crtc_msc; + if (!(options & PresentOptionAsync)) + target_msc++; + } } /*