[PATCH 1/3] present: Handle PresentOptionAsync for copy mode

Keith Packard keithp at keithp.com
Fri Dec 13 23:59:27 PST 2013


Check for Async flag and execute immediately if set, otherwise wait
for the next appropriate vblank before copying.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 present/present.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/present/present.c b/present/present.c
index 50bd055..4c0d63b 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++;
+        }
     }
 
     /*
-- 
1.8.4.4



More information about the xorg-devel mailing list